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

Revision history [back]

Option 1: You can publish two streams of data, one from the image_transport and one from a normal publisher with your own custom metadata type with an identical header. Then on the receiving end, you should be able to use a message synchronizer with the image_transport as described in this question.

Option 2: If you care about the image data frame-by-frame, then you're probably only using the RAW transport of image_transport. In this case, you don't really need it, and you can just use a normal publisher and use your own composite message like:

sensor_msgs/Image image
string filename

Before trying these, first maybe you should ask yourself if you really need to be sending images with filenames over ROS, instead of just the filenames, and letting your client read them into memory. However, if you really must do this, there are two options that come to mind:

Option 1: You can publish two streams of data, one from the image_transport and one from a normal publisher with your own custom metadata type with an identical header. Then on the receiving end, you should be able to use a message synchronizer with the image_transport as described in this question.

Option 2: If you care about the image data frame-by-frame, then you're probably only using the RAW transport of image_transport. In this case, you don't really need it, and you can just use a normal publisher and use your own composite message like:

sensor_msgs/Image image
string filename