testAHRSFactor.cpp
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 
23 #include <gtsam/base/debug.h>
25 #include <gtsam/inference/Symbol.h>
33 
34 #include <cmath>
35 #include <list>
36 #include <memory>
38 
39 using namespace std::placeholders;
40 using namespace std;
41 using namespace gtsam;
42 
43 // Convenience for named keys
46 
48 
49 // Define covariance matrices
50 double gyroNoiseVar = 0.01;
51 const Matrix3 kMeasuredOmegaCovariance = gyroNoiseVar * I_3x3;
52 
53 //******************************************************************************
54 namespace {
56  const Vector3& biasHat, const list<Vector3>& measuredOmegas,
57  const list<double>& deltaTs) {
58  PreintegratedAhrsMeasurements result(biasHat, I_3x3);
59 
60  list<Vector3>::const_iterator itOmega = measuredOmegas.begin();
61  list<double>::const_iterator itDeltaT = deltaTs.begin();
62  for (; itOmega != measuredOmegas.end(); ++itOmega, ++itDeltaT) {
63  result.integrateMeasurement(*itOmega, *itDeltaT);
64  }
65 
66  return result;
67 }
68 } // namespace
69 
70 //******************************************************************************
72  // Linearization point
73  Vector3 biasHat(0, 0, 0);
74 
75  // Measurements
76  Vector3 measuredOmega(M_PI / 100.0, 0.0, 0.0);
77  double deltaT = 0.5;
78 
79  // Expected preintegrated values
80  Rot3 expectedDeltaR1 = Rot3::Roll(0.5 * M_PI / 100.0);
81 
82  // Actual preintegrated values
85 
86  EXPECT(assert_equal(expectedDeltaR1, Rot3(actual1.deltaRij()), 1e-6));
87  DOUBLES_EQUAL(deltaT, actual1.deltaTij(), 1e-6);
88 
89  // Check the covariance
90  Matrix3 expectedMeasCov = kMeasuredOmegaCovariance * deltaT;
91  EXPECT(assert_equal(expectedMeasCov, actual1.preintMeasCov(), 1e-6));
92 
93  // Integrate again
94  Rot3 expectedDeltaR2 = Rot3::Roll(2.0 * 0.5 * M_PI / 100.0);
95 
96  // Actual preintegrated values
97  PreintegratedAhrsMeasurements actual2 = actual1;
99 
100  EXPECT(assert_equal(expectedDeltaR2, Rot3(actual2.deltaRij()), 1e-6));
101  DOUBLES_EQUAL(deltaT * 2, actual2.deltaTij(), 1e-6);
102 }
103 
104 //******************************************************************************
105 TEST(AHRSFactor, PreintegratedAhrsMeasurementsConstructor) {
106  Matrix3 gyroscopeCovariance = I_3x3 * 0.4;
107  Vector3 omegaCoriolis(0.1, 0.5, 0.9);
108  PreintegratedRotationParams params(gyroscopeCovariance, omegaCoriolis);
109  Vector3 bias(1.0, 2.0, 3.0);
110  Rot3 deltaRij(Rot3::RzRyRx(M_PI / 12.0, M_PI / 6.0, M_PI / 4.0));
111  double deltaTij = 0.02;
112  Matrix3 delRdelBiasOmega = I_3x3 * 0.5;
113  Matrix3 preintMeasCov = I_3x3 * 0.2;
115  std::make_shared<PreintegratedRotationParams>(params), bias, deltaTij,
116  deltaRij, delRdelBiasOmega, preintMeasCov);
117  EXPECT(assert_equal(gyroscopeCovariance,
118  actualPim.p().getGyroscopeCovariance(), 1e-6));
119  EXPECT(
120  assert_equal(omegaCoriolis, *(actualPim.p().getOmegaCoriolis()), 1e-6));
121  EXPECT(assert_equal(bias, actualPim.biasHat(), 1e-6));
122  DOUBLES_EQUAL(deltaTij, actualPim.deltaTij(), 1e-6);
123  EXPECT(assert_equal(deltaRij, Rot3(actualPim.deltaRij()), 1e-6));
124  EXPECT(assert_equal(delRdelBiasOmega, actualPim.delRdelBiasOmega(), 1e-6));
125  EXPECT(assert_equal(preintMeasCov, actualPim.preintMeasCov(), 1e-6));
126 }
127 
128 /* ************************************************************************* */
129 TEST(AHRSFactor, Error) {
130  // Linearization point
131  Vector3 bias(0., 0., 0.); // Bias
132  Rot3 Ri(Rot3::RzRyRx(M_PI / 12.0, M_PI / 6.0, M_PI / 4.0));
133  Rot3 Rj(Rot3::RzRyRx(M_PI / 12.0 + M_PI / 100.0, M_PI / 6.0, M_PI / 4.0));
134 
135  // Measurements
136  Vector3 measuredOmega(M_PI / 100, 0, 0);
137  double deltaT = 1.0;
140 
141  // Create factor
142  AHRSFactor factor(R(1), R(2), B(1), pim, kZeroOmegaCoriolis, {});
143 
144  // Check value
145  Vector3 errorActual = factor.evaluateError(Ri, Rj, bias);
146  Vector3 errorExpected(0, 0, 0);
147  EXPECT(assert_equal(Vector(errorExpected), Vector(errorActual), 1e-6));
148 
149  // Check Derivatives
150  Values values;
151  values.insert(R(1), Ri);
152  values.insert(R(2), Rj);
153  values.insert(B(1), bias);
154  EXPECT_CORRECT_FACTOR_JACOBIANS(factor, values, 1e-5, 1e-6);
155 }
156 
157 /* ************************************************************************* */
158 TEST(AHRSFactor, ErrorWithBiases) {
159  // Linearization point
160  Vector3 bias(0, 0, 0.3);
161  Rot3 Ri(Rot3::Expmap(Vector3(0, 0, M_PI / 4.0)));
162  Rot3 Rj(Rot3::Expmap(Vector3(0, 0, M_PI / 4.0 + M_PI / 10.0)));
163 
164  // Measurements
165  Vector3 measuredOmega(0, 0, M_PI / 10.0 + 0.3);
166  double deltaT = 1.0;
169 
170  // Create factor
171  AHRSFactor factor(R(1), R(2), B(1), pim, kZeroOmegaCoriolis);
172 
173  // Check value
174  Vector3 errorExpected(0, 0, 0);
175  Vector3 errorActual = factor.evaluateError(Ri, Rj, bias);
176  EXPECT(assert_equal(errorExpected, errorActual, 1e-6));
177 
178  // Check Derivatives
179  Values values;
180  values.insert(R(1), Ri);
181  values.insert(R(2), Rj);
182  values.insert(B(1), bias);
183  EXPECT_CORRECT_FACTOR_JACOBIANS(factor, values, 1e-5, 1e-6);
184 }
185 
186 //******************************************************************************
187 TEST(AHRSFactor, PartialDerivativeExpmap) {
188  // Linearization point
189  Vector3 biasOmega(0, 0, 0);
190 
191  // Measurements
192  Vector3 measuredOmega(0.1, 0, 0);
193  double deltaT = 0.5;
194 
195  auto f = [&](const Vector3& biasOmega) {
196  return Rot3::Expmap((measuredOmega - biasOmega) * deltaT);
197  };
198 
199  // Compute numerical derivatives
200  Matrix expectedH = numericalDerivative11<Rot3, Vector3>(f, biasOmega);
201 
202  const Matrix3 Jr =
203  Rot3::ExpmapDerivative((measuredOmega - biasOmega) * deltaT);
204 
205  Matrix3 actualH = -Jr * deltaT; // the delta bias appears with the minus sign
206 
207  // Compare Jacobians
208  EXPECT(assert_equal(expectedH, actualH, 1e-3));
209  // 1e-3 needs to be added only when using quaternions for rotations
210 }
211 
212 //******************************************************************************
213 TEST(AHRSFactor, PartialDerivativeLogmap) {
214  // Linearization point
215  Vector3 thetaHat(0.1, 0.1, 0);
216 
217  auto f = [thetaHat](const Vector3 deltaTheta) {
218  return Rot3::Logmap(
219  Rot3::Expmap(thetaHat).compose(Rot3::Expmap(deltaTheta)));
220  };
221 
222  // Compute numerical derivatives
223  Vector3 deltaTheta(0, 0, 0);
224  Matrix expectedH = numericalDerivative11<Vector3, Vector3>(f, deltaTheta);
225 
226  const Vector3 x = thetaHat; // parametrization of so(3)
227  const Matrix3 X = skewSymmetric(x); // element of Lie algebra so(3): X = x^
228  double norm = x.norm();
229  const Matrix3 actualH =
230  I_3x3 + 0.5 * X +
231  (1 / (norm * norm) - (1 + cos(norm)) / (2 * norm * sin(norm))) * X * X;
232 
233  // Compare Jacobians
234  EXPECT(assert_equal(expectedH, actualH));
235 }
236 
237 //******************************************************************************
238 TEST(AHRSFactor, fistOrderExponential) {
239  // Linearization point
240  Vector3 biasOmega(0, 0, 0);
241 
242  // Measurements
243  Vector3 measuredOmega(0.1, 0, 0);
244  double deltaT = 1.0;
245 
246  // change w.r.t. linearization point
247  double alpha = 0.0;
248  Vector3 deltaBiasOmega(alpha, alpha, alpha);
249 
250  const Matrix3 Jr =
251  Rot3::ExpmapDerivative((measuredOmega - biasOmega) * deltaT);
252 
253  Matrix3 delRdelBiasOmega =
254  -Jr * deltaT; // the delta bias appears with the minus sign
255 
256  const Matrix expectedRot =
257  Rot3::Expmap((measuredOmega - biasOmega - deltaBiasOmega) * deltaT)
258  .matrix();
259 
260  const Matrix3 hatRot =
261  Rot3::Expmap((measuredOmega - biasOmega) * deltaT).matrix();
262  const Matrix3 actualRot =
263  hatRot * Rot3::Expmap(delRdelBiasOmega * deltaBiasOmega).matrix();
264 
265  // Compare Jacobians
266  EXPECT(assert_equal(expectedRot, actualRot));
267 }
268 
269 //******************************************************************************
270 TEST(AHRSFactor, FirstOrderPreIntegratedMeasurements) {
271  // Linearization point
272  Vector3 bias = Vector3::Zero();
273 
274  Pose3 body_P_sensor(Rot3::Expmap(Vector3(0, 0.1, 0.1)), Point3(1, 0, 1));
275 
276  // Measurements
277  list<Vector3> measuredOmegas;
278  list<double> deltaTs;
279  measuredOmegas.push_back(Vector3(M_PI / 100.0, 0.0, 0.0));
280  deltaTs.push_back(0.01);
281  measuredOmegas.push_back(Vector3(M_PI / 100.0, 0.0, 0.0));
282  deltaTs.push_back(0.01);
283  for (int i = 1; i < 100; i++) {
284  measuredOmegas.push_back(
285  Vector3(M_PI / 100.0, M_PI / 300.0, 2 * M_PI / 100.0));
286  deltaTs.push_back(0.01);
287  }
288 
289  // Actual preintegrated values
290  PreintegratedAhrsMeasurements preintegrated =
291  integrateMeasurements(bias, measuredOmegas, deltaTs);
292 
293  auto f = [&](const Vector3& bias) {
294  return integrateMeasurements(bias, measuredOmegas, deltaTs).deltaRij();
295  };
296 
297  // Compute numerical derivatives
298  Matrix expectedDelRdelBias = numericalDerivative11<Rot3, Vector3>(f, bias);
299  Matrix expectedDelRdelBiasOmega = expectedDelRdelBias.rightCols(3);
300 
301  // Compare Jacobians
302  EXPECT(assert_equal(expectedDelRdelBiasOmega,
303  preintegrated.delRdelBiasOmega(), 1e-3));
304  // 1e-3 needs to be added only when using quaternions for rotations
305 }
306 
307 //******************************************************************************
308 TEST(AHRSFactor, ErrorWithBiasesAndSensorBodyDisplacement) {
309  Vector3 bias(0, 0, 0.3);
310  Rot3 Ri(Rot3::Expmap(Vector3(0, 0, M_PI / 4.0)));
311  Rot3 Rj(Rot3::Expmap(Vector3(0, 0, M_PI / 4.0 + M_PI / 10.0)));
312 
313  // Measurements
314  Vector3 omegaCoriolis;
315  omegaCoriolis << 0, 0.1, 0.1;
316  Vector3 measuredOmega(0, 0, M_PI / 10.0 + 0.3);
317  double deltaT = 1.0;
318 
319  auto p = std::make_shared<PreintegratedAhrsMeasurements::Params>();
320  p->gyroscopeCovariance = kMeasuredOmegaCovariance;
321  p->body_P_sensor = Pose3(Rot3::Expmap(Vector3(1, 2, 3)), Point3(1, 0, 0));
322  PreintegratedAhrsMeasurements pim(p, Vector3::Zero());
323 
325 
326  // Check preintegrated covariance
328 
329  // Create factor
330  AHRSFactor factor(R(1), R(2), B(1), pim, omegaCoriolis);
331 
332  // Check Derivatives
333  Values values;
334  values.insert(R(1), Ri);
335  values.insert(R(2), Rj);
336  values.insert(B(1), bias);
337  EXPECT_CORRECT_FACTOR_JACOBIANS(factor, values, 1e-5, 1e-6);
338 }
339 
340 //******************************************************************************
341 TEST(AHRSFactor, predictTest) {
342  Vector3 bias(0, 0, 0);
343 
344  // Measurements
345  Vector3 measuredOmega(0, 0, M_PI / 10.0);
346  double deltaT = 0.2;
348  for (int i = 0; i < 1000; ++i) {
350  }
351  // Check preintegrated covariance
352  Matrix expectedMeasCov(3, 3);
353  expectedMeasCov = 200 * kMeasuredOmegaCovariance;
354  EXPECT(assert_equal(expectedMeasCov, pim.preintMeasCov()));
355 
356  AHRSFactor factor(R(1), R(2), B(1), pim, kZeroOmegaCoriolis);
357 
358  // Predict
359  Rot3 x;
360  Rot3 expectedRot = Rot3::Ypr(20 * M_PI, 0, 0);
361  Rot3 actualRot = factor.predict(x, bias, pim, kZeroOmegaCoriolis);
362  EXPECT(assert_equal(expectedRot, actualRot, 1e-6));
363 
364  // PreintegratedAhrsMeasurements::predict
365  Matrix expectedH = numericalDerivative11<Vector3, Vector3>(
366  [&pim](const Vector3& b) { return pim.predict(b, {}); }, bias);
367 
368  // Actual Jacobians
369  Matrix H;
370  (void)pim.predict(bias, H);
371  EXPECT(assert_equal(expectedH, H, 1e-8));
372 }
373 //******************************************************************************
374 TEST(AHRSFactor, graphTest) {
375  // linearization point
376  Rot3 Ri(Rot3::RzRyRx(0, 0, 0));
377  Rot3 Rj(Rot3::RzRyRx(0, M_PI / 4, 0));
378  Vector3 bias(0, 0, 0);
379 
380  // PreIntegrator
381  Vector3 biasHat(0, 0, 0);
383 
384  // Pre-integrate measurements
385  Vector3 measuredOmega(0, M_PI / 20, 0);
386  double deltaT = 1;
387 
388  // Create Factor
390  noiseModel::Gaussian::Covariance(pim.preintMeasCov());
392  Values values;
393  for (size_t i = 0; i < 5; ++i) {
395  }
396 
397  // pim.print("Pre integrated measurements");
398  AHRSFactor factor(R(1), R(2), B(1), pim, kZeroOmegaCoriolis);
399  values.insert(R(1), Ri);
400  values.insert(R(2), Rj);
401  values.insert(B(1), bias);
402  graph.push_back(factor);
404  Values result = optimizer.optimize();
405  Rot3 expectedRot(Rot3::RzRyRx(0, M_PI / 4, 0));
406  EXPECT(assert_equal(expectedRot, result.at<Rot3>(R(2))));
407 }
408 
409 /* ************************************************************************* */
410 TEST(AHRSFactor, bodyPSensorWithBias) {
411  using noiseModel::Diagonal;
412 
413  int numRotations = 10;
414  const Vector3 noiseBetweenBiasSigma(3.0e-6, 3.0e-6, 3.0e-6);
415  SharedDiagonal biasNoiseModel = Diagonal::Sigmas(noiseBetweenBiasSigma);
416 
417  // Measurements in the sensor frame:
418  const double omega = 0.1;
419  const Vector3 realOmega(omega, 0, 0);
420  const Vector3 realBias(1, 2, 3); // large !
421  const Vector3 measuredOmega = realOmega + realBias;
422 
423  auto p = std::make_shared<PreintegratedAhrsMeasurements::Params>();
424  p->body_P_sensor = Pose3(Rot3::Yaw(M_PI_2), Point3(0, 0, 0));
425  p->gyroscopeCovariance = 1e-8 * I_3x3;
426  double deltaT = 0.005;
427 
428  // Specify noise values on priors
429  const Vector3 priorNoisePoseSigmas(0.001, 0.001, 0.001);
430  const Vector3 priorNoiseBiasSigmas(0.5e-1, 0.5e-1, 0.5e-1);
431  SharedDiagonal priorNoisePose = Diagonal::Sigmas(priorNoisePoseSigmas);
432  SharedDiagonal priorNoiseBias = Diagonal::Sigmas(priorNoiseBiasSigmas);
433 
434  // Create a factor graph with priors on initial pose, velocity and bias
436  Values values;
437 
438  graph.addPrior(R(0), Rot3(), priorNoisePose);
439  values.insert(R(0), Rot3());
440 
441  // The key to this test is that we specify the bias, in the sensor frame, as
442  // known a priori. We also create factors below that encode our assumption
443  // that this bias is constant over time In theory, after optimization, we
444  // should recover that same bias estimate
445  graph.addPrior(B(0), realBias, priorNoiseBias);
446  values.insert(B(0), realBias);
447 
448  // Now add IMU factors and bias noise models
449  const Vector3 zeroBias(0, 0, 0);
450  for (int i = 1; i < numRotations; i++) {
451  PreintegratedAhrsMeasurements pim(p, realBias);
452  for (int j = 0; j < 200; ++j)
454 
455  // Create factors
456  graph.emplace_shared<AHRSFactor>(R(i - 1), R(i), B(i - 1), pim);
457  graph.emplace_shared<BetweenFactor<Vector3> >(B(i - 1), B(i), zeroBias,
458  biasNoiseModel);
459 
460  values.insert(R(i), Rot3());
461  values.insert(B(i), realBias);
462  }
463 
464  // Finally, optimize, and get bias at last time step
466  // params.setVerbosityLM("SUMMARY");
468  const Vector3 biasActual = result.at<Vector3>(B(numRotations - 1));
469 
470  // Bias should be a self-fulfilling prophesy:
471  EXPECT(assert_equal(realBias, biasActual, 1e-3));
472 
473  // Check that the successive rotations are all `omega` apart:
474  for (int i = 0; i < numRotations; i++) {
475  Rot3 expectedRot = Rot3::Pitch(omega * i);
476  Rot3 actualRot = result.at<Rot3>(R(i));
477  EXPECT(assert_equal(expectedRot, actualRot, 1e-3));
478  }
479 }
480 
481 //******************************************************************************
482 int main() {
483  TestResult tr;
484  return TestRegistry::runAllTests(tr);
485 }
486 //******************************************************************************
TestRegistry::runAllTests
static int runAllTests(TestResult &result)
Definition: TestRegistry.cpp:27
gtsam::AHRSFactor::predict
static Rot3 predict(const Rot3 &rot_i, const Vector3 &bias, const PreintegratedAhrsMeasurements &pim, const Vector3 &omegaCoriolis, const std::optional< Pose3 > &body_P_sensor={})
Definition: AHRSFactor.cpp:199
H
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate set rrange[*:*] noreverse nowriteback set trange[*:*] noreverse nowriteback set urange[*:*] noreverse nowriteback set vrange[*:*] noreverse nowriteback set xlabel matrix size set x2label set timefmt d m y n H
Definition: gnuplot_common_settings.hh:74
gtsam::NonlinearOptimizer::optimize
virtual const Values & optimize()
Definition: NonlinearOptimizer.h:98
GaussianFactorGraph.h
Linear Factor Graph where all factors are Gaussians.
B
Matrix< SCALARB, Dynamic, Dynamic, opt_B > B
Definition: bench_gemm.cpp:49
EXPECT_CORRECT_FACTOR_JACOBIANS
#define EXPECT_CORRECT_FACTOR_JACOBIANS(factor, values, numerical_derivative_step, tolerance)
Check the Jacobians produced by a factor against finite differences.
Definition: factorTesting.h:114
gtsam::AHRSFactor
Definition: AHRSFactor.h:135
gtsam::PreintegratedRotationParams
Definition: PreintegratedRotation.h:57
gtsam::PreintegratedRotation::delRdelBiasOmega
const Matrix3 & delRdelBiasOmega() const
Definition: PreintegratedRotation.h:166
alpha
RealScalar alpha
Definition: level1_cplx_impl.h:147
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
ceres::sin
Jet< T, N > sin(const Jet< T, N > &f)
Definition: jet.h:439
EXPECT
#define EXPECT(condition)
Definition: Test.h:150
AHRSFactor.h
gtsam::noiseModel::Base::shared_ptr
std::shared_ptr< Base > shared_ptr
Definition: NoiseModel.h:60
TestHarness.h
b
Scalar * b
Definition: benchVecAdd.cpp:17
LevenbergMarquardtOptimizer.h
A nonlinear optimizer that uses the Levenberg-Marquardt trust-region scheme.
gtsam::PreintegratedRotation::deltaRij
const Rot3 & deltaRij() const
Definition: PreintegratedRotation.h:165
kMeasuredOmegaCovariance
const Matrix3 kMeasuredOmegaCovariance
Definition: testAHRSFactor.cpp:51
gtsam::PreintegratedAhrsMeasurements::biasHat
const Vector3 & biasHat() const
Definition: AHRSFactor.h:81
x
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition: gnuplot_common_settings.hh:12
biased_x_rotation::bias
const Vector3 bias(1, 2, 3)
gtsam::Matrix
Eigen::MatrixXd Matrix
Definition: base/Matrix.h:39
different_sigmas::values
HybridValues values
Definition: testHybridBayesNet.cpp:245
X
#define X
Definition: icosphere.cpp:20
gtsam::Vector3
Eigen::Vector3d Vector3
Definition: Vector.h:43
testing::integrateMeasurements
void integrateMeasurements(const vector< ImuMeasurement > &measurements, PIM *pim)
Definition: imuFactorTesting.h:59
vanilla::params
static const SmartProjectionParams params
Definition: smartFactorScenarios.h:69
LevenbergMarquardtParams.h
Parameters for Levenberg-Marquardt trust-region scheme.
body_P_sensor
static Pose3 body_P_sensor(Rot3::RzRyRx(-M_PI_2, 0.0, -M_PI_2), Point3(0.25, -0.10, 1.0))
gtsam::skewSymmetric
Matrix3 skewSymmetric(double wx, double wy, double wz)
Definition: base/Matrix.h:400
result
Values result
Definition: OdometryOptimize.cpp:8
gtsam::PreintegratedAhrsMeasurements::predict
Vector3 predict(const Vector3 &bias, OptionalJacobian< 3, 3 > H={}) const
Definition: AHRSFactor.cpp:64
gtsam::AHRSFactor::evaluateError
Vector evaluateError(const Rot3 &rot_i, const Rot3 &rot_j, const Vector3 &bias, OptionalMatrixType H1, OptionalMatrixType H2, OptionalMatrixType H3) const override
vector of errors
Definition: AHRSFactor.cpp:122
ceres::cos
Jet< T, N > cos(const Jet< T, N > &f)
Definition: jet.h:426
TestableAssertions.h
Provides additional testing facilities for common data structures.
biased_x_rotation::omega
const double omega
Definition: testPreintegratedRotation.cpp:32
common::deltaT
static const double deltaT
Definition: testImuFactor.cpp:183
gtsam::PreintegratedRotationParams::getOmegaCoriolis
std::optional< Vector3 > getOmegaCoriolis() const
Definition: PreintegratedRotation.h:84
Expmap
Pose2_ Expmap(const Vector3_ &xi)
Definition: InverseKinematicsExampleExpressions.cpp:47
gtsam::Values::at
const ValueType at(Key j) const
Definition: Values-inl.h:261
numericalDerivative.h
Some functions to compute numerical derivatives.
gtsam::PreintegratedRotationParams::getGyroscopeCovariance
const Matrix3 & getGyroscopeCovariance() const
Definition: PreintegratedRotation.h:83
biased_x_rotation::measuredOmega
const Vector3 measuredOmega
Definition: testPreintegratedRotation.cpp:35
j
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2
BetweenFactor.h
gtsam::Rot3
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
Definition: Rot3.h:58
gtsam::PreintegratedAhrsMeasurements
Definition: AHRSFactor.h:36
gtsam::Pose3
Definition: Pose3.h:37
DOUBLES_EQUAL
#define DOUBLES_EQUAL(expected, actual, threshold)
Definition: Test.h:141
gtsam::NonlinearFactorGraph
Definition: NonlinearFactorGraph.h:55
gtsam::SharedDiagonal
noiseModel::Diagonal::shared_ptr SharedDiagonal
Definition: NoiseModel.h:764
gtsam::NonlinearFactorGraph::addPrior
void addPrior(Key key, const T &prior, const SharedNoiseModel &model=nullptr)
Definition: NonlinearFactorGraph.h:199
factorTesting.h
Evaluate derivatives of a nonlinear factor numerically.
gtsam::LevenbergMarquardtOptimizer
Definition: LevenbergMarquardtOptimizer.h:35
Symbol.h
gtsam::HybridValues::insert
void insert(Key j, const Vector &value)
Definition: HybridValues.cpp:85
model
noiseModel::Diagonal::shared_ptr model
Definition: doc/Code/Pose2SLAMExample.cpp:7
TestResult
Definition: TestResult.h:26
gyroNoiseVar
double gyroNoiseVar
Definition: testAHRSFactor.cpp:50
gtsam::PreintegratedAhrsMeasurements::integrateMeasurement
void integrateMeasurement(const Vector3 &measuredOmega, double deltaT)
Definition: AHRSFactor.cpp:50
M_PI_2
#define M_PI_2
Definition: mconf.h:118
tree::f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Definition: testExpression.cpp:218
gtsam::PreintegratedRotation::deltaTij
const double & deltaTij() const
Definition: PreintegratedRotation.h:164
gtsam::PreintegratedAhrsMeasurements::preintMeasCov
const Matrix3 & preintMeasCov() const
Definition: AHRSFactor.h:82
gtsam
traits
Definition: SFMdata.h:40
Marginals.h
A class for computing marginals in a NonlinearFactorGraph.
kZeroOmegaCoriolis
Vector3 kZeroOmegaCoriolis(0, 0, 0)
NonlinearFactorGraph.h
Factor Graph consisting of non-linear factors.
gtsam::FactorGraph::push_back
IsDerived< DERIVEDFACTOR > push_back(std::shared_ptr< DERIVEDFACTOR > factor)
Add a factor directly using a shared_ptr.
Definition: FactorGraph.h:147
gtsam::Values
Definition: Values.h:65
gtsam::PreintegratedAhrsMeasurements::p
Params & p() const
Definition: AHRSFactor.h:80
gtsam::testing::compose
T compose(const T &t1, const T &t2)
Definition: lieProxies.h:39
std
Definition: BFloat16.h:88
p
float * p
Definition: Tutorial_Map_using.cpp:9
gtsam::Diagonal
static noiseModel::Diagonal::shared_ptr Diagonal(const Matrix &covariance)
Definition: ScenarioRunner.h:27
gtsam::assert_equal
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Definition: Matrix.cpp:40
gtsam::LevenbergMarquardtParams
Definition: LevenbergMarquardtParams.h:35
gtsam::Point3
Vector3 Point3
Definition: Point3.h:38
main
int main()
Definition: testAHRSFactor.cpp:482
M_PI
#define M_PI
Definition: mconf.h:117
graph
NonlinearFactorGraph graph
Definition: doc/Code/OdometryExample.cpp:2
ceres::Vector
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
Definition: gtsam/3rdparty/ceres/eigen.h:38
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9
TEST
TEST(AHRSFactor, PreintegratedAhrsMeasurements)
Definition: testAHRSFactor.cpp:71
R
Rot2 R(Rot2::fromAngle(0.1))
gtsam::FactorGraph::emplace_shared
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&... args)
Emplace a shared pointer to factor of given type.
Definition: FactorGraph.h:153
debug.h
Global debugging flags.
gtsam::BetweenFactor
Definition: BetweenFactor.h:40


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:07:10