05-06-2016 05:43 AM
05-06-2016 07:44 AM
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
05-06-2016 09:41 AM
The LabVIEW Robotics Module have transform that go from Euler to Rotation Matrix (RM) and then, you can transform RM to quaternions.
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
05-06-2016 10:41 AM
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.
05-07-2016 01:28 PM
Thank you.
I try my best but without robotics (I don't have the robotics toolkit).