mav_matrixRPYGet - Query rotation terms of matrix.

[ Maverik Level 1 functions ]

#

mav_matrixRPYGet

## Summary

Query rotation terms of matrix.

## Syntax

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

- 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.

Back to the index page.