26 typedef typename POSE::Translation Translation;
27 typedef typename POSE::Rotation Rotation;
29 GTSAM_CONCEPT_POSE_TYPE(Pose)
30 GTSAM_CONCEPT_GROUP_TYPE(Pose)
31 GTSAM_CONCEPT_LIE_TYPE(Translation)
35 Translation measured_;
44 :
Base(model, key), measured_(measured) {
49 :
Base(model, key), measured_(pose_z.translation()) {
54 const Translation& measured()
const {
return measured_; }
57 gtsam::NonlinearFactor::shared_ptr
clone()
const override {
58 return boost::static_pointer_cast<gtsam::NonlinearFactor>(
59 gtsam::NonlinearFactor::shared_ptr(
new This(*
this))); }
62 Vector
evaluateError(
const Pose& pose, boost::optional<Matrix&> H = boost::none)
const override {
63 const Translation& newTrans = pose.translation();
64 const Rotation& R = pose.rotation();
68 *H = Matrix::Zero(tDim, xDim);
69 std::pair<size_t, size_t> transInterval = POSE::translationInterval();
70 (*H).middleCols(transInterval.first, tDim) = R.matrix();
78 const This *e =
dynamic_cast<const This*
> (&expected);
83 void print(
const std::string& s=
"",
const KeyFormatter& keyFormatter = DefaultKeyFormatter)
const override {
84 Base::print(s +
"PoseTranslationPrior", keyFormatter);
92 template<
class ARCHIVE>
93 void serialize(ARCHIVE & ar,
const unsigned int ) {
94 ar & boost::serialization::make_nvp(
"NoiseModelFactor1",
95 boost::serialization::base_object<Base>(*
this));
96 ar & BOOST_SERIALIZATION_NVP(measured_);
Non-linear factor base classes.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:69
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
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
This is the base class for all factor types.
Definition: Factor.h:56
Nonlinear factor base class.
Definition: NonlinearFactor.h:43
bool equals(const NonlinearFactor &f, double tol=1e-9) const override
Check if two factors are equal.
Definition: NonlinearFactor.cpp:71
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
Print.
Definition: NonlinearFactor.cpp:63
A convenient base class for creating your own NoiseModelFactor with 1 variable.
Definition: NonlinearFactor.h:285
A prior on the translation part of a pose.
Definition: PoseTranslationPrior.h:21
PoseTranslationPrior(Key key, const Translation &measured, const noiseModel::Base::shared_ptr &model)
standard constructor
Definition: PoseTranslationPrior.h:43
PoseTranslationPrior(Key key, const POSE &pose_z, const noiseModel::Base::shared_ptr &model)
Constructor that pulls the translation from an incoming POSE.
Definition: PoseTranslationPrior.h:48
Vector evaluateError(const Pose &pose, boost::optional< Matrix & > H=boost::none) const override
h(x)-z
Definition: PoseTranslationPrior.h:62
bool equals(const NonlinearFactor &expected, double tol=1e-9) const override
equals specialized to this factor
Definition: PoseTranslationPrior.h:77
gtsam::NonlinearFactor::shared_ptr clone() const override
Definition: PoseTranslationPrior.h:57
friend class boost::serialization::access
Serialization function.
Definition: PoseTranslationPrior.h:91
PoseTranslationPrior()
default constructor - only use for serialization
Definition: PoseTranslationPrior.h:40
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
print contents
Definition: PoseTranslationPrior.h:83
Concept-checking macros for geometric objects Each macro instantiates a concept check structure,...