ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
chatterCallback
is used a function pointer in this context, so the function isn't being called by advertise()
. Instead, the address of the function is stored and used later to call that function every time a new message arrives.
Here's a wikipedia article about function pointers and another article specifically about using function pointers in C++ if you want to learn more about the details.