resetRotationAndForces

resetRotationAndForces mostly never works.

setting a body to a known position, orientation, etc ought to be pretty elementary operation. Why does the simulation blow up half the time? workarounds?

my car sim allows the car to flip over, so i’m implementing a reset button …

:j

the car demo manages this without everything blowing up - are you calling resetRotationAndForces after moving them into position? Just make sure the order you are calling things is correct (use the car demo as a reference).

This is probably a good question for the ODE mailing list if you still have troubles as they are the ODE experts and they would be able to answer this question for sure. Just don’t tell them java methods - open the source and see what ODE methods are actually being called and tell them those. I would like to add a debug log option which basically logs all calls to ODE.

Will.

the car demo basically destroys all the joints
and rebuilds the car from scratch. I see why this
is effective now. Moving the chassis and expecting
the wheels to snap into place probably creates
crazy momentums and accelerations. I wonder
if I can get away with moving the wheels but leaving
the joints alone …

I don’t supppose Ode has a notion of “body groups”
which would allow multiple arbitrary bodies to be
positioned and rotated as a group?

thanks, :j

not sure I follow your “body groups” suggestion, can you elaborate please?

Will.

“body groups” would be a collection of bodies joined by joints. My guess above proved correct, i needed to move both the chassis and the four wheels.

Another approach you could use instead of reseting the car, is to analyse its position and orientation and apply forces to “float” it back to the reset position and orientation (obviously must step the world during this). Probably easier to turn off gravity and most collisions as well. I guess you could think of it like a more complex kind of ERP.