Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Try the following:

sensor_msgs::ImageConstPtr my_image_const_ptr = &my_image;

sensor_msgs::ImageConstPtr is nothing else than a constant shared pointer to a sensor_msgs::Image

Try the following:

sensor_msgs::Image my_image = <somehow get this image>;
sensor_msgs::ImageConstPtr my_image_const_ptr = &my_image;

sensor_msgs::ImageConstPtr sensor_msgs::ImageConstPtr is nothing else than a constant shared pointer to a sensor_msgs::Image.

Try the following:

sensor_msgs::Image my_image = <somehow get this image>;
image with toImageMsg()>;
sensor_msgs::ImageConstPtr my_image_const_ptr = &my_image;

sensor_msgs::ImageConstPtr is nothing else than a constant shared pointer to a sensor_msgs::Image.