Quaternions for Rotations in Native LabVIEW

Tags: LabVIEW, Raleigh

Suppose you find yourself needing to rotate a point in three-dimensional space about an arbitrary axis. This problem comes up frequently in robotic kinematics, for example. You can use Euler angles and rotation matrices. However, this approach, while computationally efficient, has a few drawbacks. One is that it is not particularly easy to invert. Another is gimbal lock. Quaternion rotations do not suffer from either of these drawbacks. While quaternions are not quite as computationally efficient as rotation matrices, modern computer hardware makes this drawback less important for most applications.

I will not here explain quaternions and their usefulness in computing rotations, as the Wikipedia articles cover that adequately.[1] Instead, I would like to point out that, while National Instruments implements quaternions, they are hidden inside the Robotics Module, which is not included with LabVIEW. With the exception of the Generate Random Quaternion function, I have written a similar library in the downloadable .lvlib file below. It includes the standard basic four arithmetic functions, the spherical linear interpolation function (SLERP), and rotation about an arbitrary axis. It is written in LabVIEW 2015 SP1. I hope it will prove useful to you!

Download Library

[1] See https://en.wikipedia.org/wiki/Quaternion and https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation.

About Genuen

Genuen partners with innovative manufacturing companies to improve time to market while ensuring the highest product quality and safety standards. Genuen offers test and production automation solutions across the entire product lifecycle. With extensive experience in mission-critical applications and regulatory compliance Genuen delivers custom test systems, hardware-in-the-loop (HIL) simulation, hydraulic test, dynamometer test, test platform development, and production robotics automation and control development. Headquartered in the Kansas City, KS area, Genuen has offices and facilities across the United States and serves clients in multiple industries including aerospace, medical device, automotive, transportation and national security. The company's Quality Management System (QMS) is certified to ISO 9001.