public void Create_UrdfJointRevolute_Succeeds() { GameObject linkObject = new GameObject("link"); UrdfJoint joint = UrdfJointRevolute.Create(linkObject); UrdfJoint urdfJoint = linkObject.GetComponent <UrdfJoint>(); ArticulationBody articulationBody = linkObject.GetComponent <ArticulationBody>(); Assert.IsTrue(joint is UrdfJointRevolute); 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 = UrdfJointRevolute.Create(linkObject); ArticulationBody articulationBody = linkObject.GetComponent <ArticulationBody>(); Assert.AreEqual(0, articulationBody.xDrive.target); joint.UpdateJointState(1); Assert.AreEqual(1 * Mathf.Rad2Deg, articulationBody.xDrive.target); Object.DestroyImmediate(baseObject); }
private void Start() { urdfJoint = GetComponent <UrdfJointRevolute>(); }