public void Create_UrdfJointPlanar_Succeeds() { GameObject linkObject = new GameObject("link"); UrdfJoint joint = UrdfJointPlanar.Create(linkObject); UrdfJoint urdfJoint = linkObject.GetComponent <UrdfJoint>(); ArticulationBody articulationBody = linkObject.GetComponent <ArticulationBody>(); Assert.IsTrue(joint is UrdfJointPlanar); Assert.AreEqual(joint, urdfJoint); Assert.AreEqual(ArticulationJointType.PrismaticJoint, articulationBody.jointType); Object.DestroyImmediate(linkObject); }
public void GetPosition_Succeeds() { GameObject baseObject = new GameObject("base"); GameObject linkObject = new GameObject("link"); linkObject.transform.parent = baseObject.transform; linkObject.transform.localPosition = new Vector3(1, 2, 3); UrdfJoint.Create(baseObject, UrdfJoint.JointTypes.Fixed); UrdfJoint joint = UrdfJointPlanar.Create(linkObject); Assert.AreEqual(linkObject.transform.localPosition.magnitude, joint.GetPosition()); Object.DestroyImmediate(baseObject); }