[ODE] Resetting velocity

Martin Magnusson mama7121 at student.uu.se
Fri Nov 21 19:00:25 MST 2003


I'm having trouble resetting my simulation properly. I'm simulating a 
biped robot with an accelerometer located at the hip. To get the reading 
of the acc-meter I do the following:

   dBodyGetRelPointVel( obj[HIP].body, 0, 0, 0, accelerometer );

This seems to work fine, but the problem is that after I reset all body 
positions and velocities, the next time that dBodyGetRelPointVel is 
called, it still reports a fairly high velocity, and not something close 
to zero. I reset the bodies to their initial positions with 
dBodySetPosition, and the forces and velocities with the following code:

   for (i = 0; i < NR_OF_LIMBS; i++)
     dBodySetRotation   ( obj[i].body, rotation );
     dBodySetLinearVel  ( obj[i].body, 0, 0, 0 );
     dBodySetAngularVel ( obj[i].body, 0, 0, 0 );
     dBodySetForce      ( obj[i].body, 0, 0, 0 );

Shouldn't this set the velocity of all bodies to zero? Is there 
something that I'm missing here?

/ martin

More information about the ODE mailing list