[ODE] multiple contacts and sticking on the cusp

Russ Smith russ at q12.org
Mon Oct 28 23:39:02 2002


> attached is a modified version of test_boxstack.cpp.  hit the 's' key
> to drop a sphere and watch what happens.  see how it sticks on the
> cusp between the ramp and the ground plane?
> 
> is this expected or is it a bug?

hi david,

i have found the problem. it's not exactly a coding bug in ODE, it's a
problem with the way that the friction model is used. here's the story:

ODE has two ways to approximate friction: the default way (called the
constant-force-limit approximation, or 'box friction') and the improved
way (called "friction pyramid approximation 1") which is obtained by
setting the dContactApprox1 flag in the contact mode.

your example uses the default box friction (as do most of the ODE test
samples). it turns out that in a world that has box friction only, the
"physically correct" behavior for a ball rolling down an inclined plane
is to stop dead when it hits the ground! in other words, it's not an ODE
bug as such but a consequence of this friction model in the contact
joint. of course this is not the behavior that you see in real life,
because real life does not have box friction!

the solution is to use the dContactApprox1 mode, i.e. do this in your
code:

   contact[i].surface.mode = dContactApprox1 | other_flags
   contact[i].surface.mu = dInfinity;  // or, some other value like '1'

your example did lead me to find a couple of problems in the LCP solver
that were only evident in when dContactApprox1 was being used ... i've
fixed them, and you'll have to check out lcp.cpp,lcp.h from CVS for this
to work properly.

i'll add a section to the FAQ that explains all this better, and gives
the intuitive reason why box-friction causes this problem (i'll need a
diagram - it's hard to explain in words).

hope this helps you!

russ.

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