25 typedef typename POSE::Translation Translation;
26 typedef typename POSE::Rotation Rotation;
28 GTSAM_CONCEPT_POSE_TYPE(Pose)
29 GTSAM_CONCEPT_GROUP_TYPE(Pose)
30 GTSAM_CONCEPT_LIE_TYPE(Rotation)
44 :
Base(model, key), measured_(rot_z) {}
48 :
Base(model, key), measured_(pose_z.rotation()) {}
53 gtsam::NonlinearFactor::shared_ptr
clone()
const override {
54 return boost::static_pointer_cast<gtsam::NonlinearFactor>(
55 gtsam::NonlinearFactor::shared_ptr(
new This(*
this))); }
58 const Rotation& measured()
const {
return measured_; }
64 const This *e =
dynamic_cast<const This*
> (&expected);
65 return e !=
nullptr &&
Base::equals(*e, tol) && measured_.equals(e->measured_, tol);
69 void print(
const std::string& s=
"",
const KeyFormatter& keyFormatter = DefaultKeyFormatter)
const override {
71 measured_.print(
"Measured Rotation");
75 Vector
evaluateError(
const Pose& pose, boost::optional<Matrix&> H = boost::none)
const override {
76 const Rotation& newR = pose.rotation();
78 *H = Matrix::Zero(rDim, xDim);
79 std::pair<size_t, size_t> rotInterval = POSE::rotationInterval();
80 (*H).middleCols(rotInterval.first, rDim).setIdentity(rDim, rDim);
83 return measured_.localCoordinates(newR);
90 template<
class ARCHIVE>
91 void serialize(ARCHIVE & ar,
const unsigned int ) {
92 ar & boost::serialization::make_nvp(
"NoiseModelFactor1",
93 boost::serialization::base_object<Base>(*
this));
94 ar & BOOST_SERIALIZATION_NVP(measured_);
Non-linear factor base classes.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
noiseModel::Base::shared_ptr SharedNoiseModel
Note, deliberately not in noiseModel namespace.
Definition: NoiseModel.h:736
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
Give fixed size dimension of a type, fails at compile time if dynamic.
Definition: Manifold.h:164
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
Definition: PoseRotationPrior.h:19
PoseRotationPrior(Key key, const Rotation &rot_z, const SharedNoiseModel &model)
standard constructor
Definition: PoseRotationPrior.h:43
PoseRotationPrior(Key key, const POSE &pose_z, const SharedNoiseModel &model)
Constructor that pulls the translation from an incoming POSE.
Definition: PoseRotationPrior.h:47
gtsam::NonlinearFactor::shared_ptr clone() const override
Definition: PoseRotationPrior.h:53
bool equals(const NonlinearFactor &expected, double tol=1e-9) const override
equals specialized to this factor
Definition: PoseRotationPrior.h:63
Vector evaluateError(const Pose &pose, boost::optional< Matrix & > H=boost::none) const override
h(x)-z
Definition: PoseRotationPrior.h:75
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
print contents
Definition: PoseRotationPrior.h:69
friend class boost::serialization::access
Serialization function.
Definition: PoseRotationPrior.h:89
Concept-checking macros for geometric objects Each macro instantiates a concept check structure,...