Skip to content

create launch files and fix post synchronizer for combined detections

Sign in for the full log view
GitHub Actions / Autopep8 failed Jun 25, 2024 in 0s

10 errors

Autopep8 found 10 errors

Annotations

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

Check failure on line 17 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-L17

 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")

Check failure on line 44 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#L37-L44

         self.cv_bridge = CvBridge()
         self.line_thickness = 1
         self.names = []
- 
+
         self.ts = ApproximateTimeSynchronizer(
             [self.camera_img_sub,
              self.camera_detection_sub,

Check failure on line 55 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#L45-L55

              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):

Check failure on line 65 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#L58-L65

             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 93 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#L86-L93

 
         annotator_img = annotator.result()
         return (processed_detections, annotator_img)
-    
+
     def publish_detections(self, detections, msg, feed):
         # Publish detections to an detectionList message
         detection2darray = Detection2DArray()

Check failure on line 120 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#L113-L120

                 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")

Check failure on line 128 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#L121-L128

         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,

Check failure on line 145 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#L131-L145

     ):
         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]

Check failure on line 173 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#L158-L173

 
         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()