Integrating angular velocities

Please don't post Bullet support questions here, use the above forums instead.
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Integrating angular velocities

Post by Dirk Gregorius »

I am aware of three ways to integrate angular velocities:

a) Using the quaternion derivative: q' = 0.5 * w * q
b) Creating an finite rotation from the angular velocity and the timestep dt, basicall alpha = Length( w ) * dt and axis = Normalize( w )
c) Bullet has also something called exponential map (I think SOLID has this as well)

So what are the differences between them and what are the advantages/disadvantages of one over the other? Are there any other decision criteria, but performance (e.g. simulation quality)?


Also in this context:
How do you damp angular velocity? Simply using something like: w *= 0.995 before integrating torques makes my solver results worse. Any ideas why this is so and what is a good strategy to damp the angular velocity (e.g. preventing non-linearities because of high angular velocities. We could damp as a function of the actual angular speed in order to damp high velocities down quickly, but don't touch moderate ones).
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

Bullet implements 2 different strategies, so you can trade performance versus accuracy.

I'm not away that SOLID uses an exponential map. Where is that implemented?

Erwin
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Post by Dirk Gregorius »

So which method is more accurate and why?
Antonio Martini
Posts: 126
Joined: Wed Jul 27, 2005 10:28 am
Location: SCEE London

Post by Antonio Martini »

Dirk Gregorius wrote:So which method is more accurate and why?
b) and c) should be the same. see also the following paper for the advantages/disadvantages:

http://www.cs.cmu.edu/~spiff/moedit99/expmap.pdf

the exponential map integration is drift free, so there is no need of normalizing. The immediate consequence is that you can integrate for much larger time steps. For example If we measure the angular error in a control scheme(motors) and then we numericallly integrate by using the quaternion derivative, our control scheme would take longer to converge as the way we measure the error and the way we fix it is not fully consistent as there is some drift proportional to the timestep.
so with the exponential map you can reach zero angular error in one numerical integration step.

cheers,
Antonio
mhx
Posts: 6
Joined: Wed Apr 18, 2007 8:12 pm

Post by mhx »

Maybe it's already been implied in the thread, but there is also the closed form integration technique for quaternions. See for instance htttp://graphics.stanford.edu/~rachellw/files/articulated.pdf. Page 4, eq 1.

Don't remember the exat source of it, think it might be NASA?
Antonio Martini
Posts: 126
Joined: Wed Jul 27, 2005 10:28 am
Location: SCEE London

Post by Antonio Martini »

mhx wrote:Maybe it's already been implied in the thread, but there is also the closed form integration technique for quaternions. See for instance htttp://graphics.stanford.edu/~rachellw/files/articulated.pdf. Page 4, eq 1.

Don't remember the exat source of it, think it might be NASA?
that looks like the exponential map approach to me, axis and magnitude, where the magnitude is the angular speed scaled by the time step.
Formula (1) behaves badly when the angular velocity is close to zero.
the link to the paper i posted earlier(see Section 3) shows how the problem can be solved by a simple Taylor expansion.

cheers,
Antonio
KenB
Posts: 49
Joined: Sun Dec 03, 2006 12:40 am

Post by KenB »

AntonioMartini wrote: that looks like the exponential map approach to me, axis and magnitude, where the magnitude is the angular speed scaled by the time step.
Formula (1) behaves badly when the angular velocity is close to zero.
the link to the paper i posted earlier(see Section 3) shows how the problem can be solved by a simple Taylor expansion.

cheers,
Antonio

A Taylor expansion doesn't make it fully stable. It is still unstable with regard to rotations around the middle axis, if the moment of inertia is non-homogeneous. Thus, problem not solved.

It is quite strange though, that methods from Molecular Dynamics haven't made it to computer graphics yet.
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Post by Dirk Gregorius »

It is quite strange though, that methods from Molecular Dynamics haven't made it to computer graphics yet.
What you mean by this? Any examples or resources?

Thanks,
-Dirk
Antonio Martini
Posts: 126
Joined: Wed Jul 27, 2005 10:28 am
Location: SCEE London

Post by Antonio Martini »

KenB wrote:
AntonioMartini wrote: that looks like the exponential map approach to me, axis and magnitude, where the magnitude is the angular speed scaled by the time step.
Formula (1) behaves badly when the angular velocity is close to zero.
the link to the paper i posted earlier(see Section 3) shows how the problem can be solved by a simple Taylor expansion.

cheers,
Antonio
A Taylor expansion doesn't make it fully stable. It is still unstable with regard to rotations around the middle axis, if the moment of inertia is non-homogeneous. Thus, problem not solved.

It is quite strange though, that methods from Molecular Dynamics haven't made it to computer graphics yet.
could you elaborate a bit more please? the Taylor expansion is mainly used in order to convert from the exponential map to a quaternion, so there is no inertia there. The sinc(x) function is evaluated by a Taylor expansion just because it's not already in the standard maths libs.

cheers,
Antonio