33 template<
class POSE,
class LANDMARK,
class CALIBRATION = Cal3_S2>
40 std::shared_ptr<CALIBRATION>
K_;
76 Key poseKey,
Key transformKey,
Key pointKey,
77 const std::shared_ptr<CALIBRATION>& K) :
93 Key poseKey,
Key transformKey,
Key pointKey,
94 const std::shared_ptr<CALIBRATION>& K,
103 NonlinearFactor::shared_ptr
clone()
const override {
104 return std::static_pointer_cast<NonlinearFactor>(
105 NonlinearFactor::shared_ptr(
new This(*
this))); }
113 std::cout << s <<
"ProjectionFactorPPP, z = ";
120 const This *e =
dynamic_cast<const This*
>(&p);
124 && this->K_->equals(*e->
K_, tol);
139 return reprojectionError;
145 if (H1) *H1 = Matrix::Zero(2,6);
146 if (H2) *H2 = Matrix::Zero(2,6);
147 if (H3) *H3 = Matrix::Zero(2,3);
149 std::cout << e.what() <<
": Landmark "
151 <<
" moved behind camera "
157 return Vector::Ones(2) * 2.0 *
K_->fx();
178#if GTSAM_ENABLE_BOOST_SERIALIZATION
180 friend class boost::serialization::access;
181 template<
class ARCHIVE>
182 void serialize(ARCHIVE & ar,
const unsigned int ) {
183 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
185 ar & BOOST_SERIALIZATION_NVP(
K_);
193 template<
class POSE,
class LANDMARK,
class CALIBRATION>
195 public Testable<ProjectionFactorPPP<POSE, LANDMARK, CALIBRATION> > {
The most common 5DOF 3D->2D calibration.
Base class for all pinhole cameras.
Base class for noise model factors with N variables.
Non-linear factor base classes.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
Definition Key.cpp:30
Matrix * OptionalMatrixType
This typedef will be used everywhere boost::optional<Matrix&> reference was used previously.
Definition NonlinearFactor.h:57
Vector3 Point3
As of GTSAM 4, in order to make GTSAM more lean, it is now possible to just typedef Point3 to Vector3...
Definition Point3.h:38
Vector2 Point2
As of GTSAM 4, in order to make GTSAM more lean, it is now possible to just typedef Point2 to Vector2...
Definition Point2.h:32
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition Key.h:35
noiseModel::Base::shared_ptr SharedNoiseModel
Aliases.
Definition NoiseModel.h:846
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:43
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition Group.h:37
A helper that implements the traits interface for GTSAM types.
Definition Testable.h:152
Definition CalibratedCamera.h:35
A pinhole camera class that has a Pose3 and a Calibration.
Definition PinholeCamera.h:34
Point2 project(const Point3 &pw, OptionalJacobian< 2, 6 > Dpose={}, OptionalJacobian< 2, 3 > Dpoint={}, OptionalJacobian< 2, DimK > Dcal={}) const
project a 3D point from world coordinates into the image
Definition PinholePose.h:112
A 3D pose (R,t) : (Rot3,Point3).
Definition Pose3.h:42
virtual void print(const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const
print
Definition Factor.cpp:29
bool equals(const This &other, double tol=1e-9) const
check equality
Definition Factor.cpp:42
NoiseModelFactorT()
Definition NoiseModelFactorN.h:257
virtual Vector2 evaluateError(const ValueTypes &... x, OptionalMatrixTypeT< ValueTypes >... H) const=0
Nonlinear factor base class.
Definition NonlinearFactor.h:70
Non-linear factor for a constraint derived from a 2D measurement.
Definition ProjectionFactorPPP.h:35
bool equals(const NonlinearFactor &p, double tol=1e-9) const override
equals
Definition ProjectionFactorPPP.h:119
NonlinearFactor::shared_ptr clone() const override
Definition ProjectionFactorPPP.h:103
bool verboseCheirality_
Definition ProjectionFactorPPP.h:44
ProjectionFactorPPP(const Point2 &measured, const SharedNoiseModel &model, Key poseKey, Key transformKey, Key pointKey, const std::shared_ptr< CALIBRATION > &K)
Constructor TODO: Mark argument order standard (keys, measurement, parameters).
Definition ProjectionFactorPPP.h:75
bool throwCheirality() const
Definition ProjectionFactorPPP.h:174
NoiseModelFactorT< Vector2, POSE, POSE, LANDMARK > Base
shorthand for base class type
Definition ProjectionFactorPPP.h:49
std::shared_ptr< This > shared_ptr
Definition ProjectionFactorPPP.h:58
Vector2 evaluateError(const Pose3 &pose, const Pose3 &transform, const Point3 &point, OptionalMatrixType H1, OptionalMatrixType H2, OptionalMatrixType H3) const override
Evaluate error h(x)-z and optionally derivatives.
Definition ProjectionFactorPPP.h:128
ProjectionFactorPPP()
Default constructor.
Definition ProjectionFactorPPP.h:61
ProjectionFactorPPP< POSE, LANDMARK, CALIBRATION > This
shorthand for this class
Definition ProjectionFactorPPP.h:55
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
print
Definition ProjectionFactorPPP.h:112
~ProjectionFactorPPP() override
Virtual destructor.
Definition ProjectionFactorPPP.h:100
Point2 measured_
Definition ProjectionFactorPPP.h:39
std::shared_ptr< CALIBRATION > K_
Definition ProjectionFactorPPP.h:40
bool throwCheirality_
Definition ProjectionFactorPPP.h:43
ProjectionFactorPPP(const Point2 &measured, const SharedNoiseModel &model, Key poseKey, Key transformKey, Key pointKey, const std::shared_ptr< CALIBRATION > &K, bool throwCheirality, bool verboseCheirality)
Constructor with exception-handling flags TODO: Mark argument order standard (keys,...
Definition ProjectionFactorPPP.h:92
const Point2 & measured() const
Definition ProjectionFactorPPP.h:161
bool verboseCheirality() const
Definition ProjectionFactorPPP.h:171
const std::shared_ptr< CALIBRATION > calibration() const
return the calibration object
Definition ProjectionFactorPPP.h:166