[ODE] ODE BUG

kalikali at tlen.pl kalikali at tlen.pl
Thu Oct 20 22:25:40 MST 2005


I think I found some serious bug in ODE.
Position of the body (changed by applied force) is incorrectly calculated.

Position in timestep should be calculated as:

x = x0 + v0 * (t - t0) + 0.5 * a * (t - t0)

Currently it is calculated as:

x = x0 + v0 * (t - t0) + a * (t - t0)

(without * 0.5 !!!!)

//==============================================================

unit util.cpp (dxStepBody)

b->pos[j] += h * b->lvel[j];

//==============================================================

Put some body in field of gravity, and do dWorldQuickStep(,10)
Check body position
Now, do the same, but in loop:
for (i=0;i < 10;i++) dWorldQuickStep(,1)
Check body position
Positions are not the same !!!
This is the problem

//==============================================================

I've made a little patch (currently only for quick step) but I
don't know is this correct. 

Lukasz




More information about the ODE mailing list