tr2rpy
Convert SO(3) or SE(3) matrix to roll-pitch-yaw angles
RPY = TR2RPY(T, options)
are the roll-pitch-yaw angles (1×3) corresponding to the rotation part of a homogeneous transform T
. The 3 angles RPY
=[ROLL,PITCH,YAW] correspond to sequential rotations about the Z, Y and X axes respectively. Roll and yaw angles are in [-pi,pi) while pitch angle is in [-pi/2,pi/2).
RPY = TR2RPY(R, options)
as above but the input is an orthonormal rotation matrix R
(3×3).
If R
(3×3× K) or T
(4×4× K) represent a sequence then each row of RPY
corresponds to a step of the sequence.
Options
'deg' | Compute angles in degrees (radians default) |
'xyz' | Return solution for sequential rotations about X, Y, Z axes |
'zyx' | Return solution for sequential rotations about Z, Y, X axes (default) |
'yxz' | Return solution for sequential rotations about Y, X, Z axes |
'arm' | Return solution for sequential rotations about X, Y, Z axes |
'vehicle' | Return solution for sequential rotations about Z, Y, X axes |
'camera' | Return solution for sequential rotations about Y, X, Z axes |
Notes
- There is a singularity for the case where PITCH=pi/2 in which case ROLL is arbitrarily set to zero and YAW is the sum (ROLL+YAW).
- Translation component is ignored.
- Toolbox rel 8-9 has XYZ angle sequence as default.
- ‘arm’, ‘vehicle’, ‘camera’ are synonyms for ‘xyz’, ‘zyx’ and ‘yxz’ respectively.
- these solutions are generated by symbolic/rpygen.mlx