29 template<
class T,
class P>
31 const T&
trans,
const P& global,
32 boost::optional<Matrix&> Dtrans,
33 boost::optional<Matrix&> Dglobal) {
34 return trans.transformFrom(global, Dtrans, Dglobal);
56 template<
class POINT,
class TRANSFORM>
73 : Base(model,globalKey, transKey, localKey) {}
80 : Base(globalKey, transKey, localKey, Point().
dim(), mu) {}
88 globalKey, transKey, localKey) {}
98 boost::optional<Matrix&> Dforeign = boost::none,
99 boost::optional<Matrix&> Dtrans = boost::none,
100 boost::optional<Matrix&> Dlocal = boost::none)
const override {
101 Point newlocal = transform_point<Transform,Point>(
trans, global, Dtrans, Dforeign);
109 std::cout <<
s <<
": ReferenceFrameFactor(" 110 <<
"Global: " << keyFormatter(this->
key1()) <<
"," 111 <<
" Transform: " << keyFormatter(this->
key2()) <<
"," 112 <<
" Local: " << keyFormatter(this->
key3()) <<
")\n";
124 template<
class ARCHIVE>
126 ar & boost::serialization::make_nvp(
"NonlinearFactor3",
127 boost::serialization::base_object<Base>(*
this));
132 template<
class T1,
class T2>
friend class boost::serialization::access
P transform_point(const T &trans, const P &global, boost::optional< Matrix & > Dtrans, boost::optional< Matrix & > Dglobal)
size_t dim() const override
void serialize(ARCHIVE &ar, const unsigned int)
noiseModel::Diagonal::shared_ptr model
static const double sigma
Pose2 T2(M_PI/2.0, Point2(0.0, 2.0))
static const KeyFormatter DefaultKeyFormatter
const SharedNoiseModel & noiseModel() const
access to the noise model
Matrix trans(const Matrix &A)
NonlinearFactor::shared_ptr clone() const override
ReferenceFrameFactor(Key globalKey, Key transKey, Key localKey, double sigma=1e-2)
Key transform_key() const
void print(const std::string &s="", const gtsam::KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
~ReferenceFrameFactor() override
ReferenceFrameFactor(double mu, Key globalKey, Key transKey, Key localKey)
boost::shared_ptr< This > shared_ptr
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< POINT, TRANSFORM, POINT > Base
boost::shared_ptr< Base > shared_ptr
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.
Pose2 T1(M_PI/4.0, Point2(sqrt(0.5), sqrt(0.5)))
Vector evaluateError(const Point &global, const Transform &trans, const Point &local, boost::optional< Matrix & > Dforeign=boost::none, boost::optional< Matrix & > Dtrans=boost::none, boost::optional< Matrix & > Dlocal=boost::none) const override
std::uint64_t Key
Integer nonlinear key type.