LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Euler angles or quaternions to real world angles

Hello,
 
I have a sensor that sends angles (yaw, pitch, roll) as Euler - angles and Quaternions.
Does anyone have a VI to transform them into "real world" - angles?
 
Thank you,
 Joachim
0 Kudos
Message 1 of 5
(6,204 Views)

The algebra of 3D rotations (sometimes called SU(3)) depends very heavily on precise definitions, including the definition of the axes, the order of rotations, whether you rotate the object with respect to a stationary world (axes "fixed" to the world) or fix the axes to the object and rotate about "object axes".  The convention(s) for Euler Angles depends critically on these things -- there are multiple ways to define these angles (6 or 12, depending on how you count), so there is no "simple" answer to your question, and almost certainly no already-written VI to do this (which "this" would it do?).

 

However, once you define your coordinates, order of rotations, and which set of axes (world or object) is the reference frame, it is easy enough to write down the elementary rotation matrix about an "x", "y", and "z" Cartesian axis, multiply the matrices in the "correct" (according to your convention) order, and derive a Rotation Matrix.  It is also relatively easy to go from Rotation Matrix to Quaternion, but, again, you need to understand your conventions.

 

Conclusion -- there is no single answer.  If you need help, first make sure you understand the conventions you are using, then find a physics student who has taken Classical Mechanics, or a good engineering student who has taken Engineering Mathematics (the "difficult" course).

 

Bob Schor

0 Kudos
Message 2 of 5
(6,185 Views)

The LabVIEW Robotics Module have transform that go from Euler to Rotation Matrix (RM) and then, you can transform RM to quaternions. 

 

robotics.png

However, you need to be aware of the issues in using Euler Angles, since there are several ways to represent it. For example, The VI "3D Cartesian Coordinate Rotation (Euler) (Array).vi" under mathermatics >> Geometry uses 'implicit euler conversion", while the one in Robotics uses 'explicit".

 

This tutorial would help you to move to different options: https://en.wikipedia.org/wiki/Euler_angles

 

Then, to transfer your rotation matrix to real-world angles, then you just do a 'base' transformation from that to the world reference, which means to do a 'matrix multiply' with the correct coordinate system.

 

Hope this helps

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 3 of 5
(6,169 Views)

The geometry subpalette (that's hat I typically use) contains VIs for euler rotations and e.g. conversions to directional cosines and back.

 

If you look at the euler rotation, there are 12 order conventions that you can select. You just need to know what you need.

 

In summary, even plain LabVIEW has quite a few tools for 3D rotations, but I am sure that the robotics module mentioned has an even richer set.

0 Kudos
Message 4 of 5
(6,160 Views)

Thank you.

I try my best but without robotics (I don't have the robotics toolkit).

0 Kudos
Message 5 of 5
(6,128 Views)