Hi, I'm trying to write code to take two image messages called /stereocam/left/image_raw, and /stereocam/right/image_raw, each from two different cameras. I want to combine them to both into one image, however I can't figure out how to set up one callback function to determine which camera the particular image came from. I tried this, but it won't compile.
image_transport::Subscriber sub1 = it.subscribe<sensor_msgs::Image> ("/stereocam/left/image_raw", 1, boost::bind(imageCallback, _1, 1)); image_transport::Subscriber sub2 = it.subscribe<sensor_msgs::Image> ("/stereocam/right/image_raw", 1, boost::bind(imageCallback, _1,2));
and
void imageCallback(const sensor_msgs::ImageConstPtr& msg, int queue_id) { }
I tried a variation of this using just ROS instead of image_transport and it compiles just fine, but this doesn't.
Any help would be greatly appreciated.
Originally posted by Fred99 on ROS Answers with karma: 13 on 2012-05-11
Post score: 1
Original comments
Comment by Mac on 2012-05-12:
Offhand, it's sensor_msgs::Image, with a capital I. Can you post your complete code, or at least the smallest snippet that doesn't compile?
Comment by Fred99 on 2012-05-12:
image_transport::Subscriber sub = it.subscribe<sensor_msgs::Image>("/stereocam/left/image_raw", 1, boost::bind(imageCallback, _1, 1));
That is the part that it says doesn't have a matching function call.