Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
jafar::filter::BaseKalmanFilter Class Reference

Base class for kalman filters. More...


Detailed Description

Base class for kalman filters.

It defines common attributes of such filters.

Definition at line 29 of file kalmanFilter.hpp.

#include <kalmanFilter.hpp>

Inheritance diagram for jafar::filter::BaseKalmanFilter:
Inheritance graph
[legend]

List of all members.

Public Types

enum  CovUpdateType { SIMPLE, STANDARD, JOSEPH }
 Different kind of covariance update (Bar-Shalom p294) More...
enum  ConsistencyCheckLevel { CONSISTENCY_NONE, CONSISTENCY_WARNING, CONSISTENCY_EXCEPTION }
 Different level of consistency check. More...

Public Member Functions

 BaseKalmanFilter (std::size_t size_)
 Create a kalman filter.
jblas::vec const & getX () const
jblas::vecgetX ()
jblas::sym_mat const & getP () const
jblas::sym_matgetP ()
void clear ()
 clear the state vector and the covariance matrix
boost::posix_time::time_duration
const & 
getCurrentTime () const
void setCovUpdateType (CovUpdateType covUpdateType_)
CovUpdateType getCovUpdateType () const
void setupConsistencyCheck (ConsistencyCheckLevel level_, double chi2Threshold_)
ConsistencyCheckLevel getConsistencyCheckLevel () const
double getChi2Threshold () const
void init (const jblas::vec &state_, const jblas::sym_mat &cov_, boost::posix_time::time_duration const &curTime)
 Init the filter with state_ and covariance cov_ and curTime.
void init (const jblas::vec &state_, const jblas::sym_mat &cov_)
 Init the filter with state_ and covariance cov_, current time is set to 0.
void init (boost::posix_time::time_duration const &curTime)
 Init the filter at curTime, state is set to zero.
virtual std::size_t sizeState () const

Protected Member Functions

template<class Vec >
void checkConsistency (Vec const &y, jblas::sym_mat const &Sinv)
 Check the consistency of an update.
void checkConsistency (double y, double Sinv)
template<typename YType , typename SinvType >
void checkConsistency (YType y, SinvType Sinv, double ySiy)
void writeLogHeader (jafar::kernel::DataLogger &log) const
 Implements this method calling repeatidly log methods.
void writeLogData (jafar::kernel::DataLogger &log) const
 Implements this method calling repeatidly log methods.

Protected Attributes

CovUpdateType covUpdateType
 the covariance update method
jblas::vec x
 state vector of the filter
jblas::sym_mat P
 covariance matrix of the state vector
boost::posix_time::time_duration p_curTime
 filter current time.
jblas::mat K
 Kalman gain for mono dimension update.
jblas::mat KH_tmp
 preallocated matrix to speed-up computation (used by Joseph update, and simple update)
ConsistencyCheckLevel consistencyCheckLevel
 whether the consistency is checked
double chi2Threshold
 consistency threshold

Member Enumeration Documentation

Different level of consistency check.

Enumerator:
CONSISTENCY_NONE 

no check

CONSISTENCY_WARNING 

send a warning to the output

CONSISTENCY_EXCEPTION 

throw a filter exception with id=INCONSISTENT_UPDATE

Definition at line 44 of file kalmanFilter.hpp.

Different kind of covariance update (Bar-Shalom p294)

Enumerator:
SIMPLE 

very naive update, from the books

STANDARD 

still numerical errors in substraction

JOSEPH 

Joseph form, less sensitive to round-off error, preserve positive definiteness, computationnaly more expensive.

Definition at line 34 of file kalmanFilter.hpp.


Constructor & Destructor Documentation

Create a kalman filter.

Parameters:
size_The size of the state

Member Function Documentation

template<class Vec >
void jafar::filter::BaseKalmanFilter::checkConsistency ( Vec const &  y,
jblas::sym_mat const &  Sinv 
) [inline, protected]

Check the consistency of an update.

Innovation y is a centered gaussian distribution with covariance S.

Definition at line 78 of file kalmanFilter.hpp.

References CONSISTENCY_NONE, consistencyCheckLevel, and JFR_PRECOND.

virtual std::size_t jafar::filter::BaseKalmanFilter::sizeState ( ) const [inline, virtual]
Returns:
size of the filter state.

Reimplemented in jafar::filter::BlockExtendedKalmanFilter.

Definition at line 179 of file kalmanFilter.hpp.

References x.

Implements this method calling repeatidly log methods.

You should use writeData() or writeDataVector().

Implements jafar::kernel::DataLoggable.

Implements this method calling repeatidly log methods.

You should use writeComment(), writeLegend() or writeLegendTokens().

Implements jafar::kernel::DataLoggable.


Member Data Documentation

consistency threshold

See also:
checkConsistency()

Definition at line 72 of file kalmanFilter.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:36 for Jafar by doxygen 1.7.6.1
LAAS-CNRS