[ODE] Joint forces

Erwin de Vries erwin at vo.com
Wed Aug 28 02:24:02 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.

The main reason for the option to disable a joint's effect on the current
step is to fix LCP errors. You can easyly detect an invalid force or torque,
and then simply return 0 to 'fix' the problem. I do this checking for all my
joints, and it works.

> 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).

So inside the joint a dJointFeedback* will be kept, and this pointer will be
initialized when the mode is set to 1. It will be filled at the same place
the callback in my code is generated, and the user can get it after the
step. Sounds reasonable (if LCP problems were solved). What about contact
joints? They are created for every step. Setting the mode for every step
would mean you have to allocate these 64 bytes for each joint for each step.
Right?

> it's also not clear what the callback behavior
> should be for higher order integrators.

I cant comment on that. ;-)