26 template<
class POSE,
class LANDMARK,
class INVDEPTH>
32 std::shared_ptr<Cal3_S2>
K_;
37 typedef NoiseModelFactor3<POSE, LANDMARK, INVDEPTH>
Base;
40 using Base::evaluateError;
50 measured_(0.0, 0.0), K_(new
Cal3_S2(444, 555, 666, 777, 888)) {
65 Base(model, poseKey, pointKey, invDepthKey), measured_(measured), K_(K) {}
75 void print(
const std::string&
s =
"InvDepthFactor3",
83 const This *
e =
dynamic_cast<const This*
>(&
p);
94 if (H1) *H1 = Matrix::Zero(2,6);
95 if (H2) *H2 = Matrix::Zero(2,5);
96 if (H3) *H3 = Matrix::Zero(2,1);
99 return Vector::Ones(2) * 2.0 * K_->fx();
101 return (
Vector(1) << 0.0).finished();
116 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 117 friend class boost::serialization::access; 119 template<
class ARCHIVE>
120 void serialize(ARCHIVE & ar,
const unsigned int ) {
121 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
122 ar & BOOST_SERIALIZATION_NVP(measured_);
123 ar & BOOST_SERIALIZATION_NVP(K_);
NoiseModelFactor3< POSE, LANDMARK, INVDEPTH > Base
shorthand for base class type
const Point2 & imagePoint() const
std::string serialize(const T &input)
serializes to a string
noiseModel::Diagonal::shared_ptr model
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
EIGEN_STRONG_INLINE Packet4f print(const Packet4f &a)
static const KeyFormatter DefaultKeyFormatter
const gtsam::Key pointKey
bool equals(const NonlinearFactor &p, double tol=1e-9) const override
equals
Matrix * OptionalMatrixType
std::shared_ptr< Cal3_S2 > shared_ptr
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
The most common 5DOF 3D->2D calibration.
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
std::shared_ptr< This > shared_ptr
shorthand for a smart pointer to a factor
gtsam::Point2 project(const Vector5 &pw, double rho, OptionalJacobian< 2, 6 > H1={}, OptionalJacobian< 2, 5 > H2={}, OptionalJacobian< 2, 1 > H3={}) const
static const Pose3 pose(Rot3(Vector3(1, -1, -1).asDiagonal()), Point3(0, 0, 0.5))
Non-linear factor base classes.
std::shared_ptr< Cal3_S2 > K_
shared pointer to calibration object
void print(const std::string &s="InvDepthFactor3", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
InvDepthFactor3< POSE, LANDMARK, INVDEPTH > This
shorthand for this class
const Cal3_S2::shared_ptr calibration() const
static const CalibratedCamera camera(kDefaultPose)
Vector evaluateError(const POSE &pose, const Vector5 &point, const INVDEPTH &invDepth, OptionalMatrixType H1, OptionalMatrixType H2, OptionalMatrixType H3) const override
Evaluate error h(x)-z and optionally derivatives.
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 noexcept override