예제 #1
0
        public void AutoLoadFromROS()
        {
            Debug.Log("AutoLoadFromROS");

            // Devices
            RosConnection rosConnection = rosGameObject.GetComponent <RosConnection>();

            string[]            DeviceNames         = rosConnection.GetDeviceNames();
            RosTransformManager rosTransformManager = rosGameObject.GetComponent <RosTransformManager>();

            foreach (string name in DeviceNames)
            {
                GameObject newDevice = CreateGameObject.DeviceWithPointCloud("Hokuyo3D", name);
                rosTransformManager.RequestGetParams(newDevice.name);
            }

            // Bounding Boxes
            CreateGameObject.BoudingBoxes("Human BoundingBoxes", "/tracked_humans", false);

            // Point Cloud
            Color      red   = new Color(0.0f, 1.0f, 0.0f, 0.7f);
            GameObject front = CreateGameObject.PointCloud2("Front Point Cloud", "/front", false, true, red);
            // SubscribePointCloud2 subscribe_front = front.GetComponent<SubscribePointCloud2>();
            // subscribe_front.Enabled = true;

            Color      blue       = new Color(0.1f, 0.2f, 1.0f, 0.5f);
            GameObject background = CreateGameObject.PointCloud2("Background Point Cloud", "/background", false, true, blue);

            // SubscribePointCloud2 subscribe_background = background.GetComponent<SubscribePointCloud2>();
            // subscribe_background.Enabled = true;

            CreateGameObject.PointCloud2("Raw Point Cloud", "/point_cloud2", false);
        }
        public void SetTransformToROS()
        {
            IWindowManager wm = IOC.Resolve <IWindowManager>();

            wm.Confirmation($"Set Position/Rotation of {this.Component.gameObject.name} to ROS?", "This overrides current values of position and rotation in ROS.",
                            (sender, args) =>
            {
            }, (sender, args) =>
            {
                GameObject rosGameObject = GameObject.Find("ROS");
                RosTransformManager rosTransformManager = rosGameObject.GetComponent <RosTransformManager>();
                rosTransformManager.RequestSetParams(this.Component.gameObject.name);
            },
                            "CANCEL", "OVERRIDE");
        }