This seems to work perfectly (compiles, at least)
parent
ec93e0a885
commit
a6b4823203
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
#include <gtsam/base/DerivedValue.h>
|
#include <gtsam/base/DerivedValue.h>
|
||||||
#include <gtsam/geometry/Point2.h>
|
#include <gtsam/geometry/Point2.h>
|
||||||
|
#include <boost/optional.hpp>
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
|
||||||
|
@ -57,6 +58,11 @@ public:
|
||||||
empty_(true), map_(NULL) {
|
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
|
/// Constructor that will usurp data of a fixed size matrix
|
||||||
FixedRef(Fixed& fixed) :
|
FixedRef(Fixed& fixed) :
|
||||||
empty_(false), map_(NULL) {
|
empty_(false), map_(NULL) {
|
||||||
|
|
|
@ -381,13 +381,7 @@ public:
|
||||||
}
|
}
|
||||||
return pi;
|
return pi;
|
||||||
} else
|
} else
|
||||||
if (Dcal) {
|
return K_.uncalibrate(pn, Dcal);
|
||||||
JacobianK fixedDcal;
|
|
||||||
const Point2 pi = K_.uncalibrate(pn, fixedDcal);
|
|
||||||
*Dcal = fixedDcal;
|
|
||||||
return pi;
|
|
||||||
} else
|
|
||||||
return K_.uncalibrate(pn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** project a point at infinity from world coordinate to the image
|
/** project a point at infinity from world coordinate to the image
|
||||||
|
@ -400,7 +394,7 @@ public:
|
||||||
const Point3& pw, //
|
const Point3& pw, //
|
||||||
boost::optional<Matrix&> Dpose = boost::none,
|
boost::optional<Matrix&> Dpose = boost::none,
|
||||||
boost::optional<Matrix&> Dpoint = boost::none,
|
boost::optional<Matrix&> Dpoint = boost::none,
|
||||||
boost::optional<Matrix25&> Dcal = boost::none) const {
|
boost::optional<Matrix&> Dcal = boost::none) const {
|
||||||
|
|
||||||
if (!Dpose && !Dpoint && !Dcal) {
|
if (!Dpose && !Dpoint && !Dcal) {
|
||||||
const Point3 pc = pose_.rotation().unrotate(pw); // get direction in camera frame (translation does not matter)
|
const Point3 pc = pose_.rotation().unrotate(pw); // get direction in camera frame (translation does not matter)
|
||||||
|
|
Loading…
Reference in New Issue