Skip to content

[draft] Post Camera Synchronization #550

[draft] Post Camera Synchronization

[draft] Post Camera Synchronization #550

GitHub Actions / Autopep8 failed Jun 16, 2024 in 0s

6 errors

Autopep8 found 6 errors

Annotations

Check failure on line 35 in src/perception/camera_object_detection/camera_object_detection/post_synchronizer.py

See this annotation in the file changed.

@github-actions github-actions / Autopep8

src/perception/camera_object_detection/camera_object_detection/post_synchronizer.py#L9-L35

 from ultralytics.utils.plotting import Annotator, colors
 
 from cv_bridge import 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")
 
-        self.camera_img_sub = Subscriber(self, Image , '/camera/right/image_color')
- 
+        self.camera_img_sub = Subscriber(self, Image, '/camera/right/image_color')
+
         self.camera1_sub = Subscriber(self, Detection2DArray, '/camera/right/camera_detections')
         self.camera2_sub = Subscriber(self, Detection2DArray, '/traffic_signs')
         self.camera3_sub = Subscriber(self, Detection2DArray, '/traffic_lights')
- 
+
         self.ts = ApproximateTimeSynchronizer(
             [self.camera_img_sub, self.camera1_sub, self.camera2_sub, self.camera3_sub],
             queue_size=10,
             slop=0.1)
- 
+
         self.ts.registerCallback(self.callback)
- 
-        self.combined_detection_publisher = self.create_publisher(Detection2DArray, '/combined_detections', 10)
+
+        self.combined_detection_publisher = self.create_publisher(
+            Detection2DArray, '/combined_detections', 10)
         self.vis_publisher = self.create_publisher(Image, '/annotated_img', 10)
 
     def process_img(self, image):

Check failure on line 45 in src/perception/camera_object_detection/camera_object_detection/post_synchronizer.py

See this annotation in the file changed.

@github-actions github-actions / Autopep8

src/perception/camera_object_detection/camera_object_detection/post_synchronizer.py#L38-L45

             self.get_logger().error(str(e))
             return
         return cv_image
-    
+
     def postprocess_detections(self, detections, annotator):
         """
         Post-process draws bouningboxes on camera image.

Check failure on line 80 in src/perception/camera_object_detection/camera_object_detection/post_synchronizer.py

See this annotation in the file changed.

@github-actions github-actions / Autopep8

src/perception/camera_object_detection/camera_object_detection/post_synchronizer.py#L66-L80

 
         annotator_img = annotator.result()
         return (processed_detections, annotator_img)
-    
+
     def publish_vis(self, annotated_img, msg):
         # Publish visualizations
         imgmsg = self.cv_bridge.cv2_to_imgmsg(annotated_img, "bgr8")
         imgmsg.header.stamp = msg.header.stamp
         imgmsg.header.frame_id = msg.header.frame_id
         self.vis_publisher.publish(imgmsg)
- 
+
     def callback(self, camera_img_sub, camera1_msg, camera2_msg, camera3_msg):
         combined_detections = Detection2DArray()
         combined_detections.header = Header()

Check failure on line 94 in src/perception/camera_object_detection/camera_object_detection/post_synchronizer.py

See this annotation in the file changed.

@github-actions github-actions / Autopep8

src/perception/camera_object_detection/camera_object_detection/post_synchronizer.py#L81-L94

         combined_detections.header.frame_id = camera1_msg.header.frame_id
 
         cv_image = self.process_img(camera_img_sub)
- 
+
         for detection in camera1_msg.detections:
             combined_detections.detections.append(detection)
-            
+
         for detection in camera2_msg.detections:
             combined_detections.detections.append(detection)
- 
+
         for detection in camera3_msg.detections:
             combined_detections.detections.append(detection)
 

Check failure on line 115 in src/perception/camera_object_detection/camera_object_detection/post_synchronizer.py

See this annotation in the file changed.

@github-actions github-actions / Autopep8

src/perception/camera_object_detection/camera_object_detection/post_synchronizer.py#L97-L115

             example=str(self.names),
         )
         (combined_detections, annotated_img) = self.postprocess_detections(combined_detections, annotator)
- 
+
         self.combined_detection_publisher.publish(combined_detections)
         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()

Check failure on line 21 in src/samples/python/aggregator/setup.py

See this annotation in the file changed.

@github-actions github-actions / Autopep8

src/samples/python/aggregator/setup.py#L14-L21

         # 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'],