public void AddDataVisualization(string dateType) { if (dateType == "pointcloud2") { GameObject createdObject = CreateGameObject.PointCloud2("PointCloud2", "/", true); // Focus and Select Created Object IRuntimeEditor editor = IOC.Resolve <IRuntimeEditor>(); editor.Selection.activeGameObject = createdObject; Debug.Log($"New {createdObject} added"); } else if (dateType == "boundingboxes") { GameObject createdObject = CreateGameObject.BoudingBoxes("BoundingBoxes", "/", true); // Focus and Select Created Object IRuntimeEditor editor = IOC.Resolve <IRuntimeEditor>(); editor.Selection.activeGameObject = createdObject; Debug.Log($"New {createdObject} added"); } else if (dateType == "trajectory") { GameObject createdObject = CreateGameObject.Trajectory("Trajectory", "/"); IRuntimeEditor editor = IOC.Resolve <IRuntimeEditor>(); editor.Selection.activeGameObject = createdObject; Debug.Log($"New {createdObject.name} added"); } else if (dateType == "socialdistance") { } else if (dateType == "heatmap") { } }
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); }
static public GameObject DeviceWithPointCloud(string deviceType) { GameObject newDevice = Device(deviceType); string defaultTopic = "/"; GameObject frontPointCloud = CreateGameObject.PointCloud2("Front Point Cloud", defaultTopic, false); GameObject backgroundPointCloud = CreateGameObject.PointCloud2("Background Point Cloud", defaultTopic, false); GameObject rawPointCloud = CreateGameObject.PointCloud2("Raw Point Cloud", defaultTopic, false); frontPointCloud.transform.SetParent(newDevice.transform); backgroundPointCloud.transform.SetParent(newDevice.transform); rawPointCloud.transform.SetParent(newDevice.transform); return(newDevice); }
static public GameObject DeviceWithPointCloud(string deviceType, string deviceName) { GameObject newDevice = Device(deviceType); newDevice.name = deviceName; string frontTopic = $"/lidars/{deviceName}/front"; string backgroundTopic = $"/lidars/{deviceName}/background"; string rawTopic = $"/lidars/{deviceName}/point_cloud2"; GameObject frontPointCloud = CreateGameObject.PointCloud2("Front Point Cloud", frontTopic, false); GameObject backgroundPointCloud = CreateGameObject.PointCloud2("Background Point Cloud", backgroundTopic, false); GameObject rawPointCloud = CreateGameObject.PointCloud2("Raw Point Cloud", rawTopic, false); frontPointCloud.transform.SetParent(newDevice.transform); backgroundPointCloud.transform.SetParent(newDevice.transform); rawPointCloud.transform.SetParent(newDevice.transform); return(newDevice); }