ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Yes, your understanding is correct.
The line
image_info_sync.registerCallback(boost::bind(&Node::frameCallback,this, _1, _2));
Is telling the TimeSynchronizer that whenever it receives the syncronized info from raw_image_subscriber and camera_info_subscriber it should call the method frameCallback. This method's fingerprint is:
class Node{
...
void frameCallback( sensor_msgs::ImageConstPtr& img, sensor_msgs::CameraInfoConstPtr& info);
...
};
The boost::bind function is getting a valid pointer to a member function named Node::frameCallback in the object "this" (here you could pass a pointer to any object of class Node), that accepts two parameters and giving it to image_info_sync. Here _1 is a placeholder argument that means "substitute with the first input argument" and _2 means "substitute with the second input argument".
I hope this clarifies your doubt.