45 measured_(0.0, 0.0), K_(new
Cal3_S2(444, 555, 666, 777, 888)) {
60 Base(model, poseKey, landmarkKey), measured_(measured), K_(K) {}
70 void print(
const std::string&
s =
"InvDepthFactorVariant3a",
78 const This *
e =
dynamic_cast<const This*
>(&
p);
82 && 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 {
134 template<
class ARCHIVE>
136 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
137 ar & BOOST_SERIALIZATION_NVP(measured_);
138 ar & BOOST_SERIALIZATION_NVP(K_);
165 measured_(0.0, 0.0), K_(new
Cal3_S2(444, 555, 666, 777, 888)) {
180 Base(model, poseKey1, poseKey2, landmarkKey), measured_(measured), K_(K) {}
190 void print(
const std::string&
s =
"InvDepthFactorVariant3",
198 const This *
e =
dynamic_cast<const This*
>(&
p);
202 && this->K_->equals(*e->K_,
tol);
216 std::cout << e.
what()
220 return Vector::Ones(2) * 2.0 * K_->fx();
222 return (
Vector(1) << 0.0).finished();
227 boost::optional<Matrix&> H1=boost::none,
228 boost::optional<Matrix&> H2=boost::none,
229 boost::optional<Matrix&> H3=boost::none)
const override {
256 friend class boost::serialization::access;
257 template<
class ARCHIVE>
259 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
260 ar & BOOST_SERIALIZATION_NVP(measured_);
261 ar & BOOST_SERIALIZATION_NVP(K_);
Vector inverseDepthError(const Pose3 &pose, const Vector3 &landmark) const
InvDepthFactorVariant3b This
shorthand for this class
void serialize(ARCHIVE &ar, const unsigned int)
bool equals(const NonlinearFactor &f, double tol=1e-9) const override
noiseModel::Diagonal::shared_ptr model
InvDepthFactorVariant3a This
shorthand for this class
bool equals(const NonlinearFactor &p, double tol=1e-9) const override
equals
const Point2 & imagePoint() const
void print(const std::string &s="InvDepthFactorVariant3a", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
InvDepthFactorVariant3a()
Default constructor.
Some functions to compute numerical derivatives.
InvDepthFactorVariant3a(const Key poseKey, const Key landmarkKey, const Point2 &measured, const Cal3_S2::shared_ptr &K, const SharedNoiseModel &model)
Vector evaluateError(const Pose3 &pose1, const Pose3 &pose2, const Vector3 &landmark, 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.
static const KeyFormatter DefaultKeyFormatter
bool equals(const NonlinearFactor &p, double tol=1e-9) const override
equals
const Cal3_S2::shared_ptr calibration() const
const Point2 & imagePoint() const
static Point3 landmark(0, 0, 5)
Vector inverseDepthError(const Pose3 &pose1, const Pose3 &pose2, const Vector3 &landmark) const
Base class for all pinhole cameras.
EIGEN_DEVICE_FUNC const CosReturnType cos() const
Point3 transformFrom(const Point3 &point, OptionalJacobian< 3, 6 > Hself=boost::none, OptionalJacobian< 3, 3 > Hpoint=boost::none) const
takes point in Pose coordinates and transforms it to world coordinates
~InvDepthFactorVariant3b() override
const Cal3_S2::shared_ptr calibration() const
void serialize(ARCHIVE &ar, const unsigned int)
static const Pose3 pose(Rot3(Vector3(1,-1,-1).asDiagonal()), Point3(0, 0, 0.5))
InvDepthFactorVariant3b()
Default constructor.
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.)
NoiseModelFactor3< Pose3, Pose3, Vector3 > Base
shorthand for base class type
static const Pose3 pose1(Rot3(), Point3(0, 1, 0.5))
Point2 measured_
2D measurement
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
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.
Non-linear factor base classes.
const Symbol key3('v', 3)
friend class boost::serialization::access
Serialization function.
Point2 measured_
2D measurement
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
EIGEN_DEVICE_FUNC const SinReturnType sin() const
Cal3_S2::shared_ptr K_
shared pointer to calibration object
boost::shared_ptr< This > shared_ptr
shorthand for a smart pointer to a factor
NoiseModelFactor2< Pose3, Vector3 > Base
shorthand for base class type
static const CalibratedCamera camera(kDefaultPose)
~InvDepthFactorVariant3a() override
void print(const std::string &s="InvDepthFactorVariant3", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
boost::shared_ptr< This > shared_ptr
shorthand for a smart pointer to a factor
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)
InvDepthFactorVariant3b(const Key poseKey1, const Key poseKey2, const Key landmarkKey, const Point2 &measured, const Cal3_S2::shared_ptr &K, const SharedNoiseModel &model)
noiseModel::Base::shared_ptr SharedNoiseModel
The most common 5DOF 3D->2D calibration.
const char * what() const noexceptoverride
Cal3_S2::shared_ptr K_
shared pointer to calibration object