ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You first need to understand the boost binding function and how use it to bind function object.
tf_filter_->registerCallback( boost::bind(&PoseDrawer::msgCallback, this, _1) );
Simply put, it binds the call back function with the function whose object being created pointed by a this
pointer. Do a review on boost::bind to understand the syntax and usage. PoseDrawer
is the class that has a member function msgCallback
. _1
means the default argument passing when the rospin()
is activated up on the scope of the current subscriber. For the tf::MessageFilters
tutorial, it is the turtle_point_stamped
topic.
In summary, registerCallback
is a way to bind the object function msgCallback
of the current object of class PoseDrawer
to the default handle of topic turtle_point_stamped
.