- #1
vicjun
- 18
- 0
I'm struggling to understand what the derivative of an attitude quaternion really is and how to use it. I need it to solve a problem relating to a rotating frame of reference relative an inertial frame.
The information I have is a vector of Euler angular velocities (i.e for roll [itex]\phi[/itex], pitch [itex]\theta[/itex] and yaw [itex]\psi[/itex]), with components [itex]\dot{\phi}[/itex], [itex]\dot{\theta}[/itex] and [itex]\dot{\psi}[/itex], for each point along the path. The points correspond to a date/time [itex]t_i[/itex], rather than a spatial location (where [itex]i[/itex] is the index). The angular velocities represent the rotational velocity of the frame relative to an inertial frame at a point with date [itex]t_i[/itex].
The only other piece of information I have is the inital attitude of the frame at time 0, i.e [itex]t_0[/itex], in the form of a quaternion [itex]Q_0[/itex] with components [itex]q_0, q_1, q_2[/itex] and [itex]q_3[/itex]
What I want to do is to calculate the quaternion derivative at every point in time. To do this I am using the method desribed here:
http://www.euclideanspace.com/physics/kinematics/angularvelocity/QuaternionDifferentiation2.pdf
Which works for the first point, because I can create a quaternion of angular velocities and I have the initial quaternion [itex]Q_0[/itex]. I have a ready-made script that allows me to calculate this quaternion derivative using this method. So far, so good. But what then?
Using this method, I can't calculate the derivative in the next point without first knowing the attitude quaternion in that point, say [itex]Q_1[/itex] (I have the angular velocities in each point, as mentioned above). I tried approximating this quaternion by adding the derivative of the previous point times the timestep, as follows (for each quaternion component):
[itex]q_{0,i+1} = q_{0,i} + (t_{i+1} - t_i) \cdot \dot{q}_{0,i}[/itex]
This effectively gives me an attitude quaternion in every point, allowing me to calculate the quaternion derivative in that point (as I have the angular velocities). However, when comparing with reference values for the quaternion components, this method is not at all accurate enough, and does not give reliable results.
This has led me to wonder what the quaternion derivative really is. As I understand it (and as indicated by the document in the link) the quaternion derivative is the rotational velocity equivalent to the Euler angle attitude quaternion, i.e an indicator of how fast the frame is rotating relative an inertial frame at any given time. I have used quaternions in the past and I think I have a pretty good understanding of them, but quaternion differentiation is new to me.
Ideally, I would like to be able to calculate the quaternion derivative in every point based entirely on the angular velocities and initial attitude, without ever having to use attitude quaternions (as they are not reliable when calculated using the equation above). Is there a way to do this?
Intuitively, I think there should be a way. Euler angular velocities should be able to directly yield a corresponding velocity quaternion. Or have I completely misunderstood the problem?I often have trouble putting my questions into words, so I'd be glad to clarify the problem if needed. I tried to find the answer on Google, but most topics seem to relate to 3D programming, without enough "mathematical background" to help me understand the principles.Thanks.
The information I have is a vector of Euler angular velocities (i.e for roll [itex]\phi[/itex], pitch [itex]\theta[/itex] and yaw [itex]\psi[/itex]), with components [itex]\dot{\phi}[/itex], [itex]\dot{\theta}[/itex] and [itex]\dot{\psi}[/itex], for each point along the path. The points correspond to a date/time [itex]t_i[/itex], rather than a spatial location (where [itex]i[/itex] is the index). The angular velocities represent the rotational velocity of the frame relative to an inertial frame at a point with date [itex]t_i[/itex].
The only other piece of information I have is the inital attitude of the frame at time 0, i.e [itex]t_0[/itex], in the form of a quaternion [itex]Q_0[/itex] with components [itex]q_0, q_1, q_2[/itex] and [itex]q_3[/itex]
What I want to do is to calculate the quaternion derivative at every point in time. To do this I am using the method desribed here:
http://www.euclideanspace.com/physics/kinematics/angularvelocity/QuaternionDifferentiation2.pdf
Which works for the first point, because I can create a quaternion of angular velocities and I have the initial quaternion [itex]Q_0[/itex]. I have a ready-made script that allows me to calculate this quaternion derivative using this method. So far, so good. But what then?
Using this method, I can't calculate the derivative in the next point without first knowing the attitude quaternion in that point, say [itex]Q_1[/itex] (I have the angular velocities in each point, as mentioned above). I tried approximating this quaternion by adding the derivative of the previous point times the timestep, as follows (for each quaternion component):
[itex]q_{0,i+1} = q_{0,i} + (t_{i+1} - t_i) \cdot \dot{q}_{0,i}[/itex]
This effectively gives me an attitude quaternion in every point, allowing me to calculate the quaternion derivative in that point (as I have the angular velocities). However, when comparing with reference values for the quaternion components, this method is not at all accurate enough, and does not give reliable results.
This has led me to wonder what the quaternion derivative really is. As I understand it (and as indicated by the document in the link) the quaternion derivative is the rotational velocity equivalent to the Euler angle attitude quaternion, i.e an indicator of how fast the frame is rotating relative an inertial frame at any given time. I have used quaternions in the past and I think I have a pretty good understanding of them, but quaternion differentiation is new to me.
Ideally, I would like to be able to calculate the quaternion derivative in every point based entirely on the angular velocities and initial attitude, without ever having to use attitude quaternions (as they are not reliable when calculated using the equation above). Is there a way to do this?
Intuitively, I think there should be a way. Euler angular velocities should be able to directly yield a corresponding velocity quaternion. Or have I completely misunderstood the problem?I often have trouble putting my questions into words, so I'd be glad to clarify the problem if needed. I tried to find the answer on Google, but most topics seem to relate to 3D programming, without enough "mathematical background" to help me understand the principles.Thanks.
Last edited by a moderator: