PX4 Firmware
PX4 Autopilot Software http://px4.io
Quaternion.hpp File Reference

All rotations and axis systems follow the right-hand rule. More...

#include "math.hpp"
Include dependency graph for Quaternion.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  matrix::Dcm< Type >
 Direction cosine matrix class. More...
 
class  matrix::Euler< Type >
 Euler angles class. More...
 
class  matrix::AxisAngle< Type >
 AxisAngle class. More...
 
class  matrix::Quaternion< Type >
 Quaternion class. More...
 

Namespaces

 matrix
 

Typedefs

typedef Quaternion< float > matrix::Quatf
 
typedef Quaternion< float > matrix::Quaternionf
 

Detailed Description

All rotations and axis systems follow the right-hand rule.

The Hamilton quaternion convention including its product definition is used.

In order to rotate a vector in frame b (v_b) to frame n by a righthand rotation defined by the quaternion q_nb (from frame b to n) one can use the following operation: v_n = q_nb * [0;v_b] * q_nb^(-1)

Just like DCM's: v_n = C_nb * v_b (vector rotation) M_n = C_nb * M_b * C_nb^(-1) (matrix rotation)

or similarly the reverse operation v_b = q_nb^(-1) * [0;v_n] * q_nb

where q_nb^(-1) represents the inverse of the quaternion q_nb^(-1) = q_bn

The product z of two quaternions z = q2 * q1 represents an intrinsic rotation in the order of first q1 followed by q2. The first element of the quaternion represents the real part, thus, a quaternion representing a zero-rotation is defined as (1,0,0,0).

Author
James Goppert james.nosp@m..gop.nosp@m.pert@.nosp@m.gmai.nosp@m.l.com

Definition in file Quaternion.hpp.