Archived

This topic is now archived and is closed to further replies.

Wymsical

Angular Velocities With Quaternions

Recommended Posts

If the orientation of an object is in a quaternion and the rotational velocitie are also in a quaternion, where the rotational velocity quaternion is how much I want the object to rotate in one second, what would be the quickest way to calculate the new orientation of the object after any real positive time interval?

Share this post


Link to post
Share on other sites
the fastest way is

q2 = q1 + (0.5 * (q1 * w) * dt);

where

q1 is your initial orientation
q2 is final orientation
w is omega (angular velocity)
dt is your euler time step

keep in mind that omega is your supposed derived angular velocity from angular momentum, inertia tensor, and torque.

if your angular velocity quaternion contains different information, then, don''t use that formula.



------------------
General Equation, this is Private Function reporting for duty, sir!

a2k

Share this post


Link to post
Share on other sites
quote:
Original post by a2k
the fastest way is

q2 = q1 + (0.5 * (q1 * w) * dt);




After doing this you generally need to renormalise the quaternion q2, as this generally won''t produce normal quaternions but will produce a sequence of quaternions of increasing length.

Share this post


Link to post
Share on other sites
quote:
Original post by johnb
After doing this you generally need to renormalise the quaternion q2, as this generally won''t produce normal quaternions but will produce a sequence of quaternions of increasing length.


right you are. i failed to mention..



------------------
General Equation, this is Private Function reporting for duty, sir!

a2k

Share this post


Link to post
Share on other sites
I used quaternions for angular velocity before... And it had many problems. When your rotation gets too big, it will break, because a quaternion with a rotation of 2 PI is the same as a quaternion with a rotation of 0.

I decided to use a vector that represents the axis of rotation, and whose length is the angular velocity (i.e.: similar to the angular momentum).

Cédric

Share this post


Link to post
Share on other sites
I''m not to well versed in rotational mechanics, but could an axis and an angle represent absolutely any rotational velocity? Like say for example, i''m in space and i have yaw and pitch thrusters, and i first activate my yaw, which means i''ll have an angualr velocity around my up vector right?, so it would be easy to represent the velocity but say after pi/4 rads i activate my pitch, could my rotational velocity still be represented by a single vector?

Wallaba

Share this post


Link to post
Share on other sites
quote:
Original post by Wymsical
I''m not to well versed in rotational mechanics, but could an axis and an angle represent absolutely any rotational velocity?


Yes. It not only can but it''s quite a natural way to do it: angular velocity has three degress of freedom and can be added and scaled as a vector. The difference is you are dealing with rotational rather than linear dynamics, so you need to use other rotatational quantities (torque instead of force, moment of inertia instead of mass) to do caclulations with it.

Share this post


Link to post
Share on other sites
So i can represent my angular velocity with a simple vector
(x_1,x_2,x_3) (In R3) where the vector forms my axis of rotation and the magnitude is the magnitude of the rotation?

So if i wanted to scale the vector it would just be simple scalar multiplication?

If all that is correct, i can take my calculated angualr displacement, and convert it to a quaternion using standard axis&angle->quaternion conversion?

Share this post


Link to post
Share on other sites
quote:
Original post by Wymsical
So i can represent my angular velocity with a simple vector
(x_1,x_2,x_3) (In R3) where the vector forms my axis of rotation and the magnitude is the magnitude of the rotation?

So if i wanted to scale the vector it would just be simple scalar multiplication?

If all that is correct, i can take my calculated angualr displacement, and convert it to a quaternion using standard axis&angle->quaternion conversion?

Yes, everything seems correct. The angular momentum vector L also has a few uses when dealing with collisions.

Cédric

Share this post


Link to post
Share on other sites