ros-controls/ros_control — pull request #127 by meyerj (2013-11-05 12:16:18+00:00)
Title: Added optional per-controller update period

This pull request adds an optional per-controller update period to ros_control.

The default update period for a controller is zero and the controller is updated on each update of the controller manager. This should not break existing code.

If the controller sets an individual update period by calling the new `ControllerInterface::setUpdatePeriod()` method, e.g. in its overridden `init()` method, the controller manager will only invoke update if the desired period has elapsed since the last update and also adapts the period passed to the controller accordingly.

I am using ros_control for a cascaded controller where the outer loops should run slower than the inner loops. Of course it would be possible to implement this throttling in the outer controllers itself, but this solution is more general. Another use case is the JointStateController in ros_controllers, where a similar solution is already implemented for the publish rate.

There are also some checks in `ControllerInterface::updateRequest()` that make sure that the controller (hopefully) handles stops and restarts at a later point of time (or a time reset when running in Gazebo) correctly without passing bogus periods to the controller's `update()` method.