[ODE] Important (new) info for saving sim state

Jon Watte hplus-ode at mindcontrol.org
Sun Aug 22 14:14:05 MST 2004


I believe the theory to fix this problem (and possible others, 
similar), is to do a restore immediately after the save. Then 
what happens is that each time the save point is played back, 
including the first time, the same data gets used.

Cheers,

			/ h+


-----Original Message-----
From: ode-bounces at q12.org [mailto:ode-bounces at q12.org]On Behalf Of Eric
Froemling
Sent: Sunday, August 22, 2004 3:27 AM
To: ODE at q12.org
Subject: [ODE] Important (new) info for saving sim state


I recall seeing a person or two out there besides myself who was 
interested in perfectly restoring an ODE sim to a previous state so 
that it will arrive at the same results again.
Basically whats been said before is that for each body, its position, 
linear and angular velocities, and quaternion needs to be set to stored 
values.
Also, with quickstep and warm-starting, joint lambda values need to be 
saved/restored as well.  Theres no current api method to do this afaik. 
(warm starting can be disabled by commenting out the "#define 
WARM_STARTING 1" line in quickstep.cpp.
anyway thats old news...

I just found a new pitfall however..  (after a long and painful bug 
hunt ; P)
I'd found that though I was following all the above steps, my sims were 
still coming up with very slightly differing results depending on what 
saved point i reset them to.    I finally tracked this down to 
dBodySetQuaternion - it calls dNormalize4() on the values you provide.  
So if you plug a quaternion value into ODE that you'd pulled from 
dBodyGetQuaternion() earlier, the values that actually get stored might 
differ by a bit or two, making exact state restoration impossible.  For 
my own use I just commented out the dNormalize4 line.. I dont know if 
it would be useful to add a "dontNormalize" argument to the function or 
whatnot - I mainly just wanted to bring this to people's attention.

-Eric

_______________________________________________
ODE mailing list
ODE at q12.org
http://q12.org/mailman/listinfo/ode




More information about the ODE mailing list