btGeneric6DofConstraint limits problem in 2.63-RC1 (and 2.62).

pico
Posts: 229
Joined: Sun Sep 30, 2007 7:58 am

btGeneric6DofConstraint limits problem in 2.63-RC1 (and 2.62).

Post by pico »

Hi Erwin,

i think the "btGeneric6DofConstraint" has a problem in 2.63-RC1 (and 2.62).

The "btGeneric6DofConstraint" rotational limit definition says "free means upper < lower". This doesn't work currently at least for Y axis when using "setAngularVelocity".

TEST CASE:
Create a "btGeneric6DofConstraint" constraint.
Set linear limits to min=-100,max=100.
Set lower/upper limit for X+Z axis. Set upper/lower limit for Y axis.
When now setting an angular velocity for the Y axis it will explode after ~180 degrees.
NOTE: I set for the X/Z axis the angular velocity i got previously with "getAngularVelocity ()"

Maybe its due to the fix someone contributed lately to make ragdolls working better. Or its simply not allowed to use setAngularVelocity on constraints?
User avatar
projectileman
Posts: 109
Joined: Thu Dec 14, 2006 4:27 pm
Location: Colombia

Re: btGeneric6DofConstraint limits problem in 2.63-RC1 (and 2.62

Post by projectileman »

If you could read the btGeneric6DofConstraint documentation, in the line 191, you might notice that btGeneric6DofConstraint has these ranges in its limits:

[*] X = (-PI,PI), in some cases (-INF,INF) when unrestricted
[*] Y = (-PI/2,PI/2)
[*] Z = (-PI,PI), in some cases (INF,INF) when unrestricted

Y must be limited between -PI/2 <= Y < = -PI/2, due of an Euler Angles problem;the only way for finding the Y angle is using ArcSin() :wink:
So you have to change the angle of reference for your motor.

You should read this post:
http://www.bulletphysics.com/Bullet/php ... f=9&t=1480


And please, I want you tell me if velocity motors work fine in btGeneric6DofConstraint, Do they ??
Thanks,
pico
Posts: 229
Joined: Sun Sep 30, 2007 7:58 am

Re: btGeneric6DofConstraint limits problem in 2.63-RC1 (and 2.62

Post by pico »

projectileman wrote:If you could read the btGeneric6DofConstraint documentation, in the line 191, you might notice that btGeneric6DofConstraint has these ranges in its limits:

[*] X = (-PI,PI), in some cases (-INF,INF) when unrestricted
[*] Y = (-PI/2,PI/2)
[*] Z = (-PI,PI), in some cases (INF,INF) when unrestricted

Y must be limited between -PI/2 <= Y < = -PI/2, due of an Euler Angles problem;the only way for finding the Y angle is using ArcSin() :wink:
So you have to change the angle of reference for your motor.

You should read this post:
http://www.bulletphysics.com/Bullet/php ... f=9&t=1480
Thanks for your comments.

The issue is that the current implementation doesn't allow to have the Y axis 'unlocked' by setting lower>upper. Or is there now a different method to 'unlock' a specific axis?
User avatar
projectileman
Posts: 109
Joined: Thu Dec 14, 2006 4:27 pm
Location: Colombia

Re: btGeneric6DofConstraint limits problem in 2.63-RC1 (and 2.62

Post by projectileman »

In a rotational contraint if you restrict either the X axis or the Z axis, you cannot leave Y axis unrestricted. When this situation happens Y should have a valid value between [-PI/2, PI/2] otherwise you will get a gimbal lock problem.

If you want getting Y unrestricted, you must leave X axis and the Z axis unrestriced too. So if you want a rotational motor you'd better choose another axis, either X or Z.

This problem is common in every 6DOF constraints, even the AGEIA Physx engine has this issue (The AGEIA documentation says that The maximum swing angles may be set between 0 and 180°. )