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

I'm not sure, if it can work like this. The extra parameter is usually for callbacks that are member functions.

What you want is to use boost::bind.

Your subscriber call should look like this:

ros::Subscriber subLeft = nh.subscribe ("/bb2/left/image_raw", 10,
    boost::bind(imageCallback, _1, pointerToImageManagmentStruct) );

(untested, but the call should be similar to this)

I'm not sure, if it can work like this. The extra parameter is usually for callbacks that are member functions.

What you want is to use boost::bind.

Your subscriber call should look like this:

ros::Subscriber subLeft = nh.subscribe nh.subscribe<sensor_msgs::Image> ("/bb2/left/image_raw", 10,
    boost::bind(imageCallback, _1, pointerToImageManagmentStruct) );

(untested, but the call should be similar to this)