IntelRealSense / librealsense

Intel® RealSense™ SDK
https://www.intelrealsense.com/
Apache License 2.0
7.55k stars 4.81k forks source link

Query on compressed image camera ros2 topics #13249

Closed girishsmurthyIntel closed 1 month ago

girishsmurthyIntel commented 1 month ago

Hi @MartyG-RealSense , I would need to generate the compressed image ros2 topics. Would suggest any ros2 plugin for the same or create a node to subscribe to the image topics & compress independently using the cv2bridge?

MartyG-RealSense commented 1 month ago

Hi @girishsmurthyIntel The RealSense compressed image topics are published when the image_transport plugin is installed with a command such as the one below for Humble.

sudo apt install ros-humble-image-transport

Further information can be found in the compressed topics section of the RealSense ROS2 wrapper documentation page at the link below.

https://dev.intelrealsense.com/docs/ros2-wrapper#compression-packages

girishsmurthyIntel commented 1 month ago

Thank you. Can you kindly let know the steps to be followed after installing the plugin for a specific ROS2 build?

MartyG-RealSense commented 1 month ago

After installing the plugin, simply perform the rs_launch.py launch process and then once the launch has successfully completed, check the list of published topics with the command ros2 topic list to confirm that the compressed topics are being published.

https://github.com/IntelRealSense/realsense-ros?tab=readme-ov-file#published-topics

girishsmurthyIntel commented 1 month ago

Dear @MartyG-RealSense , I wanted to update you that for ROS2 foxy, we need to use the sudo apt install ros-humble-compressed-image-transport to get the compressed streams. I understand that foxy is EOL. But for some application we were using the same and this was required. Between, I had another question, about how these compressed topics are generated from the plugin? The camera is connected via USB3.0 cable/port to the NUC. Here we have the realsense ros package which creates the raw image/ camera info topics using the data from the camera. Will the image-transport plugin subscribe to these raw images and generate the compressed topics? I mean can we have only the ros2 compressed topics in the ros2 topic list and not the raw images?

MartyG-RealSense commented 1 month ago

The compressed topics plugin for a specific ROS version should ideally be installed. For Foxy that would be:

sudo apt install ros-foxy-compressed-image-transport

However, Foxy is only supported by the RealSense ROS2 wrapper up until version 4.51.1, which should be used with librealsense 2.51.1.

An explanation of how image_transport works can be found at the link below, which states that "image_transport itself provides only "raw" transport so as not to impose unnecessary dependencies on client packages".

https://wiki.ros.org/image_transport

It is possible to unsubscribe from specific topics during runtime after launch has completed so that they are not included in the topic list. Usually though the raw topics are active when publishing compressed topics.

https://answers.ros.org/question/409553/how-can-i-remove-active-topic/

MartyG-RealSense commented 1 month ago

Hi @girishsmurthyIntel Do you require further assistance with this case, please? Thanks!

girishsmurthyIntel commented 1 month ago

Hi @MartyG-RealSense I was able to get the compressed topic working. Appreciate your kind support.

MartyG-RealSense commented 1 month ago

You are very welcome, @girishsmurthyIntel - I'm pleased that I could help. As you were able to get the compressed topic, I will close this issue. Thanks very much for the update!