[ODE] Re: deterministic repeatability issues

Doron Tal dtal at email.arc.nasa.gov
Wed May 18 00:40:26 MST 2005


REPEATABILITY PROBLEM SOLVED!

The unfortunate issue is that I can't tell you *exactly* what I did
to solve this, because on this bug I took it to reorganize all the code
and change a million things before testing (of course everybody
would tell you you should always change one thing at a time & test but..)
At least all changes were geared to solve this problem, so here's what I 
did:

0. follow all the suggestions on the wiki web page (well done, thanks!)

1. completely separate physics from graphics

2. encapsulate the physics in objects in classes for each body,
joint

3. create a PhysicsInit() function that re-creates the physics from
the same values every time, do this for each body (geom) in the
simulation

4. create a PhysicsDestroy() function that deletes everything
possible about the object

5. The constructor of each body object calls PhysicsInit()
and a the destructor calls PhysicsDestroy()

Now we're all set to reset, I do so in this order

dWorldCreate
dSpaceCreate
dJointGroupCreate
dBodyCreate ...
dCreateBox/Sphere ... (i.e.Geoms: intermixed w/bodies --
  it seems to be ok to intermix geom and body creation,
  but I do create them always in the same order)
dGeomDestroy...
dBodyDestroy..
dJointGroupDestroy
dSpaceDestroy
dWorldDestroy

(note destructions are in exact reverse order, i.e.
it's a stack, but I didn't implement it as such)

That's it, hope this helps.

-Doron



More information about the ODE mailing list