simulated3D.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 // \callgraph
19 
20 #pragma once
21 
22 #include <gtsam/base/Matrix.h>
23 #include <gtsam/geometry/Point3.h>
27 
28 // \namespace
29 
30 namespace gtsam {
31 namespace simulated3D {
32 
43  if (H) *H = I_3x3;
44  return x;
45 }
46 
50 Point3 odo(const Point3& x1, const Point3& x2,
53  if (H1) *H1 = -1 * I_3x3;
54  if (H2) *H2 = I_3x3;
55  return x2 - x1;
56 }
57 
61 Point3 mea(const Point3& x, const Point3& l,
64  if (H1) *H1 = -1 * I_3x3;
65  if (H2) *H2 = I_3x3;
66  return l - x;
67 }
68 
72 struct PointPrior3D: public NoiseModelFactor1<Point3> {
73  using NoiseModelFactor1<Point3>::evaluateError;
74 
76 
84  NoiseModelFactorN<Point3> (model, key), measured_(measured) {
85  }
86 
94  Vector evaluateError(const Point3& x, OptionalMatrixType H) const override {
95  return simulated3D::prior(x, H) - measured_;
96  }
97 };
98 
102 struct Simulated3DMeasurement: public NoiseModelFactorN<Point3, Point3> {
103  using NoiseModelFactor2<Point3, Point3>::evaluateError;
104 
106 
115  NoiseModelFactorN<Point3, Point3>(model, i, j), measured_(measured) {}
116 
126  OptionalMatrixType H1, OptionalMatrixType H2) const override {
127  return mea(x1, x2, H1, H2) - measured_;
128  }
129 };
130 
131 }} // namespace simulated3D
const gtsam::Symbol key('X', 0)
Point2 measured(-17, 30)
PointPrior3D(const Point3 &measured, const SharedNoiseModel &model, Key key)
Definition: simulated3D.h:83
noiseModel::Diagonal::shared_ptr model
Vector evaluateError(const Point3 &x1, const Point3 &x2, OptionalMatrixType H1, OptionalMatrixType H2) const override
Definition: simulated3D.h:125
Pose3 x2(Rot3::Ypr(0.0, 0.0, 0.0), l2)
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
Point3 mea(const Point3 &x, const Point3 &l, OptionalJacobian< 3, 3 > H1=OptionalNone, OptionalJacobian< 3, 3 > H2=OptionalNone)
Definition: simulated3D.h:61
#define OptionalNone
Factor Graph Values.
static const Line3 l(Rot3(), 1, 1)
Matrix * OptionalMatrixType
Eigen::VectorXd Vector
Definition: Vector.h:38
traits
Definition: chartTesting.h:28
#define NoiseModelFactor1
Simulated3DMeasurement(const Point3 &measured, const SharedNoiseModel &model, Key i, Key j)
Definition: simulated3D.h:114
Point3 measured_
The prior pose value for the variable attached to this factor.
Definition: simulated3D.h:75
Point3 prior(const Point3 &x, OptionalJacobian< 3, 3 > H=OptionalNone)
Definition: simulated3D.h:42
Vector evaluateError(const Point3 &x, OptionalMatrixType H) const override
Definition: simulated3D.h:94
Non-linear factor base classes.
Point3 odo(const Point3 &x1, const Point3 &x2, OptionalJacobian< 3, 3 > H1=OptionalNone, OptionalJacobian< 3, 3 > H2=OptionalNone)
Definition: simulated3D.h:50
Pose3 x1
Definition: testPose3.cpp:663
3D Point
Special class for optional Jacobian arguments.
Vector3 Point3
Definition: Point3.h:38
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
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:102
std::ptrdiff_t j
noiseModel::Base::shared_ptr SharedNoiseModel
Definition: NoiseModel.h:741
Point3 measured_
Linear displacement between a pose and landmark.
Definition: simulated3D.h:105


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