RelativeElevationFactor.h
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include <gtsam_unstable/dllexport.h>
13 #include <gtsam/geometry/Pose3.h>
15 
16 namespace gtsam {
17 
28 class GTSAM_UNSTABLE_EXPORT RelativeElevationFactor: public NoiseModelFactorN<Pose3, Point3> {
29 private:
30 
31  double measured_;
35 
36 public:
37 
38  // Provide access to the Matrix& version of evaluateError:
39  using Base::evaluateError;
40 
41  RelativeElevationFactor() : measured_(0.0) {} /* Default constructor */
42 
44  const SharedNoiseModel& model);
45 
47 
50  return std::static_pointer_cast<gtsam::NonlinearFactor>(
52 
54  Vector evaluateError(const Pose3& pose, const Point3& point,
55  OptionalMatrixType H1, OptionalMatrixType H2) const override;
56 
58  inline double measured() const { return measured_; }
59 
61  bool equals(const NonlinearFactor& expected, double tol=1e-9) const override;
62 
64  void print(const std::string& s="", const KeyFormatter& keyFormatter = DefaultKeyFormatter) const override;
65 
66 private:
67 
68 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
69 
70  friend class boost::serialization::access;
71  template<class ARCHIVE>
72  void serialize(ARCHIVE & ar, const unsigned int /*version*/) {
73  // NoiseModelFactor2 instead of NoiseModelFactorN for backward compatibility
74  ar & boost::serialization::make_nvp("NoiseModelFactor2",
75  boost::serialization::base_object<Base>(*this));
76  ar & BOOST_SERIALIZATION_NVP(measured_);
77  }
78 #endif
79 }; // RelativeElevationFactor
80 
81 
82 } // \namespace gtsam
83 
84 
void print(const Matrix &A, const string &s, ostream &stream)
Definition: Matrix.cpp:155
Point2 measured(-17, 30)
const gtsam::Key poseKey
std::string serialize(const T &input)
serializes to a string
noiseModel::Diagonal::shared_ptr model
Matrix expected
Definition: testMatrix.cpp:971
NoiseModelFactorN< Pose3, Point3 > Base
static const KeyFormatter DefaultKeyFormatter
Definition: Key.h:43
const gtsam::Key pointKey
Matrix * OptionalMatrixType
Eigen::VectorXd Vector
Definition: Vector.h:38
Array< double, 1, 3 > e(1./3., 0.5, 2.)
RealScalar s
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
#define This
traits
Definition: chartTesting.h:28
static const Pose3 pose(Rot3(Vector3(1, -1, -1).asDiagonal()), Point3(0, 0, 0.5))
Non-linear factor base classes.
std::shared_ptr< This > shared_ptr
gtsam::NonlinearFactor::shared_ptr clone() const override
const G double tol
Definition: Group.h:86
Vector3 Point3
Definition: Point3.h:38
3D Pose
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:102
noiseModel::Base::shared_ptr SharedNoiseModel
Definition: NoiseModel.h:741


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:35:32