26 template<
class POSE,
class LANDMARK,
class INVDEPTH>
32 boost::shared_ptr<Cal3_S2>
K_;
47 measured_(0.0, 0.0), K_(new
Cal3_S2(444, 555, 666, 777, 888)) {
62 Base(model, poseKey, pointKey, invDepthKey), measured_(measured), K_(K) {}
72 void print(
const std::string&
s =
"InvDepthFactor3",
80 const This *
e =
dynamic_cast<const This*
>(&
p);
86 boost::optional<Matrix&> H1=boost::none,
87 boost::optional<Matrix&> H2=boost::none,
88 boost::optional<Matrix&> H3=boost::none)
const override {
93 if (H1) *H1 = Matrix::Zero(2,6);
94 if (H2) *H2 = Matrix::Zero(2,5);
95 if (H3) *H2 = Matrix::Zero(2,1);
98 return Vector::Ones(2) * 2.0 * K_->fx();
100 return (
Vector(1) << 0.0).finished();
117 template<
class ARCHIVE>
119 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
120 ar & BOOST_SERIALIZATION_NVP(measured_);
121 ar & BOOST_SERIALIZATION_NVP(K_);
NoiseModelFactor3< POSE, LANDMARK, INVDEPTH > Base
shorthand for base class type
boost::shared_ptr< Cal3_S2 > K_
shared pointer to calibration object
bool equals(const NonlinearFactor &f, double tol=1e-9) const override
Vector evaluateError(const POSE &pose, const Vector5 &point, const INVDEPTH &invDepth, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none, boost::optional< Matrix & > H3=boost::none) const override
Evaluate error h(x)-z and optionally derivatives.
noiseModel::Diagonal::shared_ptr model
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
boost::shared_ptr< This > shared_ptr
shorthand for a smart pointer to a factor
void serialize(ARCHIVE &ar, const unsigned int)
static const KeyFormatter DefaultKeyFormatter
const gtsam::Key pointKey
const Cal3_S2::shared_ptr calibration() const
bool equals(const NonlinearFactor &p, double tol=1e-9) const override
equals
gtsam::Point2 project(const Vector5 &pw, double rho, boost::optional< gtsam::Matrix & > H1=boost::none, boost::optional< gtsam::Matrix & > H2=boost::none, boost::optional< gtsam::Matrix & > H3=boost::none) const
static const Pose3 pose(Rot3(Vector3(1,-1,-1).asDiagonal()), Point3(0, 0, 0.5))
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Inverse Depth Camera based on Civera09tro, Montiel06rss. Landmarks are initialized from the first cam...
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Point2 measured_
2D measurement
friend class boost::serialization::access
Serialization function.
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
Non-linear factor base classes.
const Point2 & imagePoint() const
void print(const std::string &s="InvDepthFactor3", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
InvDepthFactor3< POSE, LANDMARK, INVDEPTH > This
shorthand for this class
static const CalibratedCamera camera(kDefaultPose)
boost::shared_ptr< Cal3_S2 > shared_ptr
InvDepthFactor3(const Point2 &measured, const SharedNoiseModel &model, const Key poseKey, Key pointKey, Key invDepthKey, const Cal3_S2::shared_ptr &K)
std::uint64_t Key
Integer nonlinear key type.
void Print(const CONTAINER &keys, const string &s, const KeyFormatter &keyFormatter)
InvDepthFactor3()
Default constructor.
~InvDepthFactor3() override
noiseModel::Base::shared_ptr SharedNoiseModel
The most common 5DOF 3D->2D calibration.
const char * what() const noexceptoverride