public void AreLimitsCorrect_Fails()
        {
            var joint = new Joint(
                name: "custom_joint", type: "planar", parent: "base", child: "link",
                limit: new Joint.Limit(5, 4, 6, 7),
                dynamics: new Joint.Dynamics(8, 9));
            GameObject linkObject = new GameObject("link");
            UrdfJoint  urdfJoint  = UrdfJoint.Create(linkObject, UrdfJoint.JointTypes.Revolute, joint);

            Assert.IsFalse(urdfJoint.AreLimitsCorrect());

            Object.DestroyImmediate(linkObject);
        }
        public void AreLimitsCorrect_Succeeds()
        {
            var joint = new Joint(
                name: "custom_joint", type: "planar", parent: "base", child: "link",
                limit: new Joint.Limit(4, 5, 6, 7),
                dynamics: new Joint.Dynamics(8, 9));
            GameObject linkObject = new GameObject("link");
            UrdfJoint  urdfJoint  = UrdfJoint.Create(linkObject, UrdfJoint.JointTypes.Prismatic, joint);

            Assert.IsTrue(urdfJoint.AreLimitsCorrect());

            Object.DestroyImmediate(linkObject);
        }
Ejemplo n.º 3
0
        public void DisplayRequiredLimitMessage(string limitLocation)
        {
            GUILayout.Space(5);
            EditorGUILayout.LabelField("Joint Limits");

            urdfJoint.EffortLimit   = EditorGUILayout.DoubleField("Effort Limit", urdfJoint.EffortLimit);
            urdfJoint.VelocityLimit = EditorGUILayout.DoubleField("Velocity Limit", urdfJoint.VelocityLimit);

            if (!urdfJoint.AreLimitsCorrect())
            {
                EditorGUILayout.HelpBox("Limits are required for this joint type. Please enter valid limit values in " + limitLocation + ".", MessageType.Warning);
            }

            GUILayout.Space(5);
        }