imuFactorTesting.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 
18 #pragma once
19 
21 #include <gtsam/inference/Symbol.h>
22 
23 using namespace std;
24 using namespace gtsam;
25 
26 // Convenience for named keys
30 
31 static const Vector3 kZero = Z_3x1;
33 static const Bias kZeroBiasHat, kZeroBias;
34 
35 static const Vector3 kZeroOmegaCoriolis(0, 0, 0);
36 static const Vector3 kNonZeroOmegaCoriolis(0, 0.1, 0.1);
37 
38 static const double kGravity = 10;
39 static const Vector3 kGravityAlongNavZDown(0, 0, kGravity);
40 
41 // Realistic MEMS white noise characteristics. Angular and velocity random walk
42 // expressed in degrees respectively m/s per sqrt(hr).
43 auto radians = [](double t) { return t * M_PI / 180; };
44 static const double kGyroSigma = radians(0.5) / 60; // 0.5 degree ARW
45 static const double kAccelSigma = 0.1 / 60; // 10 cm VRW
46 
47 namespace testing {
48 
50  ImuMeasurement(const Vector3& acc, const Vector3& gyro, double dt)
51  : acc(acc), gyro(gyro), dt(dt) {}
52  const Vector3 acc, gyro;
53  const double dt;
54 };
55 
56 template <typename PIM>
57 void integrateMeasurements(const vector<ImuMeasurement>& measurements,
58  PIM* pim) {
59  for (const auto& m : measurements)
60  pim->integrateMeasurement(m.acc, m.gyro, m.dt);
61 }
62 
63 struct SomeMeasurements : vector<ImuMeasurement> {
65  reserve(102);
66  const double dt = 0.01, pi100 = M_PI / 100;
67  emplace_back(Vector3(0.1, 0, 0), Vector3(pi100, 0, 0), dt);
68  emplace_back(Vector3(0.1, 0, 0), Vector3(pi100, 0, 0), dt);
69  for (int i = 1; i < 100; i++) {
70  emplace_back(Vector3(0.05, 0.09, 0.01),
71  Vector3(pi100, pi100 * 3, 2 * pi100), dt);
72  }
73  }
74 };
75 
76 } // namespace testing
static const Bias kZeroBiasHat
Matrix3f m
static const Eigen::MatrixBase< Vector3 >::ConstantReturnType Z_3x1
Definition: Vector.h:46
Eigen::Vector3d Vector3
Definition: Vector.h:43
ImuMeasurement(const Vector3 &acc, const Vector3 &gyro, double dt)
#define M_PI
Definition: main.h:78
void integrateMeasurements(const vector< ImuMeasurement > &measurements, PIM *pim)
Definition: Half.h:150
static const Vector3 kGravityAlongNavZDown(0, 0, kGravity)
Matrix< SCALARB, Dynamic, Dynamic > B
Definition: bench_gemm.cpp:36
static const Vector3 kNonZeroOmegaCoriolis(0, 0.1, 0.1)
const double dt
static const Bias kZeroBias
auto radians
static const double kGravity
static const Vector3 kZeroOmegaCoriolis(0, 0, 0)
static const double kAccelSigma
static const Vector3 kZero
traits
Definition: chartTesting.h:28
imuBias::ConstantBias Bias
static const double kGyroSigma
#define X
Definition: icosphere.cpp:20
Point2 t(10, 10)


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:42:13