mgonzs13 / yolo_ros

Ultralytics YOLOv8, YOLOv9, YOLOv10, YOLOv11 for ROS 2
GNU General Public License v3.0
336 stars 89 forks source link

How can I get the image? #15

Closed zhang320 closed 11 months ago

KXRLYM commented 11 months ago

Not the author but I am having the same problem as described in the title (lol)

mgonzs13 commented 11 months ago

Hi @zhang320 and @KXRLYM, please, check if yolov8_node is subscribed to your topic and if the QoS is the same for both, yolov8_node and your publisher.

zhang320 commented 11 months ago

Hello, I am using the v4l2 that comes with ROS2 Camera sent an image Raw message, but I haven't received any feedback. How can I obtain tracking results?

mgonzs13 commented 11 months ago

Tracking results are published in the /yolo/tracking topic. If you don't get any results, it may be due to the QoS of your image topic. This package uses Best Effort for the image topics, the sensor QoS.

KXRLYM commented 11 months ago

I have made the QoS consistent between my publisher and YOLO subscriber but still doesn't work :( Added some screenshots:

No image image I have both my publisher and YOLO sub open

rqt_graph yolo nodes subscribing to my node image

Publisher with

self.publisher = self.create_publisher(Image, '/rgb/image_formatted', qos_profile_sensor_data)
zhang320 commented 11 months ago

Thank you for your response. I have got the result.

mgonzs13 commented 11 months ago

@KXRLYM, in that case, the problem is that you are using the 3D version, which needs a depth image topic. Try the normal launch file, yolov8.launch.py.

KXRLYM commented 11 months ago

@mgonzs13 Oh I thought I was using that launch file as per

ros2 launch yolov8_bringup yolov8.launch.py device:=cpu input_image_topic:=/rgb/image_formatted
mgonzs13 commented 11 months ago

Yes, that should launch the normal version but in the rqt_graph image, you have the 3D node. In that case, no db images will be published till 3D data is obtained.

KXRLYM commented 11 months ago

@mgonzs13 I understood the problem now. Thank you so much the images are coming through :))