コード例 #1
0
 public override void set_reference(Transform o)
 {
     OnDisable();    //We simulate turning the panel on and off when we switch refernce to keep cam.targetTexture up to speed.
     reference = o;
     cam_topic = o.GetComponent <RosSharp.RosBridgeClient.ImagePublisher>();
     cam       = cam_topic.ImageCamera;
     OnEnable();
 }
コード例 #2
0
        void Awake()
        {
            simpleCarController  = this.GetComponent <SimpleCarController>();
            rosConnector         = this.GetComponent <RosConnector>();
            imagePublisher       = this.GetComponent <ImagePublisher>();
            driveStatusPublisher = this.GetComponent <DriveStatusPublisher>();
            motorsSubscriber     = this.GetComponent <NRCMotorsSubscriber>();

            simpleCarController.useController = !RobotOptions.GetValue(robotName + "Autonomous").Equals("True");
            rosConnector.RosBridgeServerUrl   = "ws://" + RobotOptions.GetValue(robotName + "ROS Bridge IP");
            imagePublisher.Topic       = RobotOptions.GetValue(robotName + "Camera Topic");
            driveStatusPublisher.Topic = RobotOptions.GetValue(robotName + "Drive Status Topic");
            motorsSubscriber.Topic     = RobotOptions.GetValue(robotName + "Motors Topic");
        }
コード例 #3
0
        void Awake()
        {
            simpleCarController = this.GetComponent <SimpleCarController>();
            imagePublisher      = this.GetComponent <ImagePublisher>();
            laserScanPublisher  = this.GetComponent <LaserScanPublisher>();
            iMUPublisher        = this.GetComponent <IMUPublisher>();
            velocityPublisher   = this.GetComponent <VelocityPublisher>();
            gPSPublisher        = this.GetComponent <GPSPublisher>();
            motorsSubscriber    = this.GetComponent <IGVCMotorsSubscriber>();

            simpleCarController.useController = !RobotOptions.GetValue(robotName + "Autonomous").Equals("True");
            //rosConnector.RosBridgeServerUrl = "ws://" + RobotOptions.GetValue(robotName + "ROS Bridge IP");
            if (RobotOptions.Exists(robotName + "Camera Topic"))
            {
                imagePublisher.Topic = RobotOptions.GetValue(robotName + "Camera Topic");
            }
            if (RobotOptions.Exists(robotName + "Show Camera View") && RobotOptions.GetValue(robotName + "Show Camera View").Equals("True"))
            {
                robotCamera.targetDisplay = 0;
                robotCamera.enabled       = true;
                mainCamera.enabled        = false;

                // If we are publishing the camera, we need to duplicate it because the publishing script
                // will override the camera output.
                if (RobotOptions.GetValue(robotName + "Publish Camera").Equals("True"))
                {
                    GameObject robotCameraDupe = Instantiate(robotCamera.gameObject, robotCamera.gameObject.transform.parent);
                }
            }
            if (RobotOptions.GetValue(robotName + "Publish Camera").Equals("True"))
            {
                imagePublisher.enabled = true;
                robotCamera.enabled    = true;
            }
            laserScanPublisher.Topic = RobotOptions.GetValue(robotName + "Laser Scan Topic");
            iMUPublisher.Topic       = RobotOptions.GetValue(robotName + "IMU Topic");
            velocityPublisher.Topic  = RobotOptions.GetValue(robotName + "Velocity Topic");
            gPSPublisher.Topic       = RobotOptions.GetValue(robotName + "GPS Topic");
            motorsSubscriber.Topic   = RobotOptions.GetValue(robotName + "Motors Topic");
        }