Skyward boardcore
Loading...
Searching...
No Matches
Boardcore::Kalman< T, N_size, P_size, M_size > Class Template Reference

Implementation of a generic Kalman filter using the Eigen library. More...

#include <Kalman.h>

Classes

struct  KalmanConfig
 Configuration struct for the Kalman class. More...
 

Public Types

using MatrixNN = Eigen::Matrix<T, N_size, N_size>
 
using MatrixPN = Eigen::Matrix<T, P_size, N_size>
 
using MatrixNP = Eigen::Matrix<T, N_size, P_size>
 
using MatrixPP = Eigen::Matrix<T, P_size, P_size>
 
using MatrixNM = Eigen::Matrix<T, N_size, M_size>
 
using CVectorN = Eigen::Vector<T, N_size>
 
using CVectorP = Eigen::Vector<T, P_size>
 
using CVectorM = Eigen::Vector<T, M_size>
 

Public Member Functions

 Kalman (const KalmanConfig &config)
 Creates a Kalman filter object.
 
void setConfig (const KalmanConfig &config)
 
void predict ()
 Prediction step with previous F matrix.
 
void predictUpdateF (const MatrixNN &F_new)
 Prediction step.
 
void predictWithControl (const CVectorM &control)
 Prediction step with previous F matrix and with the control vector.
 
void predictWithControlUpdateF (const MatrixNN &F_new, const CVectorM &control)
 Prediction step.
 
bool correct (const CVectorP &y)
 Correction step.
 
const CVectorN getState ()
 
const CVectorP getOutput ()
 
const CVectorP getResidual ()
 
const CVectorN predictState (uint32_t k)
 Predicts k steps ahead the state.
 
const CVectorP predictOutput (uint32_t k)
 Predicts k steps ahead the output.
 

Detailed Description

template<typename T, int N_size, int P_size, int M_size = 1>
class Boardcore::Kalman< T, N_size, P_size, M_size >

Implementation of a generic Kalman filter using the Eigen library.

This class uses templates in order to know the size of each matrix at compile-time. This way we avoid Eigen to allocate memory dynamically.

Definition at line 37 of file Kalman.h.

Member Typedef Documentation

◆ CVectorM

template<typename T , int N_size, int P_size, int M_size = 1>
using Boardcore::Kalman< T, N_size, P_size, M_size >::CVectorM = Eigen::Vector<T, M_size>

Definition at line 47 of file Kalman.h.

◆ CVectorN

template<typename T , int N_size, int P_size, int M_size = 1>
using Boardcore::Kalman< T, N_size, P_size, M_size >::CVectorN = Eigen::Vector<T, N_size>

Definition at line 45 of file Kalman.h.

◆ CVectorP

template<typename T , int N_size, int P_size, int M_size = 1>
using Boardcore::Kalman< T, N_size, P_size, M_size >::CVectorP = Eigen::Vector<T, P_size>

Definition at line 46 of file Kalman.h.

◆ MatrixNM

template<typename T , int N_size, int P_size, int M_size = 1>
using Boardcore::Kalman< T, N_size, P_size, M_size >::MatrixNM = Eigen::Matrix<T, N_size, M_size>

Definition at line 44 of file Kalman.h.

◆ MatrixNN

template<typename T , int N_size, int P_size, int M_size = 1>
using Boardcore::Kalman< T, N_size, P_size, M_size >::MatrixNN = Eigen::Matrix<T, N_size, N_size>

Definition at line 40 of file Kalman.h.

◆ MatrixNP

template<typename T , int N_size, int P_size, int M_size = 1>
using Boardcore::Kalman< T, N_size, P_size, M_size >::MatrixNP = Eigen::Matrix<T, N_size, P_size>

Definition at line 42 of file Kalman.h.

◆ MatrixPN

template<typename T , int N_size, int P_size, int M_size = 1>
using Boardcore::Kalman< T, N_size, P_size, M_size >::MatrixPN = Eigen::Matrix<T, P_size, N_size>

Definition at line 41 of file Kalman.h.

◆ MatrixPP

template<typename T , int N_size, int P_size, int M_size = 1>
using Boardcore::Kalman< T, N_size, P_size, M_size >::MatrixPP = Eigen::Matrix<T, P_size, P_size>

Definition at line 43 of file Kalman.h.

Constructor & Destructor Documentation

◆ Kalman()

template<typename T , int N_size, int P_size, int M_size = 1>
Boardcore::Kalman< T, N_size, P_size, M_size >::Kalman ( const KalmanConfig & config)
inline

Creates a Kalman filter object.

Parameters
configConfiguration parameters.

Definition at line 68 of file Kalman.h.

Member Function Documentation

◆ correct()

template<typename T , int N_size, int P_size, int M_size = 1>
bool Boardcore::Kalman< T, N_size, P_size, M_size >::correct ( const CVectorP & y)
inline

Correction step.

Parameters
yThe measurement vector.

Definition at line 137 of file Kalman.h.

◆ getOutput()

template<typename T , int N_size, int P_size, int M_size = 1>
const CVectorP Boardcore::Kalman< T, N_size, P_size, M_size >::getOutput ( )
inline
Returns
output vector

Definition at line 164 of file Kalman.h.

◆ getResidual()

template<typename T , int N_size, int P_size, int M_size = 1>
const CVectorP Boardcore::Kalman< T, N_size, P_size, M_size >::getResidual ( )
inline
Returns
residual error vector

Definition at line 173 of file Kalman.h.

◆ getState()

template<typename T , int N_size, int P_size, int M_size = 1>
const CVectorN Boardcore::Kalman< T, N_size, P_size, M_size >::getState ( )
inline
Returns
state vector

Definition at line 159 of file Kalman.h.

◆ predict()

template<typename T , int N_size, int P_size, int M_size = 1>
void Boardcore::Kalman< T, N_size, P_size, M_size >::predict ( )
inline

Prediction step with previous F matrix.

Definition at line 92 of file Kalman.h.

◆ predictOutput()

template<typename T , int N_size, int P_size, int M_size = 1>
const CVectorP Boardcore::Kalman< T, N_size, P_size, M_size >::predictOutput ( uint32_t k)
inline

Predicts k steps ahead the output.

Definition at line 191 of file Kalman.h.

◆ predictState()

template<typename T , int N_size, int P_size, int M_size = 1>
const CVectorN Boardcore::Kalman< T, N_size, P_size, M_size >::predictState ( uint32_t k)
inline

Predicts k steps ahead the state.

Definition at line 178 of file Kalman.h.

◆ predictUpdateF()

template<typename T , int N_size, int P_size, int M_size = 1>
void Boardcore::Kalman< T, N_size, P_size, M_size >::predictUpdateF ( const MatrixNN & F_new)
inline

Prediction step.

Parameters
F_newupdated F matrix.

Definition at line 103 of file Kalman.h.

◆ predictWithControl()

template<typename T , int N_size, int P_size, int M_size = 1>
void Boardcore::Kalman< T, N_size, P_size, M_size >::predictWithControl ( const CVectorM & control)
inline

Prediction step with previous F matrix and with the control vector.

Definition at line 113 of file Kalman.h.

◆ predictWithControlUpdateF()

template<typename T , int N_size, int P_size, int M_size = 1>
void Boardcore::Kalman< T, N_size, P_size, M_size >::predictWithControlUpdateF ( const MatrixNN & F_new,
const CVectorM & control )
inline

Prediction step.

Parameters
F_newupdated F matrix.
controlControl vector.

Definition at line 125 of file Kalman.h.

◆ setConfig()

template<typename T , int N_size, int P_size, int M_size = 1>
void Boardcore::Kalman< T, N_size, P_size, M_size >::setConfig ( const KalmanConfig & config)
inline

Definition at line 76 of file Kalman.h.


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