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

For your added edit question: the publisher and subscriber from the tutorial are in different nodes, thus they each have their own spin call.

Generally speaking, every ROS node has a spin call. ros.spin() is a blocking call that doesn't return until stopped, using that thread of execution to process messages from the callback queue. ros.spinOnce() processes one message in the callback queue then returns; typically, it is placed within a loop that throttles how often it is called.