Convert a homogeneous transform to roll-pitch-yaw angles
RPY = tr2rpy(T, options) RPY = tr2rpy(R, options)
RPY = TR2RPY(T, options) are the roll-pitch-yaw angles expressed as a row vector corresponding to the rotation part of a homogeneous transform T. The 3 angles RPY=[R,P,Y] correspond to sequential rotations about the X, Y and Z axes respectively.
RPY = TR2RPY(R, options) are the roll-pitch-yaw angles expressed as a row vector corresponding to the orthonormal rotation matrix R.
If R or T represents a trajectory (has 3 dimensions), then each row of RPY corresponds to a step of the trajectory.
Compute angles in degrees (radians default)
Return solution for sequential rotations about Z, Y, X axes (Paul book)
There is a singularity for the case where P=pi/2 in which case R is arbitrarily set to zero and Y is the sum (R+Y).
Note that textbooks (Paul, Spong) use the rotation order ZYX.