From 265bd1972dffadf02b54ebe9be755dbd789c5a36 Mon Sep 17 00:00:00 2001 From: cbeall3 Date: Thu, 23 Oct 2014 17:08:30 -0400 Subject: [PATCH] Fix for flipped sign in quaternion mode on Linux and Windows --- gtsam/geometry/tests/testRot3.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gtsam/geometry/tests/testRot3.cpp b/gtsam/geometry/tests/testRot3.cpp index 2bc4c58f0..ca1e2220c 100644 --- a/gtsam/geometry/tests/testRot3.cpp +++ b/gtsam/geometry/tests/testRot3.cpp @@ -179,7 +179,15 @@ TEST(Rot3, log) CHECK_OMEGA( PI, 0, 0) CHECK_OMEGA( 0, PI, 0) CHECK_OMEGA( 0, 0, PI) + + // Windows and Linux have flipped sign in quaternion mode +#if !defined(__APPLE__) && defined (GTSAM_USE_QUATERNIONS) + w = (Vector(3) << x*PI, y*PI, z*PI); + R = Rot3::rodriguez(w); + EXPECT(assert_equal(Vector(-w), Rot3::Logmap(R),1e-12)); +#else CHECK_OMEGA(x*PI,y*PI,z*PI) +#endif // Check 360 degree rotations #define CHECK_OMEGA_ZERO(X,Y,Z) \