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

Revision history [back]

In general, subscribing directly to a CompressedImage topic isn't what you want to do; in C++, you would want to use the image_transport mechanism, which will handle decompressing it for you.

Unfortunately, that doesn't work in Python. Your options are either:

  • Run an image_transport/republish node that will subscribe to the CompressedImage topic, publish it as an Image topic, and subscribe to that.

  • Look at the format field of the CompressedImage message to determine the compression type, then use an appropriate Python library to manually decompress the image data and extract the height and width.