public override void OnInspectorGUI()
        {
            DrawDefaultInspector();

            if (buttonStyle == null)
            {
                buttonStyle = new GUIStyle(EditorStyles.miniButtonRight)
                {
                    fixedWidth = 75
                }
            }
            ;

            jointStatePatcher = (JointStatePatcher)target;

            GUILayout.Label("All Urdf Joints", EditorStyles.boldLabel);
            DisplaySettingsToggle(new GUIContent("Publish Joint State", "Adds/removes a Joint State Reader on each joint."),
                                  jointStatePatcher.SetPublishJointStates);
            DisplaySettingsToggle(new GUIContent("Subscribe Joint State", "Adds/removes a Joint State Writer on each joint."),
                                  jointStatePatcher.SetSubscribeJointStates);
        }
Esempio n. 2
0
        private void DisableVuforia()
        {
            UrdfRobot RealRobot  = null;
            UrdfRobot GhostRobot = null;

            foreach (GameObject objectToClone in objectsToClone)
            {
                GameObject cloneObject = Instantiate <GameObject>(objectToClone);
                cloneObject.transform.parent     = null;
                cloneObject.transform.localScale = objectToClone.transform.lossyScale;
                cloneObject.transform.position   = objectToClone.transform.position;
                cloneObject.transform.rotation   = objectToClone.transform.rotation;
                if (cloneObject.name == RealRobotName)
                {
                    RealRobot = cloneObject.GetComponent <UrdfRobot>();
                }
                else if (cloneObject.name == GhostRobotName)
                {
                    GhostRobot = cloneObject.GetComponent <UrdfRobot>();
                }
            }

            VuforiaBehaviour.Instance.enabled = false;

            if (RealRobot)
            {
                JointStatePatcher jsp = rosConnector.GetComponent <JointStatePatcher>();
                jsp.UrdfRobot = RealRobot;
                jsp.SetSubscribeJointStates(true);
            }

            if (GhostRobot)
            {
                TrajectoryPositionsPatcher tpp = rosConnector.GetComponent <TrajectoryPositionsPatcher>();
                tpp.ghostRobot = GhostRobot;
                tpp.SetSubscribeTrajectoryPositions(true);
            }
        }