[ODE] Re: Virtual creatures (karl sims etc...)

nlin@nlin.net nlin at nlin.net
Wed May 15 03:03:01 2002


"Martin C. Martin" <martin@metahuman.org> wrote:
 
> I'm doing some Karl Sims type work at MIT and using ODE for it, and the
> biggest problem is that constraints aren't added until penetration has
> already happened, i.e. until it's "too late."  Then ODE adds a force to
> separate the two bodies.

It should be noted that this "force" causing the bodies to separate is due
to the ERP for the constraint, not the constraint itself (the contact
constraint is purely velocity based, meaning penetration is allowed; it
is the ERP term which causes separation - see the joints guide).

> So, I'm toying around with adding the constraint a timestep early, i.e.
> on any timestep where two things would otherwise start to
> interpenetrate.

You might be able to avoid this by making the ERP for the contact constraint
zero, or by modifying the contact constraint so that it has no positional
error-correcting term. Setting global ERP to zero also works (try this
in test_boxstack.cpp to see the effect). This has the unfortunate effect of
allowing penetrating static configurations, but if objects are often in motion
the velocity term in the contact constraint will ensure that they don't move
further into each other (i.e. max penetration is that which would occur in one
timestep). This might be good enough for your purposes. 

-Norman