Is there any known issue regarding conversion from quaternion to axis angle in Eigen?

Summary

Is there any known issue regarding conversion from quaternion to axis angle in Eigen?

Environment

  • Operating System : Linux
  • Architecture : x64
  • Eigen Version : 3.4.0
  • Compiler Version : Gcc 11.4.0

Minimal Example

Here's an example:

  • quaternion: x=0.5, y=0.5, z=-0.5, w=-0.5
  • axis-angle I get from this website (https://www.andre-gaschler.com/rotationconverter/): [ 0.5773503, 0.5773503, -0.5773503 ], 4.1887902
  • axis-angle I get from Eigen (code below) [-0.5773503, -0.5773503,, 0.5773503], 2.094395 I found that if I implement a conversion function manually instead of using Eigen according to definition I get a different result from Eigen that matches the website
  double qx = 0.5, qy = 0.5, qz = -0.5, qw = -0.5;
  Eigen::Quaterniond q_eigen(qw, qx, qy, qz);
  Eigen::AngleAxisd angleaxis(q_eigen);
  std::cout << "x: " <<  angleaxis.axis().x() << std::endl;
  std::cout << "y: " <<  angleaxis.axis().y() << std::endl;
  std::cout << "z: " <<  angleaxis.axis().z() << std::endl;
  std::cout << "angle: " <<  angleaxis.angle() << std::endl;
Edited by Fifty Five