[ODE] RE: Wheel rotation problem

Russ Smith russ at q12.org
Tue Oct 15 16:32:02 2002


> > (russ/ode_users?) Why is it not possible to totally stop the hinge2
> > 'axles' becoming 'bent' ?

well, anything is possible :) the question is, why does it happen in the
first place. here's the answer:

ODE stores the position and orientation of each body independently. if
there is any error in the integration step then it is possible for the
bodies to be in positions/orientations where the joints do not line up
properly (i call this 'joint error', it is the same thing as the wheels
getting bent in hinge2). there are many sources of joint error, but the
surest way to introduce error is to have two or more jointed bodies that
are rotating very fast with respect to each other. this is because the
physics model and the integrator use certain linear assumptions about the
way that bodies will move during a time step - if the bodies are rotating
so fast that the new configuration at the end of the step is completely
different, then these linear assumptions are just plain wrong (and the
bodies will not be moved to the correct places).

this is a problem that afflicts all 'cartesian coordinate' or 'lagrange
multiplier based' simulators. reduced coordinate simulators like dynamecth
dont have this problem (for the bodies along the main tree), because the
coordinate system they use simply doesn't allow for the possibility that
the bodies will not be aligned correctly (the same problem will occurr
when you close any loops however).

ODE has a partial fix for this problem, which
is the dBodySetFiniteRotationAxis() function and friends. but note that
this is an exercise in error reduction, not error elimination - it will
increase the speed at which a vechicle can be reliably made to move.
for *very* fast moving vehicles where the wheels rotate a large proportion
of one cycle per timestep, completely eliminating the error is going to
require a lot of fiddling.

another approach for simulating wheels is to 'fake them' or 'raycast them'
- these approaches are effective for computer games, because the
difference between 'perfect physics' and 'physics that is completely
wrong' is not generally noticeable to the player (or even to an
experienced physicist). the only caveat here is that with increasing
physical realism comes the chance for better emergent (and/or synergistic)
behavior coming out of the simulation. you have to be careful that you
are not faking so much that your resulting behavior is little better than
hard-coded animation.

will ODE support these methods in the future? it's possible.

russ.

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