Using Synchronizer to batch up image messages
Given the code on this page, if I have a message file batched_image.msg
that looks like:
sensor_msgs/Image image
sensor_msgs/CameraInfo info
And code that looks like:
void callback(const ImageConstPtr& image, const CameraInfoConstPtr& cam_info)
{
batched_image batch;
batch.image = *image;
batch.info = *cam_info;
}
This works, of course, but it involves a copy of Image, if I understand correctly. How can I avoid this copy, as in my use case I have four 1280x960 images? Ideally I would like:
sensor_msgs/ImageConstPtr image
sensor_msgs/CameraInfoConstPtr info
But that obviously doesn't work.