From b159144e130f786202b80f8e1b5b8b0f9c923334 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 27 Oct 2021 17:02:07 +0200 Subject: [PATCH] Base: [skip ci] handle gimbal lock when computing Euler angles --- src/Base/Rotation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Base/Rotation.cpp b/src/Base/Rotation.cpp index 646731561d02..67a6e5d52596 100644 --- a/src/Base/Rotation.cpp +++ b/src/Base/Rotation.cpp @@ -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));