35template<
typename POSE = Pose3,
typename POINT = Po
int3>
53 typedef std::shared_ptr<PoseToPointFactor> shared_ptr;
61 : Base(model, key1, key2), measured_(
measured) {}
70 std::cout << s <<
"PoseToPointFactor("
71 << keyFormatter(this->key1()) <<
","
72 << keyFormatter(this->key2()) <<
")\n"
73 <<
" measured: " << measured_.transpose() << std::endl;
74 this->noiseModel_->print(
" noise model: ");
79 double tol = 1e-9)
const override {
80 const This* e =
dynamic_cast<const This*
>(&expected);
86 gtsam::NonlinearFactor::shared_ptr
clone()
const override {
87 return std::static_pointer_cast<gtsam::NonlinearFactor>(
88 gtsam::NonlinearFactor::shared_ptr(
new This(*
this)));
101 const POSE& w_T_b,
const POINT& w_P,
104 return w_T_b.transformTo(w_P, H1, H2) - measured_;
108 const POINT&
measured()
const {
return measured_; }
111#if GTSAM_ENABLE_BOOST_SERIALIZATION
113 friend class boost::serialization::access;
114 template <
class ARCHIVE>
115 void serialize(ARCHIVE& ar,
const unsigned int ) {
117 ar& boost::serialization::make_nvp(
119 boost::serialization::base_object<Base>(*
this));
120 ar& BOOST_SERIALIZATION_NVP(measured_);
3D Pose manifold SO(3) x R^3 and group SE(3)
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
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
bool equals(const This &other, double tol=1e-9) const
check equality
Definition Factor.cpp:42
NoiseModelFactorT()
Definition NoiseModelFactorN.h:257
virtual OutputVec evaluateError(const ValueTypes &... x, OptionalMatrixTypeT< ValueTypes >... H) const =0
Override evaluateError to finish implementing an n-way factor.
Nonlinear factor base class.
Definition NonlinearFactor.h:70
A class for a measurement between a pose and a point.
Definition PoseToPointFactor.h:38
gtsam::NonlinearFactor::shared_ptr clone() const override
Definition PoseToPointFactor.h:86
const POINT & measured() const
return the measured
Definition PoseToPointFactor.h:108
bool equals(const NonlinearFactor &expected, double tol=1e-9) const override
equals
Definition PoseToPointFactor.h:78
void print(const std::string &s, const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
implement functions needed for Testable
Definition PoseToPointFactor.h:68
ErrorVector evaluateError(const POSE &w_T_b, const POINT &w_P, OptionalMatrixType H1, OptionalMatrixType H2) const override
implement functions needed to derive from Factor
Definition PoseToPointFactor.h:100
PoseToPointFactor(Key key1, Key key2, const POINT &measured, const SharedNoiseModel &model)
Constructor.
Definition PoseToPointFactor.h:59
PoseToPointFactor()
default constructor - only use for serialization
Definition PoseToPointFactor.h:56