[ODE] Simulation grinding to a halt
Warrick Buchanan
warrick at chimeric.co.uk
Sat Feb 8 14:28:01 2003
I have my first ODE app which has one ground plane defined and a number of
box geometries under the influence of gravity. The boxes start off in a
initial specified position and freefall under gravity. I have it set up so
that my nearCallback function only takes a maximum of N contacts every
simulation loop (I have tried N between 30 & 100) and that after a box has
collided five times (determined in the nearCallback function) with the
ground plane it is then allowed to fall through it. When the boxes have
fallen through the plane and are no longer visible I respawn them in their
initial positions (I originially did this by just brutally resetting their
position and orientations and velocities but this caused stack overflows
quickly so I now destroy and recreate them as the boxstack test app does).
This works as intended apart from after a while the simulation gradually
slows down to a crawl given time. I have on the screen a display of the
number of contacts generated each simulation loop and this max's
occasionally throughout when the simulation is running normally but is stuck
more or less at the maximum when the slow down occurs?
I'm not quite sure why this is happening? The only thing I can think of is
that perhaps I am respawning objects into other falling objects and this is
somehow causing problems? This seems unlikely however but is the only idea
I have that I am investigating. The number of boxes I use vary from 20
onwards and I should mention I am using ODE 3.0 as due to connection
difficulties I can't upgrade at the moment(!). Also I only allow 3 contact
points between object pairs as in the stack test example app.
Many thanks,
Warrick.