[ODE] Re: dJointFeedback

Matthew Hancher mdh at email.arc.nasa.gov
Thu Jan 20 12:06:32 MST 2005

> Why dJointFeedback structure contains fields for different forces and 
> torques
> for two bodies?
> As far as I can tell from my memory on mechanical problems, reaction 
> forces
> that are caused by joint are equal in absolute value and the only 
> difference
> is that they have opposite direction.

You betcha.  However this is true only under the assumption that the 
are being applied at the same point in space (the location of the 
joint) or
at least at points coaxial with the force.

> What wrong with me (or ODE)?

Nothing is wrong with ODE, and I suspect nothing is wrong with you 
either. :)
The info that ODE returns in the joint feedback structure describes the
effective forces and torques that have been applied at the bodies' 
centers of mass.  If you do the coordinate transformation to compute the
equivalent forces and torques, assuming that the forces are both being 
at the same point in space, you will find that they are indeed equal and

Consider a hinge joint.  ODE's job is to keep the appropriate axes on 
the two
bodies collinear and to prevent the bodys from sliding relative to each 
along that axis.  In the physical world that constraint might be 
maintained by
a bearing located at any point along the axis.  The actual forces 
at the joint will depend on the bearing's particular location.  If you 
want to
compute the actual torques experienced by a joint in a given spot, you 
have to
do the conversion yourself, taking into account the joint's position, 
ODE does not in general know.

Actually, you should observe that the *forces* returned by ODE *are* 
equal and opposite, but the torques are not because the forces are being
applied at different points.  To compute the corrected torques, you can 
something like:

     // joint connects body1 to body2, acting at position jointPos

     const dJoint::FeedbackData *fb = joint->getFeedbackData();

     // fb->f1 and fb->f2 are already correct; compute the torques:

     dVector3 t1 = fb->t1 + (fb->f1).cross( jointPos - 
body1->getPosition() );
     dVector3 t2 = fb->t2 + (fb->f2).cross( jointPos - 
body2->getPosition() );

     // now t1 and t2 are equal and opposite too, so of course we really
     // only needed to bother with one of the above two computations

(Or at any rate that's how I express it using my library; your syntax 
be different, but the math is the same.)


Matt Hancher
NASA Ames Reserach Center
mdh at email.arc.nasa.gov

More information about the ODE mailing list