From 7c1a795cb461a15a89a3e704273effcfaf87f336 Mon Sep 17 00:00:00 2001 From: dellaert Date: Thu, 19 Feb 2015 10:54:25 +0100 Subject: [PATCH] Fixed bug in dim (it should be #rows not #columns!) and moved to base class --- gtsam/slam/SmartFactorBase.h | 11 +++++++---- gtsam/slam/SmartProjectionPoseFactor.h | 5 ----- gtsam_unstable/slam/SmartStereoProjectionPoseFactor.h | 5 ----- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/gtsam/slam/SmartFactorBase.h b/gtsam/slam/SmartFactorBase.h index f9f1c6e2b..ec5bed1b0 100644 --- a/gtsam/slam/SmartFactorBase.h +++ b/gtsam/slam/SmartFactorBase.h @@ -25,10 +25,8 @@ #include #include -#include // for Cheirality exception -#include -#include -#include +#include +#include // for Cheirality exception #include #include @@ -150,6 +148,11 @@ public: } } + /// get the dimension (number of rows!) of the factor + virtual size_t dim() const { + return ZDim * this->measured_.size(); + } + /** return the measurements */ const std::vector& measured() const { return measured_; diff --git a/gtsam/slam/SmartProjectionPoseFactor.h b/gtsam/slam/SmartProjectionPoseFactor.h index 0801d141f..ac0951e87 100644 --- a/gtsam/slam/SmartProjectionPoseFactor.h +++ b/gtsam/slam/SmartProjectionPoseFactor.h @@ -141,11 +141,6 @@ public: return e && Base::equals(p, tol); } - /// get the dimension of the factor - virtual size_t dim() const { - return 6 * this->keys_.size(); - } - /** * Collect all cameras involved in this factor * @param values Values structure which must contain camera poses corresponding diff --git a/gtsam_unstable/slam/SmartStereoProjectionPoseFactor.h b/gtsam_unstable/slam/SmartStereoProjectionPoseFactor.h index 2e3bc866b..6a6d55988 100644 --- a/gtsam_unstable/slam/SmartStereoProjectionPoseFactor.h +++ b/gtsam_unstable/slam/SmartStereoProjectionPoseFactor.h @@ -143,11 +143,6 @@ public: return e && Base::equals(p, tol); } - /// get the dimension of the factor - virtual size_t dim() const { - return 6 * this->keys_.size(); - } - /** * Collect all cameras involved in this factor * @param values Values structure which must contain camera poses corresponding