BarometricFactor.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 
19 #include "BarometricFactor.h"
20 
21 using namespace std;
22 
23 namespace gtsam {
24 
25 //***************************************************************************
26 void BarometricFactor::print(const string& s,
27  const KeyFormatter& keyFormatter) const {
28  cout << (s.empty() ? "" : s + " ") << "Barometric Factor on "
29  << keyFormatter(key<1>()) << "Barometric Bias on "
30  << keyFormatter(key<2>()) << "\n";
31 
32  cout << " Baro measurement: " << nT_ << "\n";
33  noiseModel_->print(" noise model: ");
34 }
35 
36 //***************************************************************************
37 bool BarometricFactor::equals(const NonlinearFactor& expected,
38  double tol) const {
39  const This* e = dynamic_cast<const This*>(&expected);
40  return e != nullptr && Base::equals(*e, tol) &&
41  traits<double>::Equals(nT_, e->nT_, tol);
42 }
43 
44 //***************************************************************************
45 Vector BarometricFactor::evaluateError(const Pose3& p, const double& bias,
47  OptionalMatrixType H2) const {
48  Matrix tH;
49  Vector ret = (Vector(1) << (p.translation(tH).z() + bias - nT_)).finished();
50  if (H) (*H) = tH.block<1, 6>(2, 0);
51  if (H2) (*H2) = (Matrix(1, 1) << 1.0).finished();
52  return ret;
53 }
54 
55 } // namespace gtsam
const Point3 & translation(OptionalJacobian< 3, 6 > Hself={}) const
get translation
Definition: Pose3.cpp:308
Matrix expected
Definition: testMatrix.cpp:971
Eigen::MatrixXd Matrix
Definition: base/Matrix.h:39
Definition: BFloat16.h:88
EIGEN_STRONG_INLINE Packet4f print(const Packet4f &a)
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
Matrix * OptionalMatrixType
Eigen::VectorXd Vector
Definition: Vector.h:38
Array< double, 1, 3 > e(1./3., 0.5, 2.)
RealScalar s
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:35
DenseIndex ret
traits
Definition: chartTesting.h:28
Header file for Barometric factor.
float * p
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > Matrix
const G double tol
Definition: Group.h:86
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:33:57