From 7dfc79971aa26a203aa9ef0bacb042a3955994b9 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Thu, 9 Jul 2020 11:52:06 -0400 Subject: [PATCH] reduced tolerance for checking jacobian --- gtsam/slam/tests/testSmartFactorBase.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gtsam/slam/tests/testSmartFactorBase.cpp b/gtsam/slam/tests/testSmartFactorBase.cpp index bb04ad56d..fd771f102 100644 --- a/gtsam/slam/tests/testSmartFactorBase.cpp +++ b/gtsam/slam/tests/testSmartFactorBase.cpp @@ -67,9 +67,9 @@ TEST(SmartFactorBase, PinholeWithSensor) { PinholeFactor::Cameras cameras; // Assume body at origin. - Pose3 world_T_body = Pose3(); + Pose3 world_P_body = Pose3(); // Camera coordinates in world frame. - Pose3 wTc = world_T_body * body_P_sensor; + Pose3 wTc = world_P_body * body_P_sensor; cameras.push_back(PinholeCamera(wTc)); // Simple point to project slightly off image center @@ -88,7 +88,9 @@ TEST(SmartFactorBase, PinholeWithSensor) { expectedE << 0.1, 0, 0.01, 0, 0.1, 0; EXPECT(assert_equal(error, expectedError)); - EXPECT(assert_equal(expectedFs, Fs[0])); // We only have the jacobian for the 1 camera + // We only have the jacobian for the 1 camera + // Use of a lower tolerance value due to compiler precision mismatch. + EXPECT(assert_equal(expectedFs, Fs[0], 1e-3)); EXPECT(assert_equal(expectedE, E)); }