Base: [skip ci] handle gimbal lock when computing Euler angles

This commit is contained in:
wmayer
2021-10-27 17:02:07 +02:00
parent 16c08ec96f
commit b803d987b9

View File

@@ -683,7 +683,7 @@ void Rotation::getYawPitchRoll(double& y, double& p, double& r) const
// south pole
y = 0.0;
p = -D_PI/2.0;
r = -2.0 * atan2(quat[0],quat[3]);
r = 2.0 * atan2(quat[0],quat[3]);
}
else {
y = atan2(2.0*(q01+q23),(q00+q33)-(q11+q22));