Copied from answers.gazebosim, posted by pbeeson:
We have found a bug where if we keep the Atlas robot pinned, that joint_states reported are correct. however, when switched to Nominal mode (the default when launching Atlas in an empty world after 10 seconds or so), that joint_states starts sending incorrect values BUT it seems like the internal joint controller sees the correct values, so any kind of closed loop control cannot be performed correctly.
Make a node that can sends a position to the neck joint through /atlas/joint_commands.
Launch atlas and watch /atlas/joint_states/positions (the neck) start at 0, then after the robot becomes unpinned, it goes to -0.05 (or similar). Send the joint_command to ask the neck to return to 0. It doesn't (BECAUSE WE THINK IT BELIEVE INTERNALLY THAT IT IS ALREADY AT ZERO).
Now, send the service message to repin Atlas, and watch the joint value go back to 0.
While pinned, you can send the neck joint a new position goal, let's say 0.3. It will go there using the PID in the Gazebo plugin. Unpin the robot, and watch the value go to 0.25. So, because the joint_states for (AT LEAST) the neck joint are off by -0.05 radians, any closed loop control gets confused because it's always chasing this offset.