DRC Control issue: Bad joint_states when in Nominal mode [closed]
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.
To Reproduce:
Make a node that can sends a position to the neck joint through /atlas/joint_commands.
Launch atlas and watch /atlas/joint_states/positions[3]
(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 the controller internally believes 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 the neck joint are off by -0.05 radians, any closed loop control gets confused because it's always chasing this offset.
This may not be a "bug", but it is an unfortunate situation where Nominal mode (which is difficult to use for control tuning because the robot easily falls/collapses) has steady state offset that requires constant, non-zero force to remain stable, whereas "pinned mode" (which is easy to use for control tuning) does not. More documentation on this at the bitbucket issue above.