How is “const std_msgs::String::ConstPtr& msg” transmitted into callback function since there is no parameter in the main function?
Hey everybody I have just started to learn CPP and ROS,and I've some confusion about the subscribe function.
When we create a subscriber,we use : ros::Subscriber sub=node.subscribe(turtle_name+"pose",10,&Callback); And here,there is no parameter transmitted into Callback, just the name of Callbackfunction is declared
But in the Callbackfunction,we use: void Callback(const turtlesim::PoseConstPtr& msg) Here the Callback function requires a parameter : & msg
Here it confuses me :Sincere there is no parameter transmitted in the main function when we call the Callback function How is &msg transmitted into Callback when it actuarally execuated?
Many thanks!