47 measured_(0.0, 0.0), K_(new
Cal3_S2(444, 555, 666, 777, 888)) {
61 Base(model, poseKey, landmarkKey), measured_(measured), K_(K), referencePoint_(referencePoint) {}
71 void print(
const std::string&
s =
"InvDepthFactorVariant2",
79 const This *
e =
dynamic_cast<const This*
>(&
p);
83 && this->K_->equals(*e->K_,
tol)
100 return Vector::Ones(2) * 2.0 * K_->fx();
102 return (
Vector(1) << 0.0).finished();
107 boost::optional<Matrix&> H1=boost::none,
108 boost::optional<Matrix&> H2=boost::none)
const override {
111 (*H1) = numericalDerivative11<Vector, Pose3>(
116 (*H2) = numericalDerivative11<Vector, Vector3>(
143 template<
class ARCHIVE>
145 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
146 ar & BOOST_SERIALIZATION_NVP(measured_);
147 ar & BOOST_SERIALIZATION_NVP(K_);
148 ar & BOOST_SERIALIZATION_NVP(referencePoint_);
~InvDepthFactorVariant2() override
bool equals(const NonlinearFactor &f, double tol=1e-9) const override
bool equals(const NonlinearFactor &p, double tol=1e-9) const override
equals
noiseModel::Diagonal::shared_ptr model
Vector inverseDepthError(const Pose3 &pose, const Vector3 &landmark) const
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
Some functions to compute numerical derivatives.
const Cal3_S2::shared_ptr calibration() const
Cal3_S2::shared_ptr K_
shared pointer to calibration object
static const KeyFormatter DefaultKeyFormatter
static Point3 landmark(0, 0, 5)
const Point3 & referencePoint() const
Base class for all pinhole cameras.
EIGEN_DEVICE_FUNC const CosReturnType cos() const
boost::shared_ptr< This > shared_ptr
shorthand for a smart pointer to a factor
Point3 referencePoint_
the reference point/origin for this landmark
static const Pose3 pose(Rot3(Vector3(1,-1,-1).asDiagonal()), Point3(0, 0, 0.5))
Vector evaluateError(const Pose3 &pose, const Vector3 &landmark, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none) const override
Evaluate error h(x)-z and optionally derivatives.
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
const Point2 & imagePoint() const
Point2 measured_
2D measurement
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
Non-linear factor base classes.
friend class boost::serialization::access
Serialization function.
InvDepthFactorVariant2()
Default constructor.
NoiseModelFactor2< Pose3, Vector3 > Base
shorthand for base class type
InvDepthFactorVariant2(const Key poseKey, const Key landmarkKey, const Point2 &measured, const Cal3_S2::shared_ptr &K, const Point3 referencePoint, const SharedNoiseModel &model)
Point2 project(const Point3 &pw, OptionalJacobian< 2, 6 > Dpose=boost::none, OptionalJacobian< 2, 3 > Dpoint=boost::none, OptionalJacobian< 2, DimK > Dcal=boost::none) const
project a 3D point from world coordinates into the image
InvDepthFactorVariant2 This
shorthand for this class
EIGEN_DEVICE_FUNC const SinReturnType sin() const
static const CalibratedCamera camera(kDefaultPose)
boost::shared_ptr< Cal3_S2 > shared_ptr
std::uint64_t Key
Integer nonlinear key type.
void Print(const CONTAINER &keys, const string &s, const KeyFormatter &keyFormatter)
void print(const std::string &s="InvDepthFactorVariant2", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
void serialize(ARCHIVE &ar, const unsigned int)
noiseModel::Base::shared_ptr SharedNoiseModel
The most common 5DOF 3D->2D calibration.
const char * what() const noexceptoverride