ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
The image_transport package is designed to take care of the decompression / compression for you automatically. If you subscribe to the base image topic as shown below and give it the hint to check for a compressed version then it will automatically find and decompress the compressed image topic for you.
image_transport::ImageTransport it(n);
itSub = it.subscribe("<base_topic>",1,callbackFn,image_transport::TransportHints("compressed"));
This way it will work even if there isn't a compressed version of the topic, but will automatically extract the compressed topic if it exists.