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

Revision history [back]

One issue is that ros::Rate actually tries to keep the loop at a fixed rate, but it also tries to "catch up", if there are any delays. See this:

In the above example, the Rate instance will attempt to keep the loop at 10hz by accounting for the time used by the work done during the loop.

So, basically, if you expect 10Hz=100ms, It might work for the first few, then there is something which makes it run longer (say 110ms), the next time it would probably be 90ms.

Maybe going for a timer could solve this issue.