0
$\begingroup$

Rosanswers logo

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::Point32std::allocator<void

&>) (const boost::shared_ptr<const geometry_msgs::Point32_std::allocator<void &)’

Thanks, Nagsaver


Originally posted by Nagsaver on ROS Answers with karma: 1 on 2014-06-19

Post score: 0


Original comments

Comment by sterlingm on 2014-06-19:
It might be due to your subscriber having point32 rather than Point32.

Comment by Nagsaver on 2014-06-19:
It is capital P in the code. Dont know how it changed in my question. Everywhere I have Point32

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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: http://wiki.ros.org/roscpp/Overview/Publishers%20and%20Subscribers#Class_Methods


Originally posted by BennyRe with karma: 2949 on 2014-06-20

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.