Robotics Library  0.7.0
Public Types | Public Member Functions | Private Attributes | List of all members
rl::math::Kalman< Scalar > Class Template Reference

Kalman filter. More...

#include <Kalman.h>

Public Types

typedef Scalar ScalarType
 
typedef ::Eigen::Matrix< Scalar, ::Eigen::Dynamic, ::Eigen::Dynamic > MatrixType
 
typedef ::Eigen::Matrix< Scalar, ::Eigen::Dynamic, 1 > VectorType
 

Public Member Functions

 Kalman (const ::std::size_t &states, const ::std::size_t &observations, const ::std::size_t &controls=0)
 
virtual ~Kalman ()
 
MatrixType & controlModel ()
 
const MatrixType & controlModel () const
 
VectorType correct (const VectorType &z)
 Measurement update ("correct"). More...
 
MatrixType & errorCovariancePosteriori ()
 
const MatrixType & errorCovariancePosteriori () const
 
MatrixType & errorCovariancePriori ()
 
const MatrixType & errorCovariancePriori () const
 
MatrixType & measurementModel ()
 
const MatrixType & measurementModel () const
 
MatrixType & measurementNoiseCovariance ()
 
const MatrixType & measurementNoiseCovariance () const
 
VectorType predict ()
 Time update ("predict") without control input. More...
 
VectorType predict (const VectorType &u)
 Time update ("predict") with control input. More...
 
MatrixType & processNoiseCovariance ()
 
const MatrixType & processNoiseCovariance () const
 
VectorType & statePosteriori ()
 
const VectorType & statePosteriori () const
 
VectorType & statePriori ()
 
const VectorType & statePriori () const
 
MatrixType & stateTransitionModel ()
 
const MatrixType & stateTransitionModel () const
 

Private Attributes

MatrixType A
 \(\matr{A}\) relates the state at the previous time step \(k - 1\) to the state at the current step \(k\). More...
 
MatrixType B
 \(\matr{B}\) relates the control input \(\vec{u}\) to the state \(\vec{x}\). More...
 
MatrixType H
 \(\matr{H}\) relates the state to the measurement \(\vec{z}_{k}\). More...
 
MatrixType PPosteriori
 A posteriori estimate error covariance \(\matr{P}_{k - 1}\). More...
 
MatrixType PPriori
 A priori estimate error covariance \(\matr{P}^{-}_{k}\). More...
 
MatrixType Q
 Process noise covariance \(\matr{Q}\). More...
 
MatrixType R
 Measurement error covariance \(\matr{R}\). More...
 
VectorType xPosteriori
 A posteriori state estimate \(\hat{\vec{x}}_{k - 1}\). More...
 
VectorType xPriori
 A priori state estimate \(\hat{\vec{x}}^{-}_{k}\). More...
 

Detailed Description

template<typename Scalar>
class rl::math::Kalman< Scalar >

Kalman filter.

Greg Welch and Gary Bishop. An introduction to the Kalman filter. Technical Report TR 95-041, University of North Carolina at Chapel Hill, Chapel Hill, NC, USA, July 2006.

http://www.cs.unc.edu/~welch/media/pdf/kalman_intro.pdf

Member Typedef Documentation

◆ MatrixType

template<typename Scalar >
typedef ::Eigen::Matrix<Scalar, ::Eigen::Dynamic, ::Eigen::Dynamic> rl::math::Kalman< Scalar >::MatrixType

◆ ScalarType

template<typename Scalar >
typedef Scalar rl::math::Kalman< Scalar >::ScalarType

◆ VectorType

template<typename Scalar >
typedef ::Eigen::Matrix<Scalar, ::Eigen::Dynamic, 1> rl::math::Kalman< Scalar >::VectorType

Constructor & Destructor Documentation

◆ Kalman()

template<typename Scalar >
rl::math::Kalman< Scalar >::Kalman ( const ::std::size_t &  states,
const ::std::size_t &  observations,
const ::std::size_t &  controls = 0 
)
inline

◆ ~Kalman()

template<typename Scalar >
virtual rl::math::Kalman< Scalar >::~Kalman ( )
inlinevirtual

Member Function Documentation

◆ controlModel() [1/2]

template<typename Scalar >
MatrixType& rl::math::Kalman< Scalar >::controlModel ( )
inline

◆ controlModel() [2/2]

template<typename Scalar >
const MatrixType& rl::math::Kalman< Scalar >::controlModel ( ) const
inline

◆ correct()

template<typename Scalar >
VectorType rl::math::Kalman< Scalar >::correct ( const VectorType &  z)
inline

Measurement update ("correct").

Compute the Kalman gain

\[ \matr{K}_{k} = \matr{P}^{-}_{k} \matr{H}^{\mathrm{T}} \left( \matr{H} \matr{P}^{-}_{k} \matr{H}^{\mathrm{T}} + \matr{R} \right)^{-1} \]

Update estimate with measurement \(\vec{z}_{k}\)

\[ \hat{\vec{x}}_{k} = \hat{\vec{x}}^{-}_{k} + \matr{K}_{k} \left( \vec{z}_{k} - \matr{H} \hat{\vec{x}}^{-}_{k} \right) \]

Update the error covariance

\[ \matr{P}_{k} = \left( \matr{1} - \matr{K}_{k} \matr{H} \right) \matr{P}^{-}_{k} \]

Parameters
[in]zMeasurement \(\vec{z}_{k}\)

◆ errorCovariancePosteriori() [1/2]

template<typename Scalar >
MatrixType& rl::math::Kalman< Scalar >::errorCovariancePosteriori ( )
inline

◆ errorCovariancePosteriori() [2/2]

template<typename Scalar >
const MatrixType& rl::math::Kalman< Scalar >::errorCovariancePosteriori ( ) const
inline

◆ errorCovariancePriori() [1/2]

template<typename Scalar >
MatrixType& rl::math::Kalman< Scalar >::errorCovariancePriori ( )
inline

◆ errorCovariancePriori() [2/2]

template<typename Scalar >
const MatrixType& rl::math::Kalman< Scalar >::errorCovariancePriori ( ) const
inline

◆ measurementModel() [1/2]

template<typename Scalar >
MatrixType& rl::math::Kalman< Scalar >::measurementModel ( )
inline

◆ measurementModel() [2/2]

template<typename Scalar >
const MatrixType& rl::math::Kalman< Scalar >::measurementModel ( ) const
inline

◆ measurementNoiseCovariance() [1/2]

template<typename Scalar >
MatrixType& rl::math::Kalman< Scalar >::measurementNoiseCovariance ( )
inline

◆ measurementNoiseCovariance() [2/2]

template<typename Scalar >
const MatrixType& rl::math::Kalman< Scalar >::measurementNoiseCovariance ( ) const
inline

◆ predict() [1/2]

template<typename Scalar >
VectorType rl::math::Kalman< Scalar >::predict ( )
inline

Time update ("predict") without control input.

Project the state ahead

\[ \hat{\vec{x}}^{-}_{k} = \matr{A} \hat{\vec{x}}_{k - 1} \]

Project the error covariance ahead

\[ \matr{P}^{-}_{k} = \matr{A} \matr{P}_{k - 1} \matr{A}^{\mathrm{T}} + \matr{Q} \]

◆ predict() [2/2]

template<typename Scalar >
VectorType rl::math::Kalman< Scalar >::predict ( const VectorType &  u)
inline

Time update ("predict") with control input.

Project the state ahead

\[ \hat{\vec{x}}^{-}_{k} = \matr{A} \hat{\vec{x}}_{k - 1} + \matr{B} \vec{u}_{k - 1} \]

Project the error covariance ahead

\[ \matr{P}^{-}_{k} = \matr{A} \matr{P}_{k - 1} \matr{A}^{\mathrm{T}} + \matr{Q} \]

Parameters
[in]uControl input \(\vec{u}_{k - 1}\)

◆ processNoiseCovariance() [1/2]

template<typename Scalar >
MatrixType& rl::math::Kalman< Scalar >::processNoiseCovariance ( )
inline

◆ processNoiseCovariance() [2/2]

template<typename Scalar >
const MatrixType& rl::math::Kalman< Scalar >::processNoiseCovariance ( ) const
inline

◆ statePosteriori() [1/2]

template<typename Scalar >
VectorType& rl::math::Kalman< Scalar >::statePosteriori ( )
inline

◆ statePosteriori() [2/2]

template<typename Scalar >
const VectorType& rl::math::Kalman< Scalar >::statePosteriori ( ) const
inline

◆ statePriori() [1/2]

template<typename Scalar >
VectorType& rl::math::Kalman< Scalar >::statePriori ( )
inline

◆ statePriori() [2/2]

template<typename Scalar >
const VectorType& rl::math::Kalman< Scalar >::statePriori ( ) const
inline

◆ stateTransitionModel() [1/2]

template<typename Scalar >
MatrixType& rl::math::Kalman< Scalar >::stateTransitionModel ( )
inline

◆ stateTransitionModel() [2/2]

template<typename Scalar >
const MatrixType& rl::math::Kalman< Scalar >::stateTransitionModel ( ) const
inline

Member Data Documentation

◆ A

template<typename Scalar >
MatrixType rl::math::Kalman< Scalar >::A
private

\(\matr{A}\) relates the state at the previous time step \(k - 1\) to the state at the current step \(k\).

◆ B

template<typename Scalar >
MatrixType rl::math::Kalman< Scalar >::B
private

\(\matr{B}\) relates the control input \(\vec{u}\) to the state \(\vec{x}\).

◆ H

template<typename Scalar >
MatrixType rl::math::Kalman< Scalar >::H
private

\(\matr{H}\) relates the state to the measurement \(\vec{z}_{k}\).

◆ PPosteriori

template<typename Scalar >
MatrixType rl::math::Kalman< Scalar >::PPosteriori
private

A posteriori estimate error covariance \(\matr{P}_{k - 1}\).

◆ PPriori

template<typename Scalar >
MatrixType rl::math::Kalman< Scalar >::PPriori
private

A priori estimate error covariance \(\matr{P}^{-}_{k}\).

◆ Q

template<typename Scalar >
MatrixType rl::math::Kalman< Scalar >::Q
private

Process noise covariance \(\matr{Q}\).

◆ R

template<typename Scalar >
MatrixType rl::math::Kalman< Scalar >::R
private

Measurement error covariance \(\matr{R}\).

◆ xPosteriori

template<typename Scalar >
VectorType rl::math::Kalman< Scalar >::xPosteriori
private

A posteriori state estimate \(\hat{\vec{x}}_{k - 1}\).

◆ xPriori

template<typename Scalar >
VectorType rl::math::Kalman< Scalar >::xPriori
private

A priori state estimate \(\hat{\vec{x}}^{-}_{k}\).


The documentation for this class was generated from the following file: