gtsam
Loading...
Searching...
No Matches
PlanarGyroFactor.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
24
25#pragma once
26#include <gtsam/base/Vector.h>
28#include <gtsam/geometry/Rot2.h>
32
33#include <optional>
34
35#include "gtsam/dllexport.h"
36
37namespace gtsam {
47class GTSAM_EXPORT PlanarGyroParams {
48 private:
57 const double arw;
66 const double biasInstability;
67
68 public:
69 PlanarGyroParams(double arw, double biasInstability)
70 : arw(arw), biasInstability(biasInstability) {}
78 double arwSigma(double deltaT);
84 double biasInstabilitySigma();
85 bool operator==(const PlanarGyroParams& other) const;
86 void print(const std::string& s) const;
87};
88
92class GTSAM_EXPORT PlanarGyroBiasFactor : public BetweenFactor<double> {
93 typedef BetweenFactor<double> Base;
94
95 public:
96 PlanarGyroBiasFactor(Key bias_i, Key bias_j,
97 const std::shared_ptr<PlanarGyroParams>& p);
98 ~PlanarGyroBiasFactor() override {}
99};
100
104class GTSAM_EXPORT PlanarGyroFactor
105 : public NoiseModelFactorT<Vector3, Pose2, Pose2, double> {
107
108 private:
109 const std::shared_ptr<PlanarGyroParams> p_;
111 const Rot2 deltaR_;
113 const double deltaT_;
114
115 PlanarGyroFactor(Key pose_i, Key pose_j, Key bias,
116 const std::shared_ptr<PlanarGyroParams>& p, Rot2 dr,
117 double dt);
118
119 public:
120 // Provide access to the Matrix& version of evaluateError:
122
131 static inline PlanarGyroFactor FromRotation(
132 Key pose_i, Key pose_j, Key bias,
133 const std::shared_ptr<PlanarGyroParams>& p, Rot2 dr, double dt) {
134 return PlanarGyroFactor(pose_i, pose_j, bias, p, dr, dt);
135 }
136
144 static inline PlanarGyroFactor FromRate(
145 Key pose_i, Key pose_j, Key bias,
146 const std::shared_ptr<PlanarGyroParams>& p, double omega, double dt) {
147 return PlanarGyroFactor(pose_i, pose_j, bias, p,
148 Rot2::fromAngle(omega * dt), dt);
149 }
150
151 ~PlanarGyroFactor() override {}
152
153 gtsam::NonlinearFactor::shared_ptr clone() const override;
154 void print(const std::string& s, const KeyFormatter& keyFormatter =
155 DefaultKeyFormatter) const override;
156 bool equals(const NonlinearFactor&, double tol = 1e-9) const override;
157
164 Rot2 deltaR(double bias, OptionalJacobian<1, 1> H = {}) const;
165
174 Rot2 predict(const Rot2& Ri, double bias, OptionalJacobian<1, 1> H1 = {},
175 OptionalJacobian<1, 1> H2 = {}) const;
176
187 double computeError(const Rot2& Ri, const Rot2& Rj, double bias,
188 OptionalJacobian<1, 1> H1 = {},
189 OptionalJacobian<1, 1> H2 = {},
190 OptionalJacobian<1, 1> H3 = {}) const;
191
203 Vector3 evaluateError(const Pose2& Pi, const Pose2& Pj, const double& bias,
204 OptionalMatrixType H1, OptionalMatrixType H2,
205 OptionalMatrixType H3) const override;
206};
207} // namespace gtsam
typedef and functions to augment Eigen's VectorXd
2D rotation
2D Pose
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
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:43
Rotation matrix NOTE: the angle theta is in radians unless explicitly stated.
Definition Rot2.h:40
static Rot2 fromAngle(double theta)
Named constructor from angle in radians.
Definition Rot2.h:66
A diagonal noise model implements a diagonal covariance matrix, with the elements of the diagonal spe...
Definition NoiseModel.h:327
double arwSigma(double deltaT)
Std dev of the integrated measurement (rad), for the specified duration (sec).
Definition PlanarGyroFactor.cpp:25
double biasInstabilitySigma()
Bias instability is the "zero slope" part of the Allan curve, so it is not dependent on sample rate.
Definition PlanarGyroFactor.cpp:27
A "between" factor for Pose2 rotation, with variable bias.
Definition PlanarGyroFactor.h:105
static PlanarGyroFactor FromRotation(Key pose_i, Key pose_j, Key bias, const std::shared_ptr< PlanarGyroParams > &p, Rot2 dr, double dt)
Definition PlanarGyroFactor.h:131
static PlanarGyroFactor FromRate(Key pose_i, Key pose_j, Key bias, const std::shared_ptr< PlanarGyroParams > &p, double omega, double dt)
Definition PlanarGyroFactor.h:144
NoiseModelFactorT()
Definition NoiseModelFactorN.h:257
virtual Vector3 evaluateError(const ValueTypes &... x, OptionalMatrixTypeT< ValueTypes >... H) const=0
BetweenFactor()
Definition BetweenFactor.h:75