29 template<
class T,
class P>
31 const T&
trans,
const P& global,
34 return trans.transformFrom(global, Dtrans, Dglobal);
56 template<
class POINT,
class TRANSFORM>
76 : Base(model,globalKey, transKey, localKey) {}
83 : Base(globalKey, transKey, localKey, Point().
dim(), mu) {}
91 globalKey, transKey, localKey) {}
103 Point newlocal = transform_point<Transform,Point>(
trans, global, Dtrans, Dforeign);
112 std::cout <<
s <<
": ReferenceFrameFactor(" 113 <<
"Global: " << keyFormatter(this->
key1()) <<
"," 114 <<
" Transform: " << keyFormatter(this->
key2()) <<
"," 115 <<
" Local: " << keyFormatter(this->
key3()) <<
")\n";
125 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 127 friend class boost::serialization::access;
128 template<
class ARCHIVE>
129 void serialize(ARCHIVE & ar,
const unsigned int ) {
130 ar & boost::serialization::make_nvp(
"NonlinearFactor3",
131 boost::serialization::base_object<Base>(*
this));
137 template<
class T1,
class T2>
P transform_point(const T &trans, const P &global, OptionalMatrixType Dtrans, OptionalMatrixType Dglobal)
size_t dim() const override
std::string serialize(const T &input)
serializes to a string
noiseModel::Diagonal::shared_ptr model
virtual Vector evaluateError(const ValueTypes &... x, OptionalMatrixTypeT< ValueTypes >... H) const=0
static const Pose3 T2(Rot3::Rodrigues(0.3, 0.2, 0.1), P2)
static const KeyFormatter DefaultKeyFormatter
Matrix trans(const Matrix &A)
NonlinearFactor::shared_ptr clone() const override
ReferenceFrameFactor(Key globalKey, Key transKey, Key localKey, double sigma=1e-2)
const SharedNoiseModel & noiseModel() const
access to the noise model
Matrix * OptionalMatrixType
void print(const std::string &s="", const gtsam::KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
~ReferenceFrameFactor() override
std::shared_ptr< Base > shared_ptr
Key transform_key() const
ReferenceFrameFactor(double mu, Key globalKey, Key transKey, Key localKey)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Vector evaluateError(const Point &global, const Transform &trans, const Point &local, OptionalMatrixType Dforeign, OptionalMatrixType Dtrans, OptionalMatrixType Dlocal) const override
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
NoiseModelFactorN< POINT, TRANSFORM, POINT > Base
A small structure to hold a non zero as a triplet (i,j,value).
ReferenceFrameFactor< POINT, TRANSFORM > This
SharedNoiseModel noiseModel_
ReferenceFrameFactor(Key globalKey, Key transKey, Key localKey, const noiseModel::Base::shared_ptr &model)
Non-linear factor base classes.
static const Similarity3 T1(R, Point3(3.5, -8.2, 4.2), 1)
std::shared_ptr< This > shared_ptr
static const double sigma
std::uint64_t Key
Integer nonlinear key type.