Publishing and subscribing images using image_transport

ROS image transport is very similar to ROS publishers and subscribers, and it is used to publish or subscribe the images along with the camera information. We can publish the image data using ros::Publisher, but image transport is a more efficient way of sending the image data.

The image transport APIs are provided by the image_transport package. Using these APIs, we can transport an image in different compression formats; for example, we can transport it as an uncompressed image, JPEG/PNG compression, or Theora compression in separate topics. We can also add different transport formats by adding plugins. By default, we can see the compressed and Theora transports:

 image_transport::ImageTransport ...

Get Mastering ROS for Robotics Programming - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.