From a6b4823203c8dffd30aaf7163a5ea923ba811bfe Mon Sep 17 00:00:00 2001 From: dellaert Date: Thu, 27 Nov 2014 22:50:37 +0100 Subject: [PATCH] This seems to work perfectly (compiles, at least) --- gtsam/geometry/Cal3_S2.h | 6 ++++++ gtsam/geometry/PinholeCamera.h | 10 ++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gtsam/geometry/Cal3_S2.h b/gtsam/geometry/Cal3_S2.h index 693e1dca8..b8f10fccb 100644 --- a/gtsam/geometry/Cal3_S2.h +++ b/gtsam/geometry/Cal3_S2.h @@ -23,6 +23,7 @@ #include #include +#include namespace gtsam { @@ -57,6 +58,11 @@ public: empty_(true), map_(NULL) { } + /// Defdault constructo acts like boost::none + FixedRef(boost::none_t none) : + empty_(true), map_(NULL) { + } + /// Constructor that will usurp data of a fixed size matrix FixedRef(Fixed& fixed) : empty_(false), map_(NULL) { diff --git a/gtsam/geometry/PinholeCamera.h b/gtsam/geometry/PinholeCamera.h index 3ef6b8c11..ad0c8d659 100644 --- a/gtsam/geometry/PinholeCamera.h +++ b/gtsam/geometry/PinholeCamera.h @@ -381,13 +381,7 @@ public: } return pi; } else - if (Dcal) { - JacobianK fixedDcal; - const Point2 pi = K_.uncalibrate(pn, fixedDcal); - *Dcal = fixedDcal; - return pi; - } else - return K_.uncalibrate(pn); + return K_.uncalibrate(pn, Dcal); } /** project a point at infinity from world coordinate to the image @@ -400,7 +394,7 @@ public: const Point3& pw, // boost::optional Dpose = boost::none, boost::optional Dpoint = boost::none, - boost::optional Dcal = boost::none) const { + boost::optional Dcal = boost::none) const { if (!Dpose && !Dpoint && !Dcal) { const Point3 pc = pose_.rotation().unrotate(pw); // get direction in camera frame (translation does not matter)