ros-simulation/gazebo_ros_pkgs — pull request #286 by xqms (2014-12-28 14:17:31+00:00)
Title: gazebo_ros_control: respect joint limits while measuring joint angle

Previously, the logic used to reconstruct joint angles from
Gazebo measurements could end up with joint angles outside the limits.
For example, this occurs when setting joint angles with the
`set_model_configuration` service call.
Example:

lower limit: -2.792
upper limit: +2.792
argument to `set_model_configuration` call: -2.222
calculated joint angle: 4.061

This confuses the PID controllers from `ros_controllers`.

Now, use `angles::shortest_angular_distance_with_limits()`
for revolute joints to calculate a delta which results in an angle
inside our limits.