Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
BIAS::Kalman Class Reference

Classical Kalman filter. More...

#include <StateEstimator/Kalman.hh>

+ Inheritance diagram for BIAS::Kalman:
+ Collaboration diagram for BIAS::Kalman:

Public Member Functions

void AddDebugLevel (const long int lv)
 
void AddDebugLevel (const std::string &name)
 
bool DebugLevelIsSet (const long int lv) const
 
bool DebugLevelIsSet (const std::string &name) const
 
void GetCovariance (Matrix< double > &cov) const
 Returns the system state covariance. More...
 
int GetDebugLevel () const
 
std::ostream & GetDebugStream () const
 
void GetDebugStream (std::ostream &os) const
 
void GetState (Vector< double > &state) const
 Returns the system state. More...
 
void Init (const Matrix< double > &SystemMatrix, const Matrix< double > &MeasurementMatrix, const Vector< double > &InitialSystemState, const Matrix< double > &InitialSystemCovariance)
 
 Kalman ()
 
 Kalman (const Matrix< double > &SystemMatrix, const Matrix< double > &MeasurementMatrix, const Vector< double > &InitialSystemState, const Matrix< double > &InitialSystemCovariance)
 
long int Name2DebugLevel (const std::string &name) const
 looks up a debuglevel in the internal map, returns 0 if not found More...
 
long int NewDebugLevel (const std::string &name)
 creates a new debuglevel More...
 
void Predict (const Matrix< double > &ProcessCovariance)
 Calculates the prediction using the system matrix A. More...
 
void Predict (const Matrix< double > &SystemMatrix, const Matrix< double > &ProcessCovariance)
 Use this prediction function system in case of varying system matrix A. More...
 
void PrintDebugLevel (std::ostream &os=std::cout) const
 
void RemoveDebugLevel (const long int lv)
 
void RemoveDebugLevel (const std::string &name)
 
void SetDebugLevel (const long int lv)
 
void SetDebugLevel (const std::string &name)
 
void SetDebugStream (const std::ostream &os)
 
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels More...
 
void Update (const Vector< double > &Measurement, const Matrix< double > &MeasurementCovariance)
 Calculates the update step. More...
 
 ~Kalman ()
 

Static Public Member Functions

static long int GetGlobalDebugLevel ()
 
static void SetGlobalDebugLevel (long int lev)
 

Protected Member Functions

long ConsumeNextFreeDebuglevel_ ()
 returns the next available debuglevel More...
 

Protected Attributes

long int _liDebugLevel
 
long int _liNextDebugLevel
 new concept, debuglevel are managed here in the debug class More...
 
std::map< std::string, long int > _String2Debuglevel
 
Matrix< double > A_
 measurement matrix and transposed More...
 
Matrix< double > AT_
 
Matrix< double > Covariance_
 The covariance matrix corresponding to State_. More...
 
Matrix< double > H_
 measurement matrix and transposed More...
 
Matrix< double > HT_
 
Matrix< double > Identity_
 identity matrix More...
 
int MeasurementDim_
 
Vector< double > State_
 Contains either the prediction (prior) or Bayes optimal system estimate (posterior) depending what function (Predict()/Update()) wascalled last. More...
 
SVD svd_
 needed for matrix inversion More...
 
int SystemStateDim_
 dimensions of system space and measurement space More...
 

Static Protected Attributes

static std::ostream _zDebugStream
 
static long int GlobalDebugLevel = 0
 

Detailed Description

Classical Kalman filter.

See http://www.cs.unc.edu/~welch/kalman/ for details.

Initialize it by either

Use it by consecutively call

Extract the prediction (prior) by calling GetState() and GetCovariance() after the Predict() step.

Extract the estimated system state by calling GetState() and GetCovariance() after the Update() step.

Author
Felix Woelk 05/2005, untested so far
Examples:
ExampleKalman.cpp.

Definition at line 54 of file Kalman.hh.

Constructor & Destructor Documentation

Kalman::Kalman ( )

Definition at line 10 of file Kalman.cpp.

Kalman::Kalman ( const Matrix< double > &  SystemMatrix,
const Matrix< double > &  MeasurementMatrix,
const Vector< double > &  InitialSystemState,
const Matrix< double > &  InitialSystemCovariance 
)

Definition at line 15 of file Kalman.cpp.

Kalman::~Kalman ( )

Definition at line 24 of file Kalman.cpp.

Member Function Documentation

void BIAS::Debug::AddDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::AddDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 362 of file Debug.hh.

long BIAS::Debug::ConsumeNextFreeDebuglevel_ ( )
inlineprotectedinherited

returns the next available debuglevel

Author
woelk 09/2006

Definition at line 521 of file Debug.hh.

bool BIAS::Debug::DebugLevelIsSet ( const long int  lv) const
inlineinherited
bool BIAS::Debug::DebugLevelIsSet ( const std::string &  name) const
inlineinherited

Definition at line 350 of file Debug.hh.

void BIAS::Kalman::GetCovariance ( Matrix< double > &  cov) const
inline

Returns the system state covariance.

It could be the covariance of the prediction, if called after the predict step or the covariance of the posterior, if GetState is called after the update step.

Author
woelk 05/2005
Examples:
ExampleKalman.cpp.

Definition at line 96 of file Kalman.hh.

int BIAS::Debug::GetDebugLevel ( ) const
inlineinherited
std::ostream& BIAS::Debug::GetDebugStream ( ) const
inlineinherited

Definition at line 405 of file Debug.hh.

void BIAS::Debug::GetDebugStream ( std::ostream &  os) const
inlineinherited

Definition at line 414 of file Debug.hh.

static long int BIAS::Debug::GetGlobalDebugLevel ( )
inlinestaticinherited

Definition at line 431 of file Debug.hh.

void BIAS::Kalman::GetState ( Vector< double > &  state) const
inline

Returns the system state.

It could be the prediction, if called after the predict step or the posterior, if GetState is called after the update step.

Author
woelk 05/2005
Examples:
ExampleKalman.cpp.

Definition at line 89 of file Kalman.hh.

void Kalman::Init ( const Matrix< double > &  SystemMatrix,
const Matrix< double > &  MeasurementMatrix,
const Vector< double > &  InitialSystemState,
const Matrix< double > &  InitialSystemCovariance 
)
long int BIAS::Debug::Name2DebugLevel ( const std::string &  name) const
inlineinherited

looks up a debuglevel in the internal map, returns 0 if not found

Author
woelk 09/2006

Definition at line 454 of file Debug.hh.

long int BIAS::Debug::NewDebugLevel ( const std::string &  name)
inlineinherited
void Kalman::Predict ( const Matrix< double > &  ProcessCovariance)

Calculates the prediction using the system matrix A.

Author
woelk 05/2005
Examples:
ExampleKalman.cpp.

Definition at line 51 of file Kalman.cpp.

void Kalman::Predict ( const Matrix< double > &  SystemMatrix,
const Matrix< double > &  ProcessCovariance 
)

Use this prediction function system in case of varying system matrix A.

Author
woelk 05/2005

Definition at line 59 of file Kalman.cpp.

void BIAS::Debug::PrintDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

Definition at line 383 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const long int  lv)
inlineinherited

Definition at line 369 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 376 of file Debug.hh.

void BIAS::Debug::SetDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::SetDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 325 of file Debug.hh.

void BIAS::Debug::SetDebugStream ( const std::ostream &  os)
inlineinherited

Definition at line 398 of file Debug.hh.

static void BIAS::Debug::SetGlobalDebugLevel ( long int  lev)
inlinestaticinherited

Definition at line 424 of file Debug.hh.

void BIAS::Debug::ShowDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

prints all internally known debuglevels

Author
woelk 09/2006

Definition at line 496 of file Debug.hh.

void Kalman::Update ( const Vector< double > &  Measurement,
const Matrix< double > &  MeasurementCovariance 
)

Calculates the update step.

Author
woelk 05/2005
Examples:
ExampleKalman.cpp.

Definition at line 72 of file Kalman.cpp.

References TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), and TNT::Vector< T >::size().

Member Data Documentation

long int BIAS::Debug::_liDebugLevel
protectedinherited

Definition at line 510 of file Debug.hh.

Referenced by BIAS::Debug::operator=(), and BIAS::ImageBase::operator=().

long int BIAS::Debug::_liNextDebugLevel
protectedinherited

new concept, debuglevel are managed here in the debug class

Definition at line 516 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

std::map<std::string, long int> BIAS::Debug::_String2Debuglevel
protectedinherited

Definition at line 517 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

std::ostream BIAS::Debug::_zDebugStream
staticprotectedinherited

Definition at line 511 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

Matrix<double> BIAS::Kalman::A_
protected

measurement matrix and transposed

Definition at line 110 of file Kalman.hh.

Matrix<double> BIAS::Kalman::AT_
protected

Definition at line 110 of file Kalman.hh.

Matrix<double> BIAS::Kalman::Covariance_
protected

The covariance matrix corresponding to State_.

Definition at line 104 of file Kalman.hh.

long int BIAS::Debug::GlobalDebugLevel = 0
staticprotectedinherited

Definition at line 513 of file Debug.hh.

Matrix<double> BIAS::Kalman::H_
protected

measurement matrix and transposed

Definition at line 107 of file Kalman.hh.

Matrix<double> BIAS::Kalman::HT_
protected

Definition at line 107 of file Kalman.hh.

Matrix<double> BIAS::Kalman::Identity_
protected

identity matrix

Definition at line 113 of file Kalman.hh.

int BIAS::Kalman::MeasurementDim_
protected

Definition at line 116 of file Kalman.hh.

Vector<double> BIAS::Kalman::State_
protected

Contains either the prediction (prior) or Bayes optimal system estimate (posterior) depending what function (Predict()/Update()) wascalled last.

Definition at line 102 of file Kalman.hh.

SVD BIAS::Kalman::svd_
protected

needed for matrix inversion

Definition at line 119 of file Kalman.hh.

int BIAS::Kalman::SystemStateDim_
protected

dimensions of system space and measurement space

Definition at line 116 of file Kalman.hh.


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