Putting a sensor_msgs/Image into a message, getting it back, and converting it for OpenCV?
I'm just doing this wrong somehow.
I've got a Sensor_msgs/Image already. I want to put it into my message which has "Sensor_msgs/Image image" in it's definition.
Can I just do this:
msg.image = *imgPtr;
Or do I need to do some form of deep copy? The data types are a bit too complicated for me to figure out what's going on.
Later, in a service, I want to extract that image and convert it to a IplImage* for use with OpenCV. i'm trying this:
cv_img = cv_bridge::toCvCopy(image, enc::BGR8);
IplImage img;
img = cv_img->image;
And it seems to be working alright now, but it's hard to tell since i think that first bit is not working.