[ODE] Joint forces

Russ Smith russ at q12.org
Tue Aug 27 21:42:01 2002


> Attached are the patches for the src and include dirs. 

i have some questions ... the dJointCallback returns an int. if the int
is nonzero then the joint forces are added to the body, else they're
not. what are you trying to achieve with this interface? if it's
selective joint deactivation then this is not the way to go about it ...
setting the joint force to zero will not remove the effect of the joint,
as it's constraint will have already been factored into the force
computations for the other joints. you will get some kind of wierd
"quasi-joint" this way. to deactivate joints, the existing interface
should be used *between* time steps.

hmmm, i sometimes find callbacks a bit messy, what about if this was the
API:

   typedef struct dJointFeedback {
     dVector3 f1;                // force applied to body 1
     dVector3 t1;                // torque applied to body 1
     dVector3 f2;                // force applied to body 2
     dVector3 t2;                // torque applied to body 2
   } dJointFeedback;

   void dJointSetFeedbackMode (dJointID, int mode);
   const dJointFeedback *dJointGetFeedback (dJointID);

when dJointSetFeedbackMode() sets the mode to 1, dJointGetFeedback() can
be used to get the joint feedback information *after* the step has
completed. this API is more easily extensible - we can add fields to the
structure without breaking old code (although the callback could be
passed a structure too). it's also not clear what the callback behavior
should be for higher order integrators.

what do you think?

russ.

-- 
Russell Smith
http://www.q12.org