public void NewRobotSelected(GameObject robot) { //Debug.Log("new Robot Selected: " + robot.name); if (robot.GetComponent <RosConnector>() == null) { Debug.Log("Error: No rosConnector found"); return; } robotManager = robot; rosConnector = robotManager.GetComponent <RosConnector>(); jointStatePublisher = robotManager.GetComponent <JointStatePublisher>(); jointStateSubscriber = robotManager.GetComponent <JointStateSubscriber>(); poseStampedPublisher = robotManager.GetComponent <CustomPoseStampedPublisher>(); rosMode = dropdownRobotManager.robotConfigs[dropdownRobotManager.robotDropdown.value].rosMode; poseMode = dropdownRobotManager.robotConfigs[dropdownRobotManager.robotDropdown.value].poseMode; rosModeDropdown.value = rosMode; poseStampDropdown.value = poseMode; intervalSlider.value = dropdownRobotManager.robotConfigs[dropdownRobotManager.robotDropdown.value].poseInterval; }
public void NewRobotSelected(GameObject robot) { if (robot.GetComponent <RosConnector>() == null) { Debug.Log("Error: No rosConnector found"); return; } robotManager = robot; rosConnector = robotManager.GetComponent <RosConnector>(); jointStatePublisher = robotManager.GetComponent <JointStatePublisher>(); jointStateSubscriber = robotManager.GetComponent <JointStateSubscriber>(); poseStampedPublisher = robotManager.GetComponent <CustomPoseStampedPublisher>(); rosMode = dropdownRobotManager.robotConfigs[dropdownRobotManager.currentRobot].rosMode; poseMode = dropdownRobotManager.robotConfigs[dropdownRobotManager.currentRobot].poseMode; rosModeDropdown.value = rosMode; poseStampDropdown.value = poseMode; //intervalSlider.value = dropdownRobotManager.robotConfigs[dropdownRobotManager.currentRobot].poseInterval; //Activate for non-MRTK applications intervalSlider.SliderValue = dropdownRobotManager.robotConfigs[dropdownRobotManager.currentRobot].poseInterval; }
public override void OnInspectorGUI() { EditorGUILayout.HelpBox("This is the central point of your outgoing robot communication. " + "Enter the details of your mqtt broker, the topic to publish to, set your target update rate as in 'every X frames' and specify the robotParent object. " + "Either presss play and see if your robotcontrollers are in the correct order, press on 'Find Joints and configure' or manually specificy the order.", MessageType.Info); DrawDefaultInspector(); if (buttonStyle == null) { buttonStyle = new GUIStyle(EditorStyles.miniButtonRight) { fixedWidth = 75 } } ; jointStatePublisher = (JointStatePublisher)target; if (GUILayout.Button("Find joints in robot and configure")) { jointStatePublisher.FindJoints(); } } }