[ODE] Hinge angle convention

Ross L. Hatton rlhatton at cmu.edu
Wed Jun 20 15:21:15 MST 2007

Hi all,

Is there documentation on the handedness of the angle used by hinge 
joints? I have a chain of bodies connected by hinge joints:

for (int i = 0; i < NUM_SEGMENTS - 1; i++)

//create the joints
Joints[i] = dJointCreateHinge (World,snake_joints_group);

//attach joints to the body
dJointAttach (Joints[i], Body[i], Body[i+1]);

//place the joints
dJointSetHingeAnchor (Joints[i], (i+1) * (link_length), 0.0, 0.0);

// joints are vertical
dJointSetHingeAxis (Joints[i], 0.0, 0.0, 1.0);

//allow large torques when setting velocities
dJointSetHingeParam(Joints[i], dParamFMax, 1000);

My expectation would be for the joints to follow a right-hand rule, as 
I'm connecting from Body[i] to Body[i+1], and have a positively oriented 
  hinge axis.  When running my simulation, however, ODE seems to be 
using a left-hand rule.  Is this the expected behavior, and if so, is it 
documented somewhere?  All I've been able to find is the manual entry 
for dJointGetHingeAngle:

"Get the hinge angle and the time derivative of this value. The angle is 
measured between the two bodies, or between the body and the static 
environment. The angle will be between -pi..pi.

When the hinge anchor or axis is set, the current position of the 
attached bodies is examined and that position will be the zero angle."

which gives no information about the sign convention.

By right-handed, I mean that if I take Body[i] as my reference with my 
hinge axis as [0,0,1], then counter-clockwise rotations of Body[i+1] 
with respect to Body[i] should be considered positive angles.

Thanks for any help,

-Ross Hatton

More information about the ODE mailing list