LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::kalmanTracker Class Reference

A tracker implementation making use of the class kalmanFilter. More...

#include <ltiKalmanTracker.h>

Inheritance diagram for lti::kalmanTracker:
Inheritance graph
[legend]
Collaboration diagram for lti::kalmanTracker:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 The parameters for the class kalmanTracker. More...

Public Member Functions

 kalmanTracker (const int &stateDimensions=4)
 kalmanTracker (const kalmanTracker &other)
virtual ~kalmanTracker ()
virtual const char * getTypeName () const
int getSystemStateDimensions () const
bool apply (const float &xMeasurement, const float &yMeasurement, float &xPredictionApriori, float &yPredictionApriori)
bool apply (float &xPredictionApriori, float &yPredictionApriori)
kalmanTrackercopy (const kalmanTracker &other)
virtual functorclone () const
const parametersgetParameters (void) const
bool updateParameters ()
void setMeasurementNoiseCovariance (const matrix< float > &r)
const vector< float > & getEstimate () const
const vector< float > & getEstimateAposteriori () const
const matrix< float > & getErrorCovarianceApriori () const
const matrix< float > & getErrorCovarianceAposteriori () const
void reset (void)
bool isInitialized () const

Protected Member Functions

bool performTimeUpdate ()
bool performMeasurementUpdate (const float &xMeasurement, const float &yMeasurement)

Protected Attributes

kalmanFilter kalman
bool initialized
lti::vector< float > measurement
lti::vector< float > prediction

Detailed Description

A tracker implementation making use of the class kalmanFilter.

It tracks a 2D point, using a system state vector that contains x and y coordinate as well as x and y velocity (denoted by vx and vy) and, optionally, x and y acceleration (ax and ay) of this point. These state vectors correspond to the assumption of constant velocity and constant acceleration, respectively. The state vector is structured like this: (x,vx,y,vy), or (x,vx,y,vy,ax,ay). The measured x and y coordinate are given to the apply method, which returns the estimated x and y coordinates at the next time step.

These matrices (contained in the parameters) must be specified:

matrix<float> measurementNoiseCovariance ($R$; 2x2)
matrix<float> processNoiseCovariance ($Q$; 4x4 / 6x6)

These matrices (contained in the parameters) should be specified, but are initialized to default values that should be sufficient for a first try:

vector<float> initialSystemState ($\hat{x}^{-}$; 4 / 6)
matrix<float> initialErrorCovariance ($P^{-}$ and $P$; 4x4 / 6x6)

The parantheses contain notation and dimensionality of the matrices for the constant velocity / constant acceleration case.


Constructor & Destructor Documentation

lti::kalmanTracker::kalmanTracker ( const int &  stateDimensions = 4  ) 

constructor for n-dimensional system state (n may be 4 or 6).

default is 4.

lti::kalmanTracker::kalmanTracker ( const kalmanTracker other  ) 

copy constructor

Parameters:
other the object to be copied
virtual lti::kalmanTracker::~kalmanTracker (  )  [virtual]

destructor


Member Function Documentation

bool lti::kalmanTracker::apply ( float &  xPredictionApriori,
float &  yPredictionApriori 
)

Perform only a time update (i.e.

no new measurement available), resulting in a prediction of x and y coordinates for the next time step, which are then returned.

bool lti::kalmanTracker::apply ( const float &  xMeasurement,
const float &  yMeasurement,
float &  xPredictionApriori,
float &  yPredictionApriori 
)

Perform a measurement update and then a time update, resulting in a prediction of x and y coordinates for the next time step, which are then returned.

virtual functor* lti::kalmanTracker::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements lti::functor.

kalmanTracker& lti::kalmanTracker::copy ( const kalmanTracker other  ) 

copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

const matrix<float>& lti::kalmanTracker::getErrorCovarianceAposteriori (  )  const

Get the a posteriori error covariance ($P$).

const matrix<float>& lti::kalmanTracker::getErrorCovarianceApriori (  )  const

Get the a priori error covariance ($P^{-}$).

const vector<float>& lti::kalmanTracker::getEstimate (  )  const

Get the (a priori) system state estimate ($\hat{x}^{-}$).

This is the prediction one would normally be interested in.

const vector<float>& lti::kalmanTracker::getEstimateAposteriori (  )  const

Get the a posteriori system state estimate ($\hat{x}$).

const parameters& lti::kalmanTracker::getParameters ( void   )  const

returns used parameters

Reimplemented from lti::functor.

int lti::kalmanTracker::getSystemStateDimensions (  )  const

Return the number of system state dimensions (currently either 4 or 6).

virtual const char* lti::kalmanTracker::getTypeName (  )  const [virtual]

returns the name of this type ("kalmanTracker")

Reimplemented from lti::functor.

bool lti::kalmanTracker::isInitialized (  )  const

Tell if this tracker is initialized, i.e.

if any of the apply methods has been called after the creation of this object or a call to reset().

bool lti::kalmanTracker::performMeasurementUpdate ( const float &  xMeasurement,
const float &  yMeasurement 
) [protected]

Perform measurement update.

bool lti::kalmanTracker::performTimeUpdate (  )  [protected]

Perform time update.

void lti::kalmanTracker::reset ( void   ) 

Reset the filter state ($x$) and error covariance ($P$).

The tracker is left in an un-initialized state.

void lti::kalmanTracker::setMeasurementNoiseCovariance ( const matrix< float > &  r  ) 

set a new measurement noise covariance, e.g.

because future measurements are less/more reliable (overlapping starts/ends)

bool lti::kalmanTracker::updateParameters (  )  [virtual]

set parameters of this Kalman tracker

Reimplemented from lti::functor.


Member Data Documentation

Initialization status of this tracker.

Set to false after object creation or call to reset(). Set to true after the first update, i.e. call to an apply method.

The kalmanFilter used by this tracker.

This temporary variable wraps two floats (the x/y measurement) in a vector.

This temporary variable wraps two floats (the x/y prediction) in a vector.


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

Generated on Sat Apr 10 15:27:27 2010 for LTI-Lib by Doxygen 1.6.1