Esempio n. 1
0
        private void ResetPosition()
        {
            if (!isAnimationStart)
            {
                newState = actualJointState;
            }

            if (trajectory != null)
            {
                urdfJoint.UpdateJointState(trajectory[0] - newState);
            }
        }
        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 WriteUpdate()
        {
            urdfJoint.UpdateJointState(newState - prevState);

            prevState = newState;
        }