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

Revision history [back]

click to hide/show revision 1
initial version

Please post relevant code. There is a type mismatch. The topic is posting the message with a particular data-type and you are subscribing to another data-type.

I think the topic by-default uses sensor_msgs/CompressedImage while your callback has type sensor_msgs/Image.

If your callback has arguments

const sensor_msgs::ImageConstPtr& _msg

change that to

const sensor_msgs::CompressedImageConstPtr& _msg

But, of course, you should change the code inside the callback to be sure you are doing the right things with that message.

Have a great day!

`

Please post relevant code. There is a type mismatch. The topic is posting the message with a particular data-type and you are subscribing to another data-type.

I think the topic by-default uses sensor_msgs/CompressedImage while your callback has type sensor_msgs/Image.

If your callback has arguments

const sensor_msgs::ImageConstPtr& _msg

change that to

const sensor_msgs::CompressedImageConstPtr& _msg

But, of course, you should change the code inside the callback to be sure you are doing the right things with that message.

If you are using a default ros executable and then using that remap, it won't work at all. Because the topic types are different.

Have a great day!

`