boost - Subscriber error in ROS -
boost - Subscriber error in ROS -
this subscriber declaration followed callback function
message_filters::subscriber<geometry_msgs::point32> point_sub(*nh, "tracked_point", 1); point_sub.registercallback(&visualservoing3d::pointcallback);
the callback declaration
void visualservoing3d::pointcallback(const geometry_msgs::point32constptr& msg) { //some functions }
but next error pops up. know subscriber.
/usr/include/boost/function/function_template.hpp:225: error: no match phone call ‘(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
point_sub.registercallback(&visualservoing3d::pointcallback);
you need bind non-static fellow member function object instance:
#include <boost/bind.hpp> point_sub.registercallback(boost::bind(&visualservoing3d::pointcallback, p_vs, _1));
where p_vs
(shared) pointer visualservoing3d
object. if need/wish bind reference, utilize boost::ref(vs)
boost publish-subscribe ros
Comments
Post a Comment