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

If you're trying to wait a certain amount of time before proceeding, I would suggest that you do it asynchronously so that you don't block any loops. This can be achieved in ROS through timers.

Once a timer expires, it throws an event that is handled in a callback function. In this way, you can simply have a loop that runs all of your updates, but when the timer expires, command will jump to handle the callback function, and then will immediately return to your main loop. This way, you're not blocking your main loop while you wait for a certain period of time. You can see here for more information on event-driven programming.