Generic Linear Kalman Filter template base class. More...
#include <kfilter.hpp>
Public Member Functions | |
virtual | ~KFilter ()=0 |
Virtual destructor. More... | |
Public Member Functions inherited from Kalman::EKFilter< T, BEG, OQ, OVR, DBG > | |
void | init (Vector &x_, Matrix &P_) |
Sets initial conditions for the Kalman Filter. More... | |
EKFilter () | |
Default constructor. More... | |
EKFilter (K_UINT_32 n_, K_UINT_32 nu_, K_UINT_32 nw_, K_UINT_32 m_, K_UINT_32 nv_) | |
Constructors specifying all necessary matrix and vector dimensions. More... | |
virtual | ~EKFilter () |
Virtual destructor. More... | |
K_UINT_32 | getSizeX () const |
Returns the size of the state vector. More... | |
K_UINT_32 | getSizeU () const |
Returns the size of the input vector. More... | |
K_UINT_32 | getSizeW () const |
Returns the size of the process noise vector. More... | |
K_UINT_32 | getSizeZ () const |
Returns the size of the measurement vector. More... | |
K_UINT_32 | getSizeV () const |
Returns the size of the measurement noise vector. More... | |
void | setDim (K_UINT_32 n_, K_UINT_32 nu_, K_UINT_32 nw_, K_UINT_32 m_, K_UINT_32 nv_) |
Sets all dimensions at once. More... | |
void | setSizeX (K_UINT_32 n_) |
Sets the size of the state vector. More... | |
void | setSizeU (K_UINT_32 nu_) |
Sets the size of the input vector. More... | |
void | setSizeW (K_UINT_32 nw_) |
Sets the size of the process noise vector. More... | |
void | setSizeZ (K_UINT_32 m_) |
Sets the size of the measurement vector. More... | |
void | setSizeV (K_UINT_32 nv_) |
Sets the size of the measurement noise vector. More... | |
void | step (Vector &u_, const Vector &z_) |
Makes one prediction-correction step. More... | |
void | timeUpdateStep (Vector &u_) |
Makes one prediction step. More... | |
void | measureUpdateStep (const Vector &z_) |
Makes one correction step. More... | |
const Vector & | predict (Vector &u_) |
Returns the predicted state vector (a priori state estimate). More... | |
const Vector & | simulate () |
Returns the predicted measurement vector. More... | |
const Vector & | getX () const |
Returns the corrected state (a posteriori state estimate). More... | |
const Matrix & | calculateP () const |
Returns the a posteriori error covariance estimate matrix. More... | |
Protected Member Functions | |
virtual void | makeB () |
Virtual creator of B. More... | |
virtual void | makeBaseB () |
Virtual pre-creator of B. More... | |
Protected Member Functions inherited from Kalman::EKFilter< T, BEG, OQ, OVR, DBG > | |
void | NoModification () |
Allows optimizations on some calculations. More... | |
virtual void | makeBaseA () |
Virtual pre-creator of A. More... | |
virtual void | makeBaseW () |
Virtual pre-creator of W. More... | |
virtual void | makeBaseQ () |
Virtual pre-creator of Q. More... | |
virtual void | makeBaseH () |
Virtual pre-creator of H. More... | |
virtual void | makeBaseV () |
Virtual pre-creator of V. More... | |
virtual void | makeBaseR () |
Virtual pre-creator of R. More... | |
virtual void | makeCommonProcess () |
Optional function used to precalculate common values for process. More... | |
virtual void | makeA () |
Virtual creator of A. More... | |
virtual void | makeW () |
Virtual creator of W. More... | |
virtual void | makeQ () |
Virtual creator of Q. More... | |
virtual void | makeCommonMeasure () |
Optional function used to precalculate common values for measurement. More... | |
virtual void | makeH () |
Virtual creator of H. More... | |
virtual void | makeV () |
Virtual creator of V. More... | |
virtual void | makeR () |
Virtual creator of R. More... | |
virtual void | makeDZ () |
Hook-up function to modify innovation vector. More... | |
Protected Attributes | |
Matrix | B |
Input matrix. More... | |
Protected Attributes inherited from Kalman::EKFilter< T, BEG, OQ, OVR, DBG > | |
Vector | x |
Corrected state vector. More... | |
Vector | u |
Input vector. More... | |
Vector | z |
Predicted measurement vector. More... | |
Vector | dz |
Innovation vector. More... | |
Matrix | A |
A jacobian matrix. More... | |
Matrix | W |
A jacobian matrix. More... | |
Matrix | Q |
Process noise covariance matrix. More... | |
Matrix | H |
A jacobian matrix. More... | |
Matrix | V |
A jacobian matrix. More... | |
Matrix | R |
Measurement noise covariance matrix. More... | |
K_UINT_32 | n |
Size of the state vector. More... | |
K_UINT_32 | nu |
Size of the input vector. More... | |
K_UINT_32 | nw |
Size of the process noise vector. More... | |
K_UINT_32 | m |
Size of the measurement vector. More... | |
K_UINT_32 | nv |
Size of the measurement noise vector. More... | |
Private Member Functions | |
virtual void | makeMeasure () |
Measurement function overridden to be linear. More... | |
virtual void | makeProcess () |
Process function overridden to be linear. More... | |
virtual void | sizeUpdate () |
Matrix and vector resizing function, overridden to take B into account. More... | |
Private Attributes | |
Vector | x__ |
Temporary vector. More... | |
Additional Inherited Members | |
Public Types inherited from Kalman::EKFilter< T, BEG, OQ, OVR, DBG > | |
enum | { beg = BEG } |
typedef KMatrix< T, BEG, DBG > | Matrix |
Matrix type. More... | |
typedef T | type |
Type of objects contained in matrices and vectors. More... | |
typedef KVector< T, BEG, DBG > | Vector |
Vector type. More... | |
Generic Linear Kalman Filter template base class.
EKFilter
. You should really read all the documentation of EKFilter
before reading this. EKFilter
template class.where is the (known) input vector fed to the process and is the (unknown) process noise vector due to uncertainty and process modeling errors. Further suppose that the (known) process noise covariance matrix is :
Now, let's assume a (known) measurement vector , which depends on the current state in the form of a linear function (to model) :
where is the (unknown) measurement noise vector with a (known) covariance matrix :
Suppose that we have an estimate of the previous state , called a corrected state or an a posteriori state estimate. We can build a predicted state (also called an a priori state estimate) by using :
since the input is known and the process noise, unknown. With this predicted state, we can get a predicted measurement vector by using :
since the measurement noise is unknown.
makeProcess()
and makeMeasure()
have already been overridden, and cannot be ovverridden again. However, there is a new matrix to create : B. This means there are two new virtual functions that can be overridden : makeBaseB()
and makeB()
. EKFilter
Definition at line 83 of file kfilter.hpp.
|
pure virtual |
Virtual destructor.
Definition at line 36 of file kfilter_impl.hpp.
|
protectedvirtual |
Virtual creator of B.
Definition at line 42 of file kfilter_impl.hpp.
|
protectedvirtual |
Virtual pre-creator of B.
Definition at line 39 of file kfilter_impl.hpp.
|
privatevirtual |
Measurement function overridden to be linear.
Implements Kalman::EKFilter< T, BEG, OQ, OVR, DBG >.
Definition at line 70 of file kfilter_impl.hpp.
|
privatevirtual |
Process function overridden to be linear.
Implements Kalman::EKFilter< T, BEG, OQ, OVR, DBG >.
Definition at line 45 of file kfilter_impl.hpp.
|
privatevirtual |
Matrix and vector resizing function, overridden to take B into account.
Reimplemented from Kalman::EKFilter< T, BEG, OQ, OVR, DBG >.
Definition at line 88 of file kfilter_impl.hpp.
|
protected |
Input matrix.
Definition at line 98 of file kfilter.hpp.
|
private |
Temporary vector.
Definition at line 112 of file kfilter.hpp.