private void PublishGroundTruth(List <Ros.Detection3D> detectedObjects) { if (Bridge == null || Bridge.Status != Ros.Status.Connected) { return; } if (Time.time < nextSend) { return; } if (detectedObjects == null) { return; } if (targetEnv == ROSTargetEnvironment.AUTOWARE || targetEnv == ROSTargetEnvironment.APOLLO) { var detectedObjectArrayMsg = new Ros.Detection3DArray() { detections = detectedObjects, }; Bridge.Publish(objects3DTopicName, detectedObjectArrayMsg); nextSend = Time.time + 1.0f / frequency; } }
private void PublishGroundTruth(List <Ros.Detection3D> detectedObjects) { if (Bridge == null || Bridge.Status != Comm.BridgeStatus.Connected) { return; } if (Time.time < nextSend) { return; } if (detectedObjects == null) { return; } if (targetEnv == ROSTargetEnvironment.AUTOWARE || targetEnv == ROSTargetEnvironment.APOLLO || targetEnv == ROSTargetEnvironment.LGSVL) { var detectedObjectArrayMsg = new Ros.Detection3DArray() { header = new Ros.Header() { stamp = Ros.Time.Now(), }, detections = detectedObjects, }; DetectedObjectArrayWriter.Publish(detectedObjectArrayMsg); nextSend = Time.time + 1.0f / frequency; } }
private void PublishGroundTruth(List <Ros.Detection3D> detectedObjects) { if (Bridge == null || Bridge.Status != Ros.Status.Connected) { return; } var detectedObjectArrayMsg = new Ros.Detection3DArray() { detections = detectedObjects, }; if (targetEnv == ROSTargetEnvironment.AUTOWARE || targetEnv == ROSTargetEnvironment.APOLLO) { Bridge.Publish(objects3DTopicName, detectedObjectArrayMsg); } }
private void PublishGroundTruth() { if (Bridge == null || Bridge.Status != Ros.Status.Connected) { return; } detectedObjects.Clear(); detectedObjects = lidarDetectedColliders.Values.ToList(); var detectedObjectArrayMsg = new Ros.Detection3DArray() { detections = detectedObjects, }; if (targetEnv == ROSTargetEnvironment.AUTOWARE || targetEnv == ROSTargetEnvironment.APOLLO) { Bridge.Publish(objects3DTopicName, detectedObjectArrayMsg); Debug.Log("Ground Truth Data Published"); } }
private void PublishGroundTruth(List <Ros.Detection3D> detectedObjects) { if (Bridge == null || Bridge.Status != Comm.BridgeStatus.Connected) { return; } if (Time.time < nextSend) { return; } if (detectedObjects == null) { return; } if (targetEnv == ROSTargetEnvironment.AUTOWARE || targetEnv == ROSTargetEnvironment.APOLLO || targetEnv == ROSTargetEnvironment.LGSVL) { var detectedObjectArrayMsg = new Ros.Detection3DArray() { header = new Ros.Header() { stamp = Ros.Time.Now(), }, detections = detectedObjects, }; DetectedObjectArrayWriter.Publish(detectedObjectArrayMsg); nextSend = Time.time + 1.0f / frequency; } if (targetEnv == ROSTargetEnvironment.APOLLO35) { Apollo.Common.Detection3DArray cyberDetectionObjectArray = new Apollo.Common.Detection3DArray(); foreach (Ros.Detection3D rosDetection3D in detectedObjects) { Apollo.Common.Detection3D cyberDetection3D = new Apollo.Common.Detection3D() { Header = new Apollo.Common.Header() { SequenceNum = rosDetection3D.header.seq, FrameId = rosDetection3D.header.frame_id, TimestampSec = (double)rosDetection3D.header.stamp.secs, }, Id = rosDetection3D.id, Label = rosDetection3D.label, Score = rosDetection3D.score, Bbox = new Apollo.Common.BoundingBox3D() { Position = new Apollo.Common.Pose() { Position = new Apollo.Common.Point3D() { X = rosDetection3D.bbox.position.position.x, Y = rosDetection3D.bbox.position.position.y, Z = rosDetection3D.bbox.position.position.z, }, Orientation = new Apollo.Common.Quaternion() { Qx = rosDetection3D.bbox.position.orientation.x, Qy = rosDetection3D.bbox.position.orientation.y, Qz = rosDetection3D.bbox.position.orientation.z, Qw = rosDetection3D.bbox.position.orientation.w, }, }, Size = new Apollo.Common.Vector3() { X = rosDetection3D.bbox.size.x, Y = rosDetection3D.bbox.size.y, Z = rosDetection3D.bbox.size.z, }, }, Velocity = new Apollo.Common.Twist() { Linear = new Apollo.Common.Vector3() { X = rosDetection3D.velocity.linear.x, Y = rosDetection3D.velocity.linear.y, Z = rosDetection3D.velocity.linear.z, }, Angular = new Apollo.Common.Vector3() { X = rosDetection3D.velocity.angular.x, Y = rosDetection3D.velocity.angular.y, Z = rosDetection3D.velocity.angular.z, }, }, }; cyberDetectionObjectArray.Detections.Add(cyberDetection3D); System.DateTime Unixepoch = new System.DateTime(1970, 1, 1, 0, 0, 0, System.DateTimeKind.Utc); double measurement_time = (double)(System.DateTime.UtcNow - Unixepoch).TotalSeconds; cyberDetectionObjectArray.Header = new Apollo.Common.Header() { TimestampSec = measurement_time, }; Apollo35DetectedObjectArrayWriter.Publish(cyberDetectionObjectArray); nextSend = Time.time + 1.0f / frequency; } } }