I'm using Eigen's eulerAngles
to get the roll, pitch, and yaw angles from a rotation matrix like so:
const Eigen::Vector3f yaw_pitch_roll = rotation.eulerAngles(2, 1, 0);
where rotation
is some valid rotation matrix of type Eigen::Matrix3f
.
What I'm observing: If all three angles are close to zero, i.e. if the rotation matrix is close to the identity, some or all three resulting angles are sometimes off by Pi, i.e. by 180 degrees.
This may happen with certain other rotations as well, but I've only observed it close to the identity so far.
- Can I avoid this somehow?
- What other angles apart from (0, 0, 0) might be singular points?