ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

I realize this question is pretty old, but I just found it, and since there have been no answers yet, I thought I'd offer one...

First, make sure you've read over the documentation for image_transport: http://wiki.ros.org/image_transport

Using the imagezero transport works just like selecting the compressed transport. As long as the ros-${ROSDISTRO}-imagezero-transport package is installed on the computers doing the publishing & subscribing, you can select the imagezero transport instead. You can do that by creating a TransportHints object that you pass to image_transport::ImageTransport::subscribe; just set its default_transport argument to imagezero.

More documentation on TransportHints is available here: http://docs.ros.org/en/melodic/api/image_transport/html/classimage__transport_1_1TransportHints.html

You can also set ROS params to control the transport, as seen here: http://wiki.ros.org/image_transport/Tutorials/ExaminingImagePublisherSubscriber

By the way, it is important to note that if you're using ImageZero, it specifically only works with 24-bit color image formats. Other formats (such as Monochrome or Bayer) will not work; this is a limitation of the compression algorithm.