Beispiel #1
0
    public override void OnInspectorGUI()
    {
        kinematicPatcher = (KinematicPatcher)target;
        DrawDefaultInspector();

        if (GUILayout.Button(kinematicButtonLabel))
        {
            if (isKinematic)
            {
                isKinematic = false;
                kinematicPatcher.SetKinematic(false);
                kinematicButtonLabel = kinematicButtonOn;
            }
            else
            {
                isKinematic = true;
                kinematicPatcher.SetKinematic(true);
                kinematicButtonLabel = kinematicButtonOff;
            }
        }
    }
    private void TeleoperationPatcher()
    {
        GameObject robot = GameObject.Find(urdfImporter.robotName);

        if (robot != null)
        {
            SpotLightPatcher.patch(robot);
            KinematicPatcher.patch(robot);
            OdometryPatcher.patch(robot);
            JointStatePatcher.patch(robot);

            var rosConnector = new GameObject("ROSConnector");
            rosConnector.AddComponent <RosConnector>().RosBridgeServerUrl = address;
            rosConnector.AddComponent <JointStateSubscriber>();

            Application.runInBackground = true;

            status["jointStatesMapped"].Set();
        }
        else
        {
            Debug.LogWarning("Joint States Patching did not work! Robot not found...");
        }
    }