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

Subscriber error in ROS

asked 2014-06-19 11:24:52 -0500

Nagsaver gravatar image

updated 2014-06-19 11:52:51 -0500

This is my subscriber declaration followed by the callback function

message_filters::Subscriber<geometry_msgs::point32> point_sub(*nh, "tracked_point", 1); point_sub.registerCallback(&visualservoing3D::pointCallback);

The callback declaration is

void visualservoing3D::pointCallback(const geometry_msgs::Point32ConstPtr& msg) { //Some functions }

But the following error pops up. I know its something to do with my subscriber.

/usr/include/boost/function/function_template.hpp:225: error: no match for call to ‘(boost::_mfi::mf1<void, visualservoing3d,="" const="" boost::shared_ptr<const="" geometry_msgs::point32_<std::allocator<void="">

&>) (const boost::shared_ptr<const geometry_msgs::point32_<std::allocator<void=""> &)’

Thanks, Nagsaver

edit retag flag offensive close merge delete


It might be due to your subscriber having point32 rather than Point32.

sterlingm gravatar image sterlingm  ( 2014-06-19 11:41:48 -0500 )edit

It is capital P in the code. Dont know how it changed in my question. Everywhere I have Point32

Nagsaver gravatar image Nagsaver  ( 2014-06-19 11:52:27 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2014-06-20 02:56:39 -0500

BennyRe gravatar image

Your callback function is a class member of the class visualservoing3D. Using a class member as callback function is not the same as using a normal function.

You have to provide the class member of the class and the object. See this example:

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2014-06-19 11:24:52 -0500

Seen: 300 times

Last updated: Jun 20 '14