mathnet-spatial
mathnet-spatial copied to clipboard
Fix order of YPR transformation
See https://en.wikipedia.org/wiki/Rotation_matrix#General_rotations for correct order of application.
Counterintuitively, the YPR rotations must be applied in reverse order to be correct. The resultant rotation matrix should be Rz(Ry(Rx)) instead of Rx(Ry(Rz)) where z is yaw, y is pitch, and x is roll. This is the correct intrinsic spatial rotation as shown in the Wikipedia link above.
Fixes #180.
For easy verification, an excel file to compute the correct rotation matrix is attached. rotationmatrix.xlsx