Page 1 of 1

btGeneric6DofConstraint Angular Motors/Friction

Posted: Mon Dec 05, 2011 12:54 pm
by peterk
Hi,

I'm attempting to use the btGeneric6DofConstraint to simulate a ball/point2point constraint with friction by enabling the angular motors with a target velocity of zero. The problem comes when trying to simulate a 2D grid of constrained bodies:

Code: Select all

B-B-B-B
| | | |
B-B-B-B
| | | |
B-B-B-B
| | | |
B-B-B-B
So each body is constrained to the adjacent bodies with a pivot at the mid point. The constraint pivot frame is initially set to the world frame. With this setup, if a constraint rotates by greater than some small angle (~pi/4) the entire system becomes unstable. This doesn't appear to be related to the maximum force on the motors although it is eliminated by increasing the constraint solver iterations, presumably because this limits the angle achieved between bodies.

My assumption is that this is some euler angle related problem, but I can't reproduce the issue with ODE and as far as I'm aware the angular motors in Bullet are a port of the ODE motors. I wondered if this could be more to do with differences between the ODE quickstep solver and Bullet's sequential impulse?

I'm going to continue to investigate but if anyone had any thoughts it would be appreciated. I can post code later to reproduce the issue.

Thanks.

Re: btGeneric6DofConstraint Angular Motors/Friction

Posted: Tue Dec 06, 2011 1:23 am
by peterk
I've attached a hacked version of ConstraintDemo.cpp which exhibits the problem. Just fire a few cubes at the centre of the constraint array with the '.' key.

Re: btGeneric6DofConstraint Angular Motors/Friction

Posted: Wed Dec 07, 2011 5:38 pm
by peterk
Ok, I've finally tracked this down to the fact that ODEs quickstep (optionally) randomly reorders non-contact constraints while Bullet's sequential impulse (optionally) randomly reorders non-contact constraints. Extending the bullet random constraint reordering code to handle non contact constraints fixes the issue.

Erwin: I can submit a patch for this if you'd like, it's only about 10 lines of copy/paste code though.