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

Revision history [back]

As far as I know, a Timer will not queue a callback until the previous one is finished.

If you set a Timer that triggers at 15fps, means that the callback will have ~0.06 seconds to run.

Let's say that your callback takes 0.02 seconds to run (when the processor is not overloaded), then the timer will schedule the next callback in 0.04 seconds and the net effect is that you see your callback being executed at 15fps.

But if your callback takes more than 0.06 seconds, let's say it takes 0.1 seconds because your processor is overloaded with work, then the timer will execute the next callback immediately after the last one (because it has been longer than 0.06 seconds since the last callback) and the net effect is that you will see your callback being executed at 10fps.

So, to sum up, it is not that the callback gets dropped if its being delayed for too long, it is that the callback doesn't get scheduled until the last one is finished.