Danny Hart / Mbed 2 deprecated stepVR2mavlink

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

mavlink_conversions.h File Reference

mavlink_conversions.h File Reference

These conversion functions follow the NASA rotation standards definition file available online. More...

Go to the source code of this file.

Functions

MAVLINK_HELPER void mavlink_quaternion_to_dcm (const float quaternion[4], float dcm[3][3])
 Converts a quaternion to a rotation matrix.
MAVLINK_HELPER void mavlink_euler_to_quaternion (float roll, float pitch, float yaw, float quaternion[4])
 Converts a rotation matrix to euler angles.
MAVLINK_HELPER void mavlink_dcm_to_quaternion (const float dcm[3][3], float quaternion[4])
 Converts a rotation matrix to a quaternion Reference:


MAVLINK_HELPER void mavlink_euler_to_dcm (float roll, float pitch, float yaw, float dcm[3][3])
 Converts euler angles to a rotation matrix.

Detailed Description

These conversion functions follow the NASA rotation standards definition file available online.

Their intent is to lower the barrier for MAVLink adopters to use gimbal-lock free (both rotation matrices, sometimes called DCM, and quaternions are gimbal-lock free) rotation representations. Euler angles (roll, pitch, yaw) will be phased out of the protocol as widely as possible.

Author:
James Goppert
Thomas Gubler <thomasgubler@gmail.com>

Definition in file mavlink_conversions.h.


Function Documentation

MAVLINK_HELPER void mavlink_dcm_to_quaternion ( const float  dcm[3][3],
float  quaternion[4] 
)

Converts a rotation matrix to a quaternion Reference:

Parameters:
dcma 3x3 rotation matrix
quaterniona [w, x, y, z] ordered quaternion (null-rotation being 1 0 0 0)

Definition at line 146 of file mavlink_conversions.h.

MAVLINK_HELPER void mavlink_euler_to_dcm ( float  roll,
float  pitch,
float  yaw,
float  dcm[3][3] 
)

Converts euler angles to a rotation matrix.

Parameters:
rollthe roll angle in radians
pitchthe pitch angle in radians
yawthe yaw angle in radians
dcma 3x3 rotation matrix

Definition at line 189 of file mavlink_conversions.h.

MAVLINK_HELPER void mavlink_euler_to_quaternion ( float  roll,
float  pitch,
float  yaw,
float  quaternion[4] 
)

Converts a rotation matrix to euler angles.

Parameters:
dcma 3x3 rotation matrix
rollthe roll angle in radians
pitchthe pitch angle in radians
yawthe yaw angle in radians Converts a quaternion to euler angles
quaterniona [w, x, y, z] ordered quaternion (null-rotation being 1 0 0 0)
rollthe roll angle in radians
pitchthe pitch angle in radians
yawthe yaw angle in radians Converts euler angles to a quaternion
rollthe roll angle in radians
pitchthe pitch angle in radians
yawthe yaw angle in radians
quaterniona [w, x, y, z] ordered quaternion (null-rotation being 1 0 0 0)

Definition at line 118 of file mavlink_conversions.h.

MAVLINK_HELPER void mavlink_quaternion_to_dcm ( const float  quaternion[4],
float  dcm[3][3] 
)

Converts a quaternion to a rotation matrix.

Parameters:
quaterniona [w, x, y, z] ordered quaternion (null-rotation being 1 0 0 0)
dcma 3x3 rotation matrix

Definition at line 38 of file mavlink_conversions.h.