33template<
class T,
class P>
35 const T& trans,
const P& global,
38 return trans.transformFrom(global, Dtrans, Dglobal);
60template<
class POINT,
class TRANSFORM>
79 typedef TRANSFORM Transform;
85 : Base(model,globalKey, transKey, localKey) {}
93 transKey, localKey) {}
101 globalKey, transKey, localKey) {}
105 NonlinearFactor::shared_ptr
clone()
const override {
106 return std::static_pointer_cast<NonlinearFactor>(
107 NonlinearFactor::shared_ptr(
new This(*
this))); }
123 std::cout << s <<
": ReferenceFrameFactor("
124 <<
"Global: " << keyFormatter(this->key1()) <<
","
125 <<
" Transform: " << keyFormatter(this->key2()) <<
","
126 <<
" Local: " << keyFormatter(this->key3()) <<
")\n";
127 this->noiseModel_->print(
" noise model");
131 Key global_key()
const {
return this->key1(); }
132 Key transform_key()
const {
return this->key2(); }
133 Key local_key()
const {
return this->key3(); }
136#if GTSAM_ENABLE_BOOST_SERIALIZATION
138 friend class boost::serialization::access;
139 template<
class ARCHIVE>
140 void serialize(ARCHIVE & ar,
const unsigned int ) {
141 ar & boost::serialization::make_nvp(
"NonlinearFactor3",
142 boost::serialization::base_object<Base>(*
this));
148template<
class T1,
class T2>
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
P transform_point(const T &trans, const P &global, OptionalMatrixType Dtrans, OptionalMatrixType Dglobal)
Transform function that must be specialized specific domains.
Definition ReferenceFrameFactor.h:34
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:43
All noise models live in the noiseModel namespace.
Definition LossFunctions.cpp:33
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
A Constrained constrained model is a specialization of Diagonal which allows some or all of the sigma...
Definition NoiseModel.h:436
A convenient base class for creating your own NoiseModelFactor with n variables.
Definition NoiseModelFactorN.h:155
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.
size_t dim() const override
get the dimension of the factor (number of rows on linearization)
Definition NonlinearFactor.h:251
A constraint between two landmarks in separate maps Templated on: Point : Type of landmark Transform ...
Definition ReferenceFrameFactor.h:63
void print(const std::string &s="", const gtsam::KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
Print.
Definition ReferenceFrameFactor.h:121
ReferenceFrameFactor(Key globalKey, Key transKey, Key localKey, const noiseModel::Base::shared_ptr &model)
General constructor with arbitrary noise model (constrained or otherwise).
Definition ReferenceFrameFactor.h:84
NonlinearFactor::shared_ptr clone() const override
Creates a shared_ptr clone of the factor - needs to be specialized to allow for subclasses.
Definition ReferenceFrameFactor.h:105
ErrorVector evaluateError(const Point &_global, const Transform &trans, const Point &local, OptionalMatrixType Dforeign, OptionalMatrixType Dtrans, OptionalMatrixType Dlocal) const override
Combined cost and derivative function using boost::optional.
Definition ReferenceFrameFactor.h:110
ReferenceFrameFactor(Key globalKey, Key transKey, Key localKey, double sigma=1e-2)
Simple soft constraint constructor for frame of reference, with equal weighting for each degree of fr...
Definition ReferenceFrameFactor.h:99
ReferenceFrameFactor(double mu, Key globalKey, Key transKey, Key localKey)
Construct a hard frame of reference reference constraint with equal mu values for each degree of free...
Definition ReferenceFrameFactor.h:91
ReferenceFrameFactor()
default constructor for serialization only
Definition ReferenceFrameFactor.h:66
An isotropic noise model corresponds to a scaled diagonal covariance To construct,...
Definition NoiseModel.h:581