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

Revision history [back]

The nodelet manager doesn't call spinOnce but spin as you can see in nodelet/src/nodelet.cpp, line 296, at least in Fuerte. Spin doesn't do any sleeps but calls callAvailable on the global callback queue in a loop. callAvailable doesn't sleep on a timeout either. It blocks on a condition variable until a message is received on the queue and executes all callbacks. That means that you shouldn't need to do any special handling or call spin or spinOnce by hand.

The nodelet manager doesn't call spinOnce but spin as you can see in nodelet/src/nodelet.cpp, line 296, at least in Fuerte. Spin doesn't do any sleeps but calls callAvailable on the global callback queue in a loop. callAvailable doesn't sleep on a timeout either. It blocks on a condition variable until a message is received on the queue and executes all callbacks. That means that you shouldn't need to do any special handling or call spin or spinOnce by hand.hand. Message callbacks should be executed at once, i.e. as soon as the main thread gets computation time by the OS scheduler.