1

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?

shelper
  • 10,053
  • 8
  • 41
  • 67

1 Answers1

1

To quote the documentation, the range is given:

The returned angles are in the ranges [0:pi]x[-pi:pi]x[-pi:pi].

Avi Ginsburg
  • 10,323
  • 3
  • 29
  • 56
  • I noticed that too, how can i convert it back to the other range? i did some google search and could not find an example code for doing that – shelper May 13 '19 at 17:27
  • Have a look at this "unsupported" module: https://eigen.tuxfamily.org/dox/unsupported/classEigen_1_1EulerAngles.html, it allows for fully customizable conversions. – ggael May 13 '19 at 20:04