ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

There are two problems.

The parameters to your callback function must be declared const. Change from

void callback(Detection2DArrayConstPtr& det,sensor_msgs::CameraInfoConstPtr& cam_info)

to

void callback(const Detection2DArrayConstPtr& det, const sensor_msgs::CameraInfoConstPtr& cam_info)

Pass this to bind. Change from

sync.registerCallback(boost::bind(&myClass::callback, _1, _2 ));

to

sync.registerCallback(boost::bind(&myClass::callback, this, _1, _2 ));