[draft] Post Camera Synchronization #556
build_and_unitest.yml
on: pull_request
Setup Environment
33s
Matrix: Build/Test
Confirm Build and Unit Tests Completed
0s
Annotations
10 errors and 4 notices
src/samples/python/aggregator/setup.py#L14
# Include our package.xml file
(os.path.join('share', package_name), ['package.xml']),
# Include all launch files.
- (os.path.join('share', package_name, 'launch'), \
+ (os.path.join('share', package_name, 'launch'),
glob(os.path.join('launch', '*.launch.py'))),
],
install_requires=['setuptools'],
|
src/perception/camera_object_detection/camera_object_detection/post_synchronizer.py#L9
from ultralytics.utils.plotting import Annotator, colors
from cv_bridge import CvBridge, CvBridgeError
-
-class CameraSyncNode(Node): # synchronizes visualizations
+
+
+class CameraSyncNode(Node): # synchronizes visualizations
def __init__(self):
super().__init__('camera_sync_node')
self.get_logger().info("Camera Sync Node")
|
src/perception/camera_object_detection/camera_object_detection/post_synchronizer.py#L37
self.cv_bridge = CvBridge()
self.line_thickness = 1
self.names = []
-
+
self.ts = ApproximateTimeSynchronizer(
[self.camera_img_sub,
self.camera_detection_sub,
|
src/perception/camera_object_detection/camera_object_detection/post_synchronizer.py#L45
self.traffic_lights_sub],
queue_size=10,
slop=0.1)
-
+
self.ts.registerCallback(self.callback)
-
- self.combined_detection_publisher = self.create_publisher(Detection2DArray, self.combined_detection_topic, 10)
+
+ self.combined_detection_publisher = self.create_publisher(
+ Detection2DArray, self.combined_detection_topic, 10)
self.vis_publisher = self.create_publisher(Image, self.publish_vis_topic, 10)
def process_img(self, image):
|
src/perception/camera_object_detection/camera_object_detection/post_synchronizer.py#L58
self.get_logger().error(str(e))
return
return cv_image
-
+
def postprocess_detections(self, detections, annotator):
"""
Post-process draws bouningboxes on camera image.
|
src/perception/camera_object_detection/camera_object_detection/post_synchronizer.py#L86
annotator_img = annotator.result()
return (processed_detections, annotator_img)
-
+
def publish_detections(self, detections, msg, feed):
# Publish detections to an detectionList message
detection2darray = Detection2DArray()
|
src/perception/camera_object_detection/camera_object_detection/post_synchronizer.py#L113
detection2darray.detections.append(detection2d)
self.combined_detection_publisher.publish(detection2darray)
-
+
def publish_vis(self, annotated_img, msg):
# Publish visualizations
imgmsg = self.cv_bridge.cv2_to_imgmsg(annotated_img, "bgr8")
|
src/perception/camera_object_detection/camera_object_detection/post_synchronizer.py#L121
imgmsg.header.frame_id = msg.header.frame_id
self.get_logger().info("Publish img")
self.vis_publisher.publish(imgmsg)
-
+
def callback(
self,
camera_img_sub,
|
src/perception/camera_object_detection/camera_object_detection/post_synchronizer.py#L131
):
cv_image = self.process_img(camera_img_sub)
- combined_detections = camera_detection_sub.detections + traffic_lights_sub.detections + traffic_signs_sub.detections
+ combined_detections = camera_detection_sub.detections + \
+ traffic_lights_sub.detections + traffic_signs_sub.detections
annotator = Annotator(
cv_image,
line_width=self.line_thickness,
example=str(self.names),
)
-
+
detections = []
for det in combined_detections:
obj_with_pose = det.results[0]
|
src/perception/camera_object_detection/camera_object_detection/post_synchronizer.py#L158
self.publish_detections(combined_detections, camera_detection_sub, "")
self.publish_vis(annotated_img, camera_img_sub)
-
+
+
def main(args=None):
rclpy.init(args=args)
node = CameraSyncNode()
-
+
rclpy.spin(node)
-
+
node.destroy_node()
rclpy.shutdown()
-
+
+
if __name__ == '__main__':
- main()
\ No newline at end of file
+ main()
|
Setup Environment
Detected infrastructure changes
|
Setup Environment
Using camera-sync-dan as the source branch
|
Setup Environment
Using main as the target branch
|
Confirm Build and Unit Tests Completed
All builds and unit tests completed!
|