XYFactor.h
Go to the documentation of this file.
1 
13 #pragma once
14 
16 #include <gtsam/base/Matrix.h>
17 #include <gtsam/base/Vector.h>
18 #include <gtsam/geometry/Pose2.h>
19 
20 
21 namespace rtabmap {
22 
23 template<class VALUE>
24 class XYFactor: public gtsam::NoiseModelFactor1<VALUE> {
25 
26 private:
27  // measurement information
28  double mx_, my_;
29 
30 public:
31 
40 
41  // error function
42  // @param p the pose in Pose2
43  // @param H the optional Jacobian matrix, which use boost optional and has default null pointer
44  gtsam::Vector evaluateError(const VALUE& p,
45 #if GTSAM_VERSION_NUMERIC >= 40300
46  OptionalMatrixType H = OptionalNone) const {
47 #else
48  boost::optional<gtsam::Matrix&> H = boost::none) const {
49 #endif
50 
51  // note that use boost optional like a pointer
52  // only calculate jacobian matrix when non-null pointer exists
53  if (H) *H = (gtsam::Matrix23() << 1.0, 0.0, 0.0,
54  0.0, 1.0, 0.0).finished();
55 
56  // return error vector
57  return (gtsam::Vector2() << p.x() - mx_, p.y() - my_).finished();
58  }
59 
60 };
61 
62 } // namespace gtsamexamples
63 
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
Pose2.h
gtsam::Vector2
Eigen::Vector2d Vector2
rtabmap::XYFactor::my_
double my_
Definition: XYFactor.h:28
rtabmap::XYFactor::mx_
double mx_
Definition: XYFactor.h:28
y
Matrix3f y
gtsam::Vector
Eigen::VectorXd Vector
poseKey
const gtsam::Key poseKey
VALUE
VALUE
NoiseModelFactor1
#define NoiseModelFactor1
NonlinearFactor.h
rtabmap::XYFactor::evaluateError
gtsam::Vector evaluateError(const VALUE &p, boost::optional< gtsam::Matrix & > H=boost::none) const
Definition: XYFactor.h:44
x
x
m
Matrix3f m
gtsam::Point2
Vector2 Point2
p
Point3_ p(2)
gtsam::SharedNoiseModel
noiseModel::Base::shared_ptr SharedNoiseModel
gtsam
rtabmap::XYFactor
Definition: XYFactor.h:24
Eigen.Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor >
gtsam::Key
std::uint64_t Key
rtabmap
Definition: CameraARCore.cpp:35
rtabmap::XYFactor::XYFactor
XYFactor(gtsam::Key poseKey, const gtsam::Point2 m, gtsam::SharedNoiseModel model)
Definition: XYFactor.h:38
trace.model
model
Definition: trace.py:4
Vector.h


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:24