gtsam
Loading...
Searching...
No Matches
RelativeElevationFactor.h
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2
3 * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4 * Atlanta, Georgia 30332-0415
5 * All Rights Reserved
6 * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7
8 * See LICENSE for the license information
9
10 * -------------------------------------------------------------------------- */
11
20
21#pragma once
22
23#include <gtsam_unstable/dllexport.h>
27
28namespace gtsam {
29
40class GTSAM_UNSTABLE_EXPORT RelativeElevationFactor
41 : public NoiseModelFactorT<Vector1, Pose3, Point3> {
42private:
43
44 double measured_;
45
46 typedef RelativeElevationFactor This;
48
49public:
50
51 // Provide access to the Matrix& version of evaluateError:
53
54 RelativeElevationFactor() : measured_(0.0) {} /* Default constructor */
55
56 RelativeElevationFactor(Key poseKey, Key pointKey, double measured,
57 const SharedNoiseModel& model);
58
59 ~RelativeElevationFactor() override {}
60
62 gtsam::NonlinearFactor::shared_ptr clone() const override {
63 return std::static_pointer_cast<gtsam::NonlinearFactor>(
64 gtsam::NonlinearFactor::shared_ptr(new This(*this))); }
65
67 Vector1 evaluateError(const Pose3& pose, const Point3& point,
69 OptionalMatrixType H2) const override;
70
72 inline double measured() const { return measured_; }
73
75 bool equals(const NonlinearFactor& expected, double tol=1e-9) const override;
76
78 void print(const std::string& s="", const KeyFormatter& keyFormatter = DefaultKeyFormatter) const override;
79
80private:
81
82#if GTSAM_ENABLE_BOOST_SERIALIZATION
84 friend class boost::serialization::access;
85 template<class ARCHIVE>
86 void serialize(ARCHIVE & ar, const unsigned int /*version*/) {
87 // NoiseModelFactor2 instead of NoiseModelFactorN for backward compatibility
88 ar & boost::serialization::make_nvp("NoiseModelFactor2",
89 boost::serialization::base_object<Base>(*this));
90 ar & BOOST_SERIALIZATION_NVP(measured_);
91 }
92#endif
93}; // RelativeElevationFactor
94
95
96} // \namespace gtsam
3D Pose manifold SO(3) x R^3 and group SE(3)
Base class for noise model factors with N variables.
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
Vector3 Point3
As of GTSAM 4, in order to make GTSAM more lean, it is now possible to just typedef Point3 to Vector3...
Definition Point3.h:38
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:143
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
noiseModel::Base::shared_ptr SharedNoiseModel
Aliases.
Definition NoiseModel.h:846
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:43
Template to create a binary predicate.
Definition Testable.h:112
A 3D pose (R,t) : (Rot3,Point3).
Definition Pose3.h:42
NoiseModelFactorT()
Definition NoiseModelFactorN.h:257
virtual Vector1 evaluateError(const ValueTypes &... x, OptionalMatrixTypeT< ValueTypes >... H) const=0
Nonlinear factor base class.
Definition NonlinearFactor.h:70
double measured() const
return the measured
Definition RelativeElevationFactor.h:72
gtsam::NonlinearFactor::shared_ptr clone() const override
Definition RelativeElevationFactor.h:62