public void Create_UrdfJointContinuous_Succeeds()
        {
            GameObject       linkObject       = new GameObject("link");
            UrdfJoint        joint            = UrdfJointContinuous.Create(linkObject);
            UrdfJoint        urdfJoint        = linkObject.GetComponent <UrdfJoint>();
            ArticulationBody articulationBody = linkObject.GetComponent <ArticulationBody>();

            Assert.IsTrue(joint is UrdfJointContinuous);
            Assert.AreEqual(joint, urdfJoint);
            Assert.AreEqual(ArticulationJointType.RevoluteJoint, articulationBody.jointType);

            Object.DestroyImmediate(linkObject);
        }
        public void UpdateJointState_Succeeds()
        {
            GameObject baseObject = new GameObject("base");
            GameObject linkObject = new GameObject("link");

            linkObject.transform.parent = baseObject.transform;

            UrdfJoint.Create(baseObject, UrdfJoint.JointTypes.Fixed);
            UrdfJoint        joint            = UrdfJointContinuous.Create(linkObject);
            ArticulationBody articulationBody = linkObject.GetComponent <ArticulationBody>();

            Assert.AreEqual(0, articulationBody.xDrive.target);
            joint.UpdateJointState(1);
            Assert.AreEqual(1, articulationBody.xDrive.target);

            Object.DestroyImmediate(baseObject);
        }
        public void GetPositionVelocityEffort_Succeeds()
        {
            GameObject baseObject = new GameObject("base");
            GameObject linkObject = new GameObject("link");

            linkObject.transform.parent = baseObject.transform;

            UrdfJoint.Create(baseObject, UrdfJoint.JointTypes.Fixed);
            UrdfJoint        joint            = UrdfJointContinuous.Create(linkObject);
            ArticulationBody articulationBody = linkObject.GetComponent <ArticulationBody>();

            articulationBody.jointPosition = new ArticulationReducedSpace(1, 2, 3);
            articulationBody.jointVelocity = new ArticulationReducedSpace(4, 5, 6);
            articulationBody.jointForce    = new ArticulationReducedSpace(7, 8, 9);

            Assert.AreEqual(1, joint.GetPosition());
            Assert.AreEqual(4, joint.GetVelocity());
            Assert.AreEqual(7, joint.GetEffort());

            Object.DestroyImmediate(baseObject);
        }