gtsam
Loading...
Searching...
No Matches
ExtendedKalmanFilter.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
19// \callgraph
20#pragma once
21
24
25namespace gtsam {
26
43
44template <class VALUE>
45class ExtendedKalmanFilter {
46 // Check that VALUE type is a testable Manifold
47 GTSAM_CONCEPT_ASSERT(IsTestable<VALUE>);
48 GTSAM_CONCEPT_ASSERT(IsManifold<VALUE>);
49
50 public:
51 typedef std::shared_ptr<ExtendedKalmanFilter<VALUE> > shared_ptr;
52 typedef VALUE T;
53
54 protected:
55 T x_; // linearization point
56 JacobianFactor::shared_ptr priorFactor_; // Gaussian density on x_
57
58 static T solve_(const GaussianFactorGraph& linearFactorGraph, const Values& linearizationPoints,
59 Key x, JacobianFactor::shared_ptr* newPrior);
60
61 public:
64
65 ExtendedKalmanFilter(Key key_initial, T x_initial, noiseModel::Gaussian::shared_ptr P_initial);
66
70
72 void print(const std::string& s = "") const {
73 std::cout << s << "\n";
74 x_.print(s + "x");
75 priorFactor_->print(s + "density");
76 }
77
81
87 T predict(const NoiseModelFactor& motionFactor);
88
93 T update(const NoiseModelFactor& measurementFactor);
94
97 return priorFactor_;
98 }
99
101};
102
103} // namespace
104
Class to perform generic Kalman Filtering using nonlinear factor graphs.
Factor Graph consisting of non-linear factors.
Non-linear factor base classes.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:43
Manifold concept.
Definition Manifold.h:172
A testable concept check that should be placed in applicable unit tests and in generic algorithms.
Definition Testable.h:59
A Linear Factor Graph is a factor graph where all factors are Gaussian, i.e.
Definition GaussianFactorGraph.h:77
std::shared_ptr< This > shared_ptr
shared_ptr to this class
Definition JacobianFactor.h:97
T update(const NoiseModelFactor &measurementFactor)
Calculate posterior density P(x_) ~ L(z|x) P(x) The likelihood L(z|x) should be given as a unary fact...
Definition ExtendedKalmanFilter-inl.h:106
const JacobianFactor::shared_ptr Density() const
Return current predictive (if called after predict)/posterior (if called after update).
Definition ExtendedKalmanFilter.h:96
T predict(const NoiseModelFactor &motionFactor)
Calculate predictive density The motion model should be given as a factor with key1 for and key2 fo...
Definition ExtendedKalmanFilter-inl.h:81
void print(const std::string &s="") const
print
Definition ExtendedKalmanFilter.h:72
A nonlinear sum-of-squares factor with a zero-mean noise model implementing the density Templated on...
Definition NonlinearFactor.h:208
A non-templated config holding any types of Manifold-group elements.
Definition Values.h:65