22#ifndef KALMANFILTERBASEHPP
23#define KALMANFILTERBASEHPP
25#include <state-observation/api.h>
27#include <state-observation/tools/state-vector-arithmetics.hpp>
68 typedef Eigen::LLT<Pmatrix> LLTPMatrix;
104 virtual Matrix getA()
const;
112 virtual Matrix getC()
const;
119 inline void setMeasurementCovariance(
const Rmatrix & R)
126 inline Matrix getMeasurementCovariance()
const
136 inline void setProcessCovariance(
const Qmatrix & Q)
143 inline Matrix getProcessCovariance()
const
370 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
376 LLTPMatrix inoMeasCovLLT;
385 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Pmatrix getPmatrixZero() const
Get a matrix having the size of the P matrix having zero values.
const StateVector & getLastPrediction() const
get the last predicted state
const MeasureVector & getLastMeasurement() const
get the last measurement
virtual StateVector prediction_(TimeIndex k)=0
The abstract method to overload to implement f(x,u).
Cmatrix getCmatrixZero() const
Get a matrix having the size of the C matrix having zero values.
Index mt_
the size of tangent space of the measurement space
KalmanFilterBase(Index n, Index m, Index p=0)
virtual MeasureVector predictSensor_(TimeIndex k)
Predicts the sensor measurement,.
const Matrix & getLastGain() const
get the last Kalman gain matrix
Matrix c_
Containers for the jacobian matrix of the measurement.
Rmatrix getRmatrixIdentity() const
Get an identity matrix having the size of the R matrix.
virtual void clearQ()
Clear the process noise covariance matrix.
virtual void clearC()
Clear the jacobian dh/dx.
virtual void setC(const Cmatrix &C)
Set the value of the Jacobian dh/dx.
Matrix Amatrix
The type of the jacobian df/dx.
bool checkQmatrix(const Qmatrix &) const
checks whether or not a matrix has the dimensions of the Q matrix
Rmatrix getRmatrixConstant(double c) const
Get a matrix having the size of the R matrix having "c" values.
virtual void clearA()
Clear the jacobian df/dx.
Matrix Pmatrix
The type of the covariance matrix of the state estimation error.
Cmatrix getCmatrixRandom() const
Get a matrix having the size of the C matrix having random values.
bool checkRmatrix(const Rmatrix &) const
checks whether or not a matrix has the dimensions of the R matrix
virtual MeasureVector simulateSensor_(const StateVector &x, TimeIndex k)=0
The abstract method to overload to implement h(x,u).
KalmanFilterBase()
Default constructor.
virtual void reset()
Resets all the observer.
KalmanFilterBase(Index n, Index nt, Index m, Index mt, Index p)
virtual StateVector oneStepEstimation_()
The Kalman filter loop.
virtual void setQ(const Qmatrix &Q)
Set the process noise covariance matrix.
Qmatrix getQmatrixRandom() const
Get a matrix having the size of the Q matrix having random values.
Matrix pr_
Container for the covariance matrix of the estimation error.
virtual MeasureVectorTan measureTangentVectorZero() const
Gives a vector of measurement tangent vector size having zero values.
virtual MeasureVector getSimulatedMeasurement(TimeIndex k)
Get simulation of the measurement y_k using the state estimation.
const StateVector & updateStatePrediction()
Qmatrix getQmatrixConstant(double c) const
Get a matrix having the size of the Q matrix having "c" values.
virtual void setStateSize(Index n)
Matrix r_
Container for the measurement noise covariance matrice.
Vector innovation_
Vector containing the inovation of the Kalman filter.
virtual void setMeasureSize(Index m, Index mt)
Amatrix getAmatrixRandom() const
Get a matrix having the size of the A matrix having random values.
virtual Pmatrix getStateCovariance() const
Get the covariance matrix of the current time state estimation.
virtual Matrix getR() const
Set the measurement noise covariance matrix.
IndexedVector xbar_
container for the prediction
void setStateArithmetics(StateVectorArithmetics *arith)
virtual MeasureVectorTan measureTangentVectorConstant(double c) const
Gives a vector of measurement tangent vector size having duplicated "c" value.
Qmatrix getQmatrixIdentity() const
Get an identity matrix having the size of the Q matrix.
Pmatrix getPmatrixConstant(double c) const
Get a matrix having the size of the P matrix having "c" values.
Vector MeasureVectorTan
MeasureVector is the type of measurement tanegnt vector.
Pmatrix getPmatrixRandom() const
Get a matrix having the size of the P matrix having random values.
Pmatrix getPmatrixIdentity() const
Get an identity matrix having the size of the P matrix.
virtual void setStateSize(Index n, Index nt)
Rmatrix getRmatrixRandom() const
Get a matrix having the size of the R matrix having random values.
Qmatrix getQmatrixZero() const
Get a matrix having the size of the Q matrix having zero values.
Matrix Kmatrix
The type of Kalman gain matrix.
virtual void clearStateCovariance()
IndexedVector ybar_
container for the prediction of the sensor
Matrix Qmatrix
The type of the covariance matrix of the process noise v.
Amatrix getAmatrixIdentity() const
Get an identity matrix having the size of the A matrix.
virtual bool checkMeasureTangentVector(const MeasureVectorTan &) const
Tells whether or not the vector has the dimensions of a measurement tangent vector.
Index nt_
the size of tangent space of the state space
Matrix a_
Containers for the jacobian matrix of the process.
Rmatrix getRmatrixZero() const
Get a matrix having the size of the R matrix having zero values.
Matrix q_
Container for the process noise covariance matrice.
virtual MeasureVectorTan measureTangentVectorRandom() const
Gives a vector of measurement tangent vector size having random values.
const MeasureVector & getLastPredictedMeasurement() const
get the last predicted measurement
bool checkPmatrix(const Pmatrix &) const
Checks whether or not a matrix has the dimensions of the P matrix.
virtual Matrix getQ() const
Set the process noise covariance matrix.
virtual void setMeasureSize(Index m)
bool checkCmatrix(const Cmatrix &) const
checks whether or not a matrix has the dimensions of the C matrix
virtual bool checkStateTangentVector(const StateVectorTan &v) const
Tells whether or not the vector has the dimensions of a state tangent vector.
Amatrix getAmatrixConstant(double c) const
Get a matrix having the size of the A matrix having "c" values.
Vector StateVectorTan
StateVector is the type of state tangent vector.
Matrix Rmatrix
The type of the covariance matrix of the measurement noise w.
virtual StateVectorTan stateTangentVectorRandom() const
Gives a vector of state tangent vector size having random values.
virtual void clearStates()
clears the state and the state covariance
virtual const StateVector & getInnovation()
Get the last vector of innovation of the Kalman filter.
virtual StateVectorTan stateTangentVectorConstant(double c) const
Gives a vector of state tangent vector size having duplicated "c" value.
bool checkAmatrix(const Amatrix &) const
checks whether or not a matrix has the dimensions of the A matrix
MeasureVector updateStateAndMeasurementPrediction()
virtual void clearR()
Clear the measurement noise covariance matrix.
Cmatrix getCmatrixConstant(double c) const
Get a matrix having the size of the C matrix having "c" values.
virtual void setR(const Rmatrix &R)
Set the measurement noise covariance matrix.
virtual StateVectorTan stateTangentVectorZero() const
Gives a vector of state tangent vector size having zero values.
Matrix Cmatrix
The type of the jacobian dh/dx.
virtual void setStateCovariance(const Pmatrix &P)
Set the covariance matrix of the current time state estimation error.
Amatrix getAmatrixZero() const
Get a matrix having the size of the A matrix having zero values.
virtual void setA(const Amatrix &A)
Set the value of the jacobian df/dx.
Vector StateVector
StateVector is the type of state vector.
Vector MeasureVector
MeasureVector is the type of measurements vector.
This class is used to customize the way the difference between measurements, the state update functio...
ZeroDelayObserver(Index n, Index m, Index p=0)
IndexedVector x_
while the measurements and iputs are put in lists
Filtering of divergent component of motion (DCM) and estimation of a bias betweeen the DCM and the co...
Eigen::MatrixXd Matrix
Dynamic sized Matrix.
Eigen::VectorXd Vector
Dynamic sized scalar vector.
Defines the base class of online zero delay observers. Zero delay observers are the classical state o...