From d7b5156dcc12dcdf31b32e68f7611bc75c44d1e6 Mon Sep 17 00:00:00 2001 From: dellaert Date: Wed, 25 Feb 2015 01:14:36 +0100 Subject: [PATCH] rename to reprojectionErrorAfterTriangulation --- gtsam/slam/SmartProjectionFactor.h | 10 ++-------- gtsam/slam/tests/testSmartProjectionCameraFactor.cpp | 4 +++- gtsam_unstable/slam/SmartStereoProjectionFactor.h | 4 ++-- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/gtsam/slam/SmartProjectionFactor.h b/gtsam/slam/SmartProjectionFactor.h index 3a996918f..2f4da3ce6 100644 --- a/gtsam/slam/SmartProjectionFactor.h +++ b/gtsam/slam/SmartProjectionFactor.h @@ -571,17 +571,11 @@ public: } /// Calculate vector of re-projection errors, before applying noise model - /// Assumes triangulation was done and degeneracy handled - Vector reprojectionError(const Cameras& cameras) const { - return cameras.reprojectionError(point_,this->measured_); - } - - /// Calculate vector of re-projection errors, before applying noise model - Vector reprojectionError(const Values& values) const { + Vector reprojectionErrorAfterTriangulation(const Values& values) const { Cameras cameras; bool nonDegenerate = computeCamerasAndTriangulate(values, cameras); if (nonDegenerate) - return reprojectionError(cameras); + return Base::reprojectionError(cameras, point_); else return zero(cameras.size() * 2); } diff --git a/gtsam/slam/tests/testSmartProjectionCameraFactor.cpp b/gtsam/slam/tests/testSmartProjectionCameraFactor.cpp index 3ac95f7e2..f82073e81 100644 --- a/gtsam/slam/tests/testSmartProjectionCameraFactor.cpp +++ b/gtsam/slam/tests/testSmartProjectionCameraFactor.cpp @@ -136,7 +136,9 @@ TEST( SmartProjectionCameraFactor, noiseless ) { double expectedError = 0.0; DOUBLES_EQUAL(expectedError, factor1->error(values), 1e-7); - CHECK(assert_equal(zero(4), factor1->reprojectionError(values), 1e-7)); + CHECK( + assert_equal(zero(4), + factor1->reprojectionErrorAfterTriangulation(values), 1e-7)); } /* *************************************************************************/ diff --git a/gtsam_unstable/slam/SmartStereoProjectionFactor.h b/gtsam_unstable/slam/SmartStereoProjectionFactor.h index 04383839f..337bf2f68 100644 --- a/gtsam_unstable/slam/SmartStereoProjectionFactor.h +++ b/gtsam_unstable/slam/SmartStereoProjectionFactor.h @@ -625,11 +625,11 @@ public: } /// Calculate vector of re-projection errors, before applying noise model - Vector reprojectionError(const Values& values) const { + Vector reprojectionErrorAfterTriangulation(const Values& values) const { Cameras cameras; bool nonDegenerate = computeCamerasAndTriangulate(values, cameras); if (nonDegenerate) - return cameras.reprojectionError(point_); + return Base::reprojectionError(cameras, point_); else return zero(cameras.size() * 3); }