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>
26 
27 // \namespace
28 
29 namespace gtsam {
30 namespace simulated3D {
31 
41 Point3 prior(const Point3& x, boost::optional<Matrix&> H = boost::none) {
42  if (H) *H = I_3x3;
43  return x;
44 }
45 
49 Point3 odo(const Point3& x1, const Point3& x2,
50  boost::optional<Matrix&> H1 = boost::none,
51  boost::optional<Matrix&> H2 = boost::none) {
52  if (H1) *H1 = -1 * I_3x3;
53  if (H2) *H2 = I_3x3;
54  return x2 - x1;
55 }
56 
60 Point3 mea(const Point3& x, const Point3& l,
61  boost::optional<Matrix&> H1 = boost::none,
62  boost::optional<Matrix&> H2 = boost::none) {
63  if (H1) *H1 = -1 * I_3x3;
64  if (H2) *H2 = I_3x3;
65  return l - x;
66 }
67 
71 struct PointPrior3D: public NoiseModelFactor1<Point3> {
72 
74 
82  NoiseModelFactor1<Point3> (model, key), measured_(measured) {
83  }
84 
92  Vector evaluateError(const Point3& x, boost::optional<Matrix&> H =
93  boost::none) const override {
94  return prior(x, H) - measured_;
95  }
96 };
97 
101 struct Simulated3DMeasurement: public NoiseModelFactor2<Point3, Point3> {
102 
104 
113  NoiseModelFactor2<Point3, Point3>(model, i, j), measured_(measured) {}
114 
124  boost::optional<Matrix&> H1 = boost::none, boost::optional<Matrix&> H2 = boost::none) const override {
125  return mea(x1, x2, H1, H2) - measured_;
126  }
127 };
128 
129 }} // namespace simulated3D
PointPrior3D(const Point3 &measured, const SharedNoiseModel &model, Key key)
Definition: simulated3D.h:81
noiseModel::Diagonal::shared_ptr model
Point3 odo(const Point3 &x1, const Point3 &x2, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none)
Definition: simulated3D.h:49
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
Vector evaluateError(const Point3 &x, boost::optional< Matrix & > H=boost::none) const override
Definition: simulated3D.h:92
Point3 mea(const Point3 &x, const Point3 &l, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none)
Definition: simulated3D.h:60
Factor Graph Values.
static const Line3 l(Rot3(), 1, 1)
Eigen::VectorXd Vector
Definition: Vector.h:38
Vector evaluateError(const Point3 &x1, const Point3 &x2, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none) const override
Definition: simulated3D.h:123
traits
Definition: chartTesting.h:28
Simulated3DMeasurement(const Point3 &measured, const SharedNoiseModel &model, Key i, Key j)
Definition: simulated3D.h:112
Point3 measured_
The prior pose value for the variable attached to this factor.
Definition: simulated3D.h:73
Non-linear factor base classes.
Pose3 x1
Definition: testPose3.cpp:588
3D Point
Vector3 Point3
Definition: Point3.h:35
Point3 measured
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
Point3 prior(const Point3 &x, boost::optional< Matrix & > H=boost::none)
Definition: simulated3D.h:41
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:61
std::ptrdiff_t j
noiseModel::Base::shared_ptr SharedNoiseModel
Definition: NoiseModel.h:734
Point3 measured_
Linear displacement between a pose and landmark.
Definition: simulated3D.h:103


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:44:12