Exemple #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 AddDevice(string deviceType)
        {
            GameObject newDeviceObject = CreateGameObject.DeviceWithPointCloud(deviceType);

            // Focus and Select Created Object
            IRuntimeEditor editor = IOC.Resolve <IRuntimeEditor>();

            editor.Selection.activeGameObject = newDeviceObject;
            Debug.Log($"New {deviceType} added");
        }