TLIB documentation
 

tlConst< T > Class Template Reference

Inheritance diagram for tlConst< T >:

Inheritance graph
[legend]

List of all members.


Detailed Description

template<typename T>
class tlConst< T >

Adaptive constants based on Kalman filtering.

Tracking routines often relies on some "magic" constants that vary over time according to external conditions, or that simply cannot be determined analytically. The tlConst object is a Kalman-filter based estimator of constants that can be dynamically updated. It provides an easy way to perform least-square approximation of a set of data without memorization.

Public Member Functions

 tlConst ()
 tlConst (T val, float pCv, int tol=-1)
 tlConst (T val, float eCv, float pCv, float mCv, int tol=-1)
virtual ~tlConst ()
int init (T val, float pCv, int tol=-1)
int init (T val, float eCv, float pCv, float mCv, int tol=-1)
int setVal (T val)
int setParam (float pCv, int tol=-1)
int setParam (float eCv, float pCv, float mCv, int tol=-1)
int setTol (int tol)
int update (T val)
int getTol ()
getVal ()
getNext ()
float getState ()
float getEstimate ()


Constructor & Destructor Documentation

template<typename T>
tlConst< T >::tlConst (  )  [inline]

Constructor, initialize constant to 0.

Note:
See error management for details.

template<typename T>
tlConst< T >::tlConst ( init,
float  pCv,
int  tol = -1 
) [inline]

Constructor, initialize the most significant Kalman filter parameter (process covariance).

Parameters:
init initial value of the constant
pCv process covariance
tol tolerance for input values [%],
-1 for no input filtering
Note:
See error management for details.

template<typename T>
tlConst< T >::tlConst ( init,
float  eCv,
float  pCv,
float  mCv,
int  tol = -1 
) [inline]

Constructor, initialize all Kalman filter parameters.

Parameters:
init initial value of the constant
eCv initial estimate covariance
pCv process covariance
mCv measurment covariance
tol tolerance for input values [%],
-1 for no input filtering
Note:
See error management for details.

template<typename T>
tlConst< T >::~tlConst (  )  [inline, virtual]

Destructor.

Note:
See error management for details.


Member Function Documentation

template<typename T>
int tlConst< T >::init ( init,
float  pCv,
int  tol = -1 
) [inline]

(Re)initialize the constant, that is, set the most significant Kalman filter parameter (process covariance).

Parameters:
init initial value of the constant
pCv process covariance
tol tolerance for input values [%],
-1 for no input filtering
Returns:
0 on success, -1 otherwise.
See error management for details.

template<typename T>
int tlConst< T >::init ( init,
float  eCv,
float  pCv,
float  mCv,
int  tol = -1 
) [inline]

(Re)initialize the constant, that is, set all Kalman filter parameters.

Parameters:
init initial value of the constant
eCv initial estimate covariance
pCv process covariance
mCv measurment covariance
tol tolerance for input values [%],
-1 for no input filtering
Returns:
0 on success, -1 otherwise.
See error management for details.

template<typename T>
int tlConst< T >::setVal ( init  )  [inline]

Set the current best estimate for the constant value; the value is cast to the template type.

Parameters:
init value to reset the constant to
Returns:
0 on success, -1 otherwise.
See error management for details.

template<typename T>
int tlConst< T >::setParam ( float  pCv,
int  tol = -1 
) [inline]

Set the most significant Kalman filter parameter (process covariance).

Parameters:
pCv process covariance
tol tolerance for input values [%],
-1 for no input filtering
Returns:
0 on success, -1 otherwise.
See error management for details.

template<typename T>
int tlConst< T >::setParam ( float  eCv,
float  pCv,
float  mCv,
int  tol = -1 
) [inline]

Set all Kalman filter parameters.

Parameters:
eCv initial estimate covariance
pCv process covariance
mCv measurment covariance
tol tolerance for input values [%],
-1 for no input filtering
Returns:
0 on success, -1 otherwise.
See error management for details.

template<typename T>
int tlConst< T >::setTol ( int  tol  )  [inline]

Set the tolerance on input values. Values that do are not within tolerance [%] of the current value will not be taken into account.

Parameters:
tol tolerance for input values [%]
-1 disables input filtering
Returns:
0 on success, -1 otherwise.
See error management for details.

template<typename T>
int tlConst< T >::update ( input  )  [inline]

Update the constant with new data.

Parameters:
input new input to the constant
Returns:
0 on success, -1 otherwise.
See error management for details.

template<typename T>
int tlConst< T >::getTol (  )  [inline]

Return the tolerance filter for input values [%].

Returns:
Tolerance [%]
-1 means that no filtering is currently in use
See also:
setTol()

template<typename T>
int tlConst< T >::getVal (  )  [inline]

Return the current best estimate for the constant value; the value is cast to the template type.

Returns:
The current best estimate for the constant value.

template<typename T>
int tlConst< T >::getNext (  )  [inline]

Return the current best prediction for the next constant value; the value is cast to the template type.

Returns:
The current best prediction for the next constant value.

template<typename T>
template< typename T > float tlConst< T >::getState (  )  [inline]

Return the actual best estimate for the constant value; the value is NOT cast to the template type.

Returns:
the actual best estimate for the constant value
Remarks:
The purpose of this routine is only to get access to untruncated value of the constant.
See also:
getVal()

template<typename T>
float tlConst< T >::getEstimate (  )  [inline]

Return the actual best prediction for the next constant value; the value is NOT cast to the template type.

Returns:
The actual best prediction for the next constant value.
Remarks:
the purpose of this routine is only to get access to untruncated value of the prediction.
See also:
getNext()


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

TLIB documentation - generated on 7 May 2008
Please address any questions to seb@tuyphon.com
(C) 2001-2008 - S. Grange
(C) 2001-2007 - VRAI Group, EPFL
All Rights Reserved.