mathnet-spatial icon indicating copy to clipboard operation
mathnet-spatial copied to clipboard

Fix order of YPR transformation

Open jakehedlund opened this issue 4 years ago • 0 comments

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

jakehedlund avatar Apr 04 '22 19:04 jakehedlund