resting objects connected with constraints drift on ground

Gickl
Posts: 33
Joined: Tue Jun 05, 2012 8:43 am

resting objects connected with constraints drift on ground

Post by Gickl »

Hi,

meanwhile i got the same problem again and again and in several situations. but it is always the same problem of drifting bodies on the ground.

for example i have a box as a vehicle body and 4 cylinders connected with it by btHingeConstraints. When the wheels stand still the vehicle is drifting on the ground regardless. but when the vehicle lies on its roof, so on the box, it stays exactly at the same position.
so i think nothing is wrong with the configuration of the simulation or with friction or something.
this behavior only ever appears when objects connected with constraints touch the ground. single objects behave like expected...

can someone tell me how i can solve this problem? it is not satisfying when vehicles are always moving when should be in rest no matter if they are legged or wheeled or whatever!

Thank you in advance!
Daniel
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: resting objects connected with constraints drift on grou

Post by Erwin Coumans »

Can you reproduce the problem in a Bullet demo, such as Bullet/Demos/ConstraintDemo?

Iterative constraint solvers have issues with large mass ratios (1 : 10 or higher). What is the mass of the vehicle and its wheels?
You could try using a smaller internal timestep:

float internalTimeStep = 1.f/240.f;
world->stepSimulation(clockDeltaTimeInSeconds, 100, internalTimeStep);
Gickl
Posts: 33
Joined: Tue Jun 05, 2012 8:43 am

Re: resting objects connected with constraints drift on grou

Post by Gickl »

Thanks for your fast reply, Erwin!

I modified the masses to get a smaller ratio and i think it the simulation got better. the drifting got less but it is still there.
in the next days i will test a few other vehicles or situations (wheels, tracks etc) and play with the internal timestep and the masses.
i if won't come to an acceptable behavior i will try to reproduce the problem in one of the demos.