ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In roscpp, the ros::spinOnce() is what invokes the subscribe callbacks. Since your code is calling spinOnce only once every 40 milliseconds, that is the fastest they fire. You may want to take a look at ros::AsyncSpinner(), but make sure you use proper thread mutexes if you do.

http://wiki.ros.org/roscpp/Overview/Callbacks%20and%20Spinning