# opentl::models::LinearARModels Class Reference

Implemented class Continuous White Noise Acceleration (CWNA) motion model. More...

Inherits opentl::models::Motion.

Inherited by opentl::models::Brownian, opentl::models::ConstantVelocity, and opentl::models::Oscillatory.

List of all members.

## Public Member Functions
virtual math::SquareMatrix & | getNoiseCovariance ()
| Get process noise covariance matrix.
virtual int | getNoiseDim ()
| Returns dimension of process noise square matrix.
virtual void | getUniformPrior (opentl::core::State &srcDstState)
| Function to get the first state prior for the tracking. The filter calls this function at initialization. Requires to call setNoiseCovariance() first to get range values for uniform distribution.
| LinearARModels (MotionType motionType, boost::shared_ptr< opentl::core::State > stateTemplate, math::Matrix *matB=NULL, double deltaT=1.0)
| Constructor.
virtual void | predictMotion (opentl::core::State &srcDstState, bool addNoise=false, double deltaT=-1.0, math::SquareMatrix *noiseCovMat=NULL, math::SquareMatrix *jacStateTrans=NULL, math::Vector *inputU=NULL)
| Predicts state(k+1) based on specific motion model.
virtual void | setAveragePose (const math::Vector &averagePose)
| Set average pose value (used by constrained models, with additive update only).
virtual void | setNoiseCovariance (const math::SquareMatrix &noiseCovMat)
| Set process noise covariance, and update matrices accordingly.
virtual void | setUniformNoiseRange (const math::Vector &uniformNoiseRange)
| Set uniform noise range (for the initial prior).
virtual void | updateMatrices ()=0
| Update internal matrices (mMatA, mMatW, mMatQw) according to the (real-time) lag mDeltaT.
virtual | ~LinearARModels ()
| Destructor.
## Protected Member Functions
void | convertMatricesToRealTime ()
| Convert AR matrices, from time-less (A,W) to real-time (At,Wt). Time-less state model: s(t) = [p(t),p(t-1)] Real-time state model: s(t) = [p(t),p_dot(t)] Conversion matrix: H = [I I*dt; I 0] New matrices: At = inv(H)*A*H; Wt = inv(H)*W;.
## Protected Attributes
math::Matrix | matWTmp
math::Vector | mAveragePoseVec
| Average pose vector.
math::SquareMatrix | mMatA
| Real-time state transition matrix (A).
math::SquareMatrix | mMatATimeless
| Time-less version of state transition matrix (A).
math::Matrix * | mMatB
| Control matrix (B) if input vector u is given.
math::SquareMatrix | mMatH
| Conversion matrix between time-less and real-time AR model (function of deltaT).
math::SquareMatrix | mMatNoiseCov
| Process noise covariance.
math::SquareMatrix | mMatQw
| Process noise covariance matrix Qw = (W*w)*(W*w)'.
math::Matrix | mMatW
| Real-time process noise matrix (W).
math::Matrix | mMatWTimeless
| Time-less version of process noise matrix (W).
math::Vector | mNoiseParamVecW
| Vectors containing std for Gaussian noise generation (obtained from mMatNoiseCov).
math::Vector | mNoiseVecW
| Process noise vector (w).
int | mPoseIncDim
| Pose degrees of freedom (increment dimension).
int | mStateIncDim
| Full state degrees of freedom (increment dimension).
math::Vector | mStateTmp
math::Vector | mUniformNoiseRange
| Range of uniform noise (-u,u) for initializing the *absolute* pose vector.
math::Vector | mVecTmp
| hold temporary state information

## Detailed Description

Implemented class Continuous White Noise Acceleration (CWNA) motion model.

Author:
  Erwin Roth, erwin.roth@weihenstephan.org; Giorgio Panin, panin@in.tum.de

## Constructor & Destructor Documentation

opentl::models::LinearARModels::LinearARModels | ( | MotionType | motionType,
|  | boost::shared_ptr< opentl::core::State > | stateTemplate,
|  | math::Matrix * | matB = `NULL`,
|  | double | deltaT = `1.0` |
| ) |  |  |

Constructor.

Parameters:

  | motionType | Motion type used for Linear ARModels
  | stateTemplate | The state representation this model is using.
  | matB | Optional: input matrix B
  | deltaT | Optional: (default=deltaT is dynamic).

virtual opentl::models::LinearARModels::~LinearARModels | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

void opentl::models::LinearARModels::convertMatricesToRealTime | ( |  | ) | `[protected]`

Convert AR matrices, from time-less (A,W) to real-time (At,Wt). Time-less state model: s(t) = [p(t),p(t-1)] Real-time state model: s(t) = [p(t),p_dot(t)] Conversion matrix: H = [I I*dt; I 0] New matrices: At = inv(H)*A*H; Wt = inv(H)*W;.

virtual math::SquareMatrix& opentl::models::LinearARModels::getNoiseCovariance | ( |  | ) | `[virtual]`

Get process noise covariance matrix.

Implements opentl::models::Motion.

virtual int opentl::models::LinearARModels::getNoiseDim | ( |  | ) | `[virtual]`

Returns dimension of process noise square matrix.

Returns:
  Dimension of process noise

Implements opentl::models::Motion.

virtual void opentl::models::LinearARModels::getUniformPrior | ( | opentl::core::State & | srcDstState | ) | `[virtual]`

Function to get the first state prior for the tracking. The filter calls this function at initialization. Requires to call setNoiseCovariance() first to get range values for uniform distribution.

Parameters:

  | srcDstState | State used as basis for initialization of motion

Implements opentl::models::Motion.

virtual void opentl::models::LinearARModels::predictMotion | ( | opentl::core::State & | srcDstState,
|  | bool | addNoise = `false`,
|  | double | deltaT = `-1.0`,
|  | math::SquareMatrix * | noiseCovMat = `NULL`,
|  | math::SquareMatrix * | jacStateTrans = `NULL`,
|  | math::Vector * | inputU = `NULL` |
| ) |  |  | `[virtual]`

Predicts state(k+1) based on specific motion model.

Parameters:

  | srcDstState | Variable holding input and output state
  | addNoise | Optional: (default = false) if true, process noise will be added to state(k+1)
  | deltaT | Real time interval for the prediction [msec] (-1 = use fixed deltaT, internally set)
  | noiseCovMat | Gives access to (dynamic) process noise covariance matrix
  | jacStateTrans | Optional: returns Jacobian of state transition matrix
  | inputU | Optional: input control vector (u)

Implements opentl::models::Motion.

virtual void opentl::models::LinearARModels::setAveragePose | ( | const math::Vector & | averagePose | ) | `[inline, virtual]`

Set average pose value (used by constrained models, with additive update only).

Parameters:

  | averagePose | Input average pose vector

Implements opentl::models::Motion.

virtual void opentl::models::LinearARModels::setNoiseCovariance | ( | const math::SquareMatrix & | noiseCovMat | ) | `[virtual]`

Set process noise covariance, and update matrices accordingly.

Implements opentl::models::Motion.

virtual void opentl::models::LinearARModels::setUniformNoiseRange | ( | const math::Vector & | uniformNoiseRange | ) | `[inline, virtual]`

Set uniform noise range (for the initial prior).

Implements opentl::models::Motion.

virtual void opentl::models::LinearARModels::updateMatrices | ( |  | ) | `[pure virtual]`

Update internal matrices (mMatA, mMatW, mMatQw) according to the (real-time) lag mDeltaT.

Implemented in opentl::models::Brownian, opentl::models::ConstantVelocity, and opentl::models::Oscillatory.

## Member Data Documentation

math::Matrix opentl::models::LinearARModels::matWTmp`[protected]`

math::Vector opentl::models::LinearARModels::mAveragePoseVec`[protected]`

Average pose vector.

math::SquareMatrix opentl::models::LinearARModels::mMatA`[protected]`

Real-time state transition matrix (A).

math::SquareMatrix opentl::models::LinearARModels::mMatATimeless`[protected]`

Time-less version of state transition matrix (A).

math::Matrix* opentl::models::LinearARModels::mMatB`[protected]`

Control matrix (B) if input vector u is given.

math::SquareMatrix opentl::models::LinearARModels::mMatH`[protected]`

Conversion matrix between time-less and real-time AR model (function of deltaT).

math::SquareMatrix opentl::models::LinearARModels::mMatNoiseCov`[protected]`

Process noise covariance.

math::SquareMatrix opentl::models::LinearARModels::mMatQw`[protected]`

Process noise covariance matrix Qw = (W*w)*(W*w)'.

math::Matrix opentl::models::LinearARModels::mMatW`[protected]`

Real-time process noise matrix (W).

math::Matrix opentl::models::LinearARModels::mMatWTimeless`[protected]`

Time-less version of process noise matrix (W).

math::Vector opentl::models::LinearARModels::mNoiseParamVecW`[protected]`

Vectors containing std for Gaussian noise generation (obtained from mMatNoiseCov).

math::Vector opentl::models::LinearARModels::mNoiseVecW`[protected]`

Process noise vector (w).

int opentl::models::LinearARModels::mPoseIncDim`[protected]`

Pose degrees of freedom (increment dimension).

int opentl::models::LinearARModels::mStateIncDim`[protected]`

Full state degrees of freedom (increment dimension).

math::Vector opentl::models::LinearARModels::mStateTmp`[protected]`

math::Vector opentl::models::LinearARModels::mUniformNoiseRange`[protected]`

Range of uniform noise (-u,u) for initializing the *absolute* pose vector.

math::Vector opentl::models::LinearARModels::mVecTmp`[protected]`

hold temporary state information