Why is the Euler Output of the Quaternion Block different than the Euler Angles block in the Aerospace Blockset?
2 views (last 30 days)
Show older comments
MathWorks Support Team
on 27 Jun 2009
Answered: James Tursa
on 9 May 2020
Why is the Euler Output of the Quaternion Block different than the Euler Angles block in the Aerospace Blockset?
In my model, both the blocks are fed by the same Forces and Moments, however the Euler output of the blocks is different.
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
Yes, the output Euler of the 'Euler Angles' block is different than the output Euler of the 'Quaternions' block, especially the Pitch (Theta) component of Euler. Theta, from the Quaternion block, is actually limited in range from [-90, +90] degrees.
The difference occurs because of the way the Quaternions block determines the Pitch angle. If you look under the mask, you will see that the Quaternions block calculates the four parameters (e0,e1,e2,e3). These four quaternions are then converted into euler angles. The euler angle Theta (pitch) is caluclated by
theta = asin(e1*e3-e2*e0)
Where 'asin' is a MATLAB function which gives the arc sin or the sin inverse. The range of this function is [-pi/2, pi/2] radians. That is why you see the theta limited in a range from [-90 +90] degrees.
Therefore, the way in which you visualize the output pitch is diffferent.
0 Comments
More Answers (1)
James Tursa
on 9 May 2020
On a related note, the Aerospace Toolbox uses a different quaternion convention than the Robotics Toolbox. One is basically the conjugate of the other. The Aerospace Toolbox quaternion convention seems to be geared more towards quaternions used for coordinate system transformations, and the Robotics Toolbox quaternion convention seems to be geared more towards quaternions used for active vector rotations ... i.e., rotating a vector within the same frame. As a result, you will not see consistency between these two toolboxes ... often one result is opposite of the other. For more discussion on this see these links:
0 Comments
See Also
Categories
Find more on Unit Conversions in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!