I fixed it, and I also added a simple interface for changing the position of the right arm joints.
The gui display the setted angle... and the actual angle of the joint. So, you can see the difference when gravity work against the movement.
The opengl window is rendered by libQGLViewer when it has the focus you can press "h" for getting the help on how to move with the mouse and keyboard... and if you press "m" a little pop-up menu appear on top-right where you can enable/disable some thinks for debugging.
When joint show is enable, for each joint is displayed it's local frame and on the cyan cylinder the axis of rotation with a red mark for showing limits and a little green mark on top of red mark for showing the current angle position.
Any question about the code... I'm here
