PreintegrationParams.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 
17 #pragma once
18 
20 #include <boost/make_shared.hpp>
21 
22 namespace gtsam {
23 
33 
37  accelerometerCovariance(I_3x3),
38  integrationCovariance(I_3x3),
39  use2ndOrderCoriolis(false),
40  n_gravity(0, 0, -1) {}
41 
44  PreintegrationParams(const Vector3& n_gravity)
46  accelerometerCovariance(I_3x3),
47  integrationCovariance(I_3x3),
48  use2ndOrderCoriolis(false),
49  n_gravity(n_gravity) {}
50 
51  // Default Params for a Z-down navigation frame, such as NED: gravity points along positive Z-axis
52  static boost::shared_ptr<PreintegrationParams> MakeSharedD(double g = 9.81) {
53  return boost::shared_ptr<PreintegrationParams>(new PreintegrationParams(Vector3(0, 0, g)));
54  }
55 
56  // Default Params for a Z-up navigation frame, such as ENU: gravity points along negative Z-axis
57  static boost::shared_ptr<PreintegrationParams> MakeSharedU(double g = 9.81) {
58  return boost::shared_ptr<PreintegrationParams>(new PreintegrationParams(Vector3(0, 0, -g)));
59  }
60 
61  void print(const std::string& s="") const override;
62  bool equals(const PreintegratedRotationParams& other, double tol) const override;
63 
64  void setAccelerometerCovariance(const Matrix3& cov) { accelerometerCovariance = cov; }
65  void setIntegrationCovariance(const Matrix3& cov) { integrationCovariance = cov; }
66  void setUse2ndOrderCoriolis(bool flag) { use2ndOrderCoriolis = flag; }
67 
68  const Matrix3& getAccelerometerCovariance() const { return accelerometerCovariance; }
69  const Matrix3& getIntegrationCovariance() const { return integrationCovariance; }
70  const Vector3& getGravity() const { return n_gravity; }
71  bool getUse2ndOrderCoriolis() const { return use2ndOrderCoriolis; }
72 
73 protected:
74 
76  friend class boost::serialization::access;
77  template<class ARCHIVE>
78  void serialize(ARCHIVE & ar, const unsigned int /*version*/) {
79  namespace bs = ::boost::serialization;
80  ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(PreintegratedRotationParams);
81  ar & BOOST_SERIALIZATION_NVP(accelerometerCovariance);
82  ar & BOOST_SERIALIZATION_NVP(integrationCovariance);
83  ar & BOOST_SERIALIZATION_NVP(use2ndOrderCoriolis);
84  ar & BOOST_SERIALIZATION_NVP(n_gravity);
85  }
86 
87 #ifdef GTSAM_USE_QUATERNIONS
88  // Align if we are using Quaternions
89 public:
91 #endif
92 };
93 
94 } // namespace gtsam
void print(const Matrix &A, const string &s, ostream &stream)
Definition: Matrix.cpp:155
void setAccelerometerCovariance(const Matrix3 &cov)
const Vector3 & getGravity() const
Eigen::Vector3d Vector3
Definition: Vector.h:43
void serialize(ARCHIVE &ar, const unsigned int)
Matrix3 integrationCovariance
continuous-time "Covariance" describing integration uncertainty
void setIntegrationCovariance(const Matrix3 &cov)
const Matrix3 & getAccelerometerCovariance() const
void g(const string &key, int i)
Definition: testBTree.cpp:43
PreintegrationParams(const Vector3 &n_gravity)
Vector3 n_gravity
Gravity vector in nav frame.
RealScalar s
bool use2ndOrderCoriolis
Whether to use second order Coriolis integration.
static boost::shared_ptr< PreintegrationParams > MakeSharedU(double g=9.81)
traits
Definition: chartTesting.h:28
#define GTSAM_MAKE_ALIGNED_OPERATOR_NEW
Definition: types.h:269
const G double tol
Definition: Group.h:83
static boost::shared_ptr< PreintegrationParams > MakeSharedD(double g=9.81)
const Matrix3 & getIntegrationCovariance() const
PreintegrationParams()
Default constructor for serialization only.


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:43:29