I am using quaternion
in Eigens to calculate ZYX
euler angles by:
quaternion.toRotationMatrix().eulerAngles(2, 1, 0);
But I found the values can occasionally flip between a very small number and a number very close to PI
. I roughly understand why this happens, and the range of euler angle beta
could be [0, π] or [−π/2, π/2]. But I couldn't find any way to use the second range in Eigen.
Is there a way in Eigen
to do that conversion?