Direction Cosine Matrix#

Unit DCM matrix related routines.

Functions#

void
sl_imu_dcm_reset(float dcm[3][3])

Set the elements of the DCM matrix to the corresponding elements of the identity matrix.

void
sl_imu_dcm_reset_z(float dcm[3][3])

DCM reset, Z direction.

void
sl_imu_dcm_normalize(float dcm[3][3])

Normalize the DCM matrix.

void
sl_imu_dcm_rotate(float dcm[3][3], float ang[3])

Rotate the DCM matrix by a given angle.

void
sl_imu_dcm_get_angles(float dcm[3][3], float ang[3])

Calculate the Euler angles (roll, pitch, yaw) from the DCM matrix.

Function Documentation#

sl_imu_dcm_reset#

void sl_imu_dcm_reset (float dcm)

Set the elements of the DCM matrix to the corresponding elements of the identity matrix.

Parameters
TypeDirectionArgument NameDescription
floatN/Adcm

DCM matrix


sl_imu_dcm_reset_z#

void sl_imu_dcm_reset_z (float dcm)

DCM reset, Z direction.

Parameters
TypeDirectionArgument NameDescription
floatN/Adcm

DCM matrix


sl_imu_dcm_normalize#

void sl_imu_dcm_normalize (float dcm)

Normalize the DCM matrix.

Parameters
TypeDirectionArgument NameDescription
floatN/Adcm

DCM matrix


sl_imu_dcm_rotate#

void sl_imu_dcm_rotate (float dcm, float ang)

Rotate the DCM matrix by a given angle.

Parameters
TypeDirectionArgument NameDescription
float[inout]dcm

DCM matrix

float[in]ang

Rotation angle


sl_imu_dcm_get_angles#

void sl_imu_dcm_get_angles (float dcm, float ang)

Calculate the Euler angles (roll, pitch, yaw) from the DCM matrix.

Parameters
TypeDirectionArgument NameDescription
float[in]dcm

DCM matrix

float[out]ang

An array containing the Euler angles