[ODE] Rotating collision body does not move rigid body

Chris Haarmeijer c.haarmeijer at keepitsimple.nl
Mon Aug 12 02:29:01 2002


Ok, this makes sense. The other way around you mention is to model the
rotating geometry via a rigid body + mass also. Isn't this also violating
ODE's principles as mentioned in the manual (static geometry?).

Chris

-----Original Message-----
From: ode-admin@q12.org [mailto:ode-admin@q12.org]On Behalf Of
nlin@nlin.net
Sent: vrijdag 9 augustus 2002 15:55
To: ode@q12.org
Subject: Re: [ODE] Rotating collision body does not move rigid body


Chris Haarmeijer  wrote:
> Am I abusing ODE or is something wrong: I have a cube without the top (5
> planes) defined as collision geometry and a sphere which is defined as
> collision geometry and a rigid body. The rigid body falls inside the cube
> and lies still on the bottom of it (which is correct). When I rotate the
> collision planes, should the rigid body move yes or no? My understanding
of
> ODE says yes, but then again, i'm kind of a newbie here.... :)

First of all, you need to generate a contact joint at the point of
collision,
or else the collision will not affect the simulation at all.

But a rotating geometry without an associated body has some problems.
Consider: when you "rotate" your collision geometry (which is not associated
with a body) you are instantaneously moving from a valid (non-colliding, or
non-penetrating) configuration to an invalid configuration (penetrating).
>From ODE's point of view, it's exactly the same as if your collision
geometry
suddenly materialized right in the middle of your sphere (which has geometry
and a rigid body).

So what can ODE do? The sphere was not moving beforehand, and suddenly
there's this plane (or multiple planes) embedded inside of it, which have
no rigid body information associated with it. It can't dynamically resolve
the collision based on the "movement" of the plane, because from ODE's point
of view, the plane isn't moving - it just suddenly materialized.

The best ODE can do is to try to push the sphere back out of the plane to
move the system back into a legal configuration, and possibly to add a
"bounce" factor (specified in the contact joint) by mirroring (and reducing)
the velocity along the contact normal. Moving back into a legal
configuration
is the role of the ERP, the error reduction parameter. Here, the error is
the amount of penetration, and depending on how high you set ERP, that will
control how much of a "spring force" is used to push the sphere back out.
Since no other forces are acting on your sphere, if you set ERP too high,
the
sphere will fly away wildly.

The problem is that your sphere was not moving at all when the plane(s)
suddenly materialized inside of your sphere. So there is no relative
velocity
to mirror, so there is initially no bounce. Only after the ERP starts to
push
the sphere out of the plane will the sphere gain velocity (thus unphysically
gaining energy in the process, but your planes were also unphysically
rotating
without any mass). This added energy might cause "superball" type behavior
where the sphere flies off wildly - depending on how high your ERP is and
how fast you rotate your planes.

I think it would probably be best to use boxes (with bodies and mass) to
model
your movable geometry, since the alternative, movable geometry without any
rigid body information, is sort of a violation of the assumptions of a rigid
body simulator - you are discontinuously moving the system into illegal
(penetrating) configurations, so the best the simulator can do is to somehow
try to "cope".

-Norman
_______________________________________________
ODE mailing list
ODE@q12.org
http://q12.org/mailman/listinfo/ode