Retrieve Roll and Pitch rotation

36 Views Asked by At

I need to retrieve Roll and Pitch (but not Yaw) rotation values from rotation matrix (or euler angles, or quaternion, input can be different, fortunately, it can be converted from one form to another).

[Info table]
  • X points Left.
  • Y points Up.
  • Z points Forward.
  • Rotation around local X axis is Pitch.
  • Rotation around local Y axis is Yaw.
  • Rotation around local Z axis is Roll.

If I just use Euler Angles then, in some situations, I get wrong values.

As I think, this due to rotation can be represented with multiple variations of Euler Angles, so it breaks when rotation around X axis (Pitch) and Z axis (Roll) is represented also using Y axis (Yaw).

gif

(How it works | How it should be, but I need rotation without Yaw axis)

Also algorithm is running in time, so, solutions, computing some delta rotation, are also accepted.