mav_matrixRPYGet(3)

NAME
mav_matrixRPYGet - Query rotation terms of matrix.

LEVEL
Maverik Level 1

SYNTAX
void mav_matrixRPYGet(MAV_matrix m, float *r, float *p, float *y);

ARGUMENTS

MAV_matrix m
    Matrix to query.

float *r
    Roll in degrees.

float *p
    Pitch in degrees.

float *y
    Yaw in degrees.

DESCRIPTION
This function returns in r, p and y, the roll, pitch and yaw specifed by the rotation elements of matrix m. m must be of unit scale.

The conversion from an orientation matrix to a set of roll, pitch and yaw values is inherently ill-defined. That is to say there are multiple sets of RPY values which describe a given orientation - there is no one-to-one mapping. For example, a RPY of (0, 0, 145) is mathematically identical to one of (180, 180, 35) in that they both give the same orientation.

mav_matrixRPYGet returns just one of the many possible RPY values which can describe a given orientation. This may or may not be the most "intuitive" set.

If you use all three RPY values together there should not be a problem. What you cant do is modify one of the values in isolation and expect to get sensible behaviour.