Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BFL::Filter< StateVar, MeasVar > Class Template Referenceabstract

Abstract class representing an interface for Bayesian Filters. More...

#include <filter.h>

Inheritance diagram for BFL::Filter< StateVar, MeasVar >:
Inheritance graph
[legend]

Public Member Functions

 Filter (Pdf< StateVar > *prior)
 Constructor. More...
 
 Filter (const Filter< StateVar, MeasVar > &filt)
 copy constructor More...
 
virtual Pdf< StateVar > * PostGet ()
 Get Posterior density. More...
 
virtual void Reset (Pdf< StateVar > *prior)
 Reset Filter. More...
 
int TimeStepGet () const
 Get current time. More...
 
virtual bool Update (SystemModel< StateVar > *const sysmodel, const StateVar &u, MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z, const StateVar &s)
 Full Update (system with inputs/sensing params) More...
 
virtual bool Update (SystemModel< StateVar > *const sysmodel, MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z, const StateVar &s)
 Full Update (system without inputs, with sensing params) More...
 
virtual bool Update (SystemModel< StateVar > *const sysmodel, MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z)
 Full Update (system without inputs/sensing params) More...
 
virtual bool Update (SystemModel< StateVar > *const sysmodel, const StateVar &u, MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z)
 Full Update (system with inputs, without sensing params) More...
 
virtual bool Update (SystemModel< StateVar > *const sysmodel, const StateVar &u)
 System Update (system with inputs) More...
 
virtual bool Update (SystemModel< StateVar > *const sysmodel)
 System Update (system without inputs) More...
 
virtual bool Update (MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z, const StateVar &s)
 Measurement Update (system with "sensing params") More...
 
virtual bool Update (MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z)
 Measurement Update (system without "sensing params") More...
 
virtual ~Filter ()
 destructor More...
 

Protected Member Functions

virtual bool UpdateInternal (SystemModel< StateVar > *const sysmodel, const StateVar &u, MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z, const StateVar &s)=0
 Actual implementation of Update, varies along filters. More...
 

Protected Attributes

Pdf< StateVar > * _post
 Pointer to the Posterior Pdf. More...
 
Pdf< StateVar > * _prior
 prior Pdf More...
 
int _timestep
 Represents the current timestep of the filter. More...
 

Detailed Description

template<typename StateVar, typename MeasVar>
class BFL::Filter< StateVar, MeasVar >

Abstract class representing an interface for Bayesian Filters.

This is the Abstract interface class that defines the interface of Bayesian filters. These filters are all related to i) a System Model, ii) a Measurement Model and iii) a Prior density reflecting the subjective belief of the person applying the filter BEFORE getting sensor or any other form of information about the modeled system.

This class is the base class for particle filters, kalman filters, ...

This class is a template class with 2 templates. In this way it allows filtering for "semi-discrete" models, eg. models with a fixed number of states (discrete states) but with continuous observations, as needed in Automatic Speech Recognition.

See also
Pdf SystemModel MeasurementModel ConditionalPdf
Bug:
For now, due to a "bug" (= non-existence of a feature :-) in the ConditionalPdf class, STATES AND INPUTS MUST BE OF THE SAME TYPE (both discrete, or both continuous! This means that you can use this class for the following model types:
  • States, inputs and measurements continuous (most frequently used?)
  • States and inputs continous, Measurements discrete
  • States and inputs discrete, Measurements continous
  • States, inputs and measurements discrete

StateVar represents the nature of the states and inputs MeasVar represents the nature of the measurements

BEWARE: The order of the template arguments is reversed with respect to the notation used in "measurementmodel.h"

Definition at line 77 of file filter.h.

Constructor & Destructor Documentation

template<typename SVar, typename MVar >
BFL::Filter< SVar, MVar >::Filter ( Pdf< SVar > *  prior)

Constructor.

Precondition
you created the prior
Parameters
priorpointer to the prior Pdf

Definition at line 27 of file filter.h.

template<typename SVar, typename MVar>
BFL::Filter< SVar, MVar >::Filter ( const Filter< SVar, MVar > &  filt)

copy constructor

Bug:
we should make a copy of the prior
Todo:
Check if we should make a copy of the pdf's too?
Bug:
we should make a copy of the pdf's too

Definition at line 38 of file filter.h.

template<typename SVar , typename MVar >
BFL::Filter< SVar, MVar >::~Filter ( )
virtual

destructor

Definition at line 32 of file filter.cpp.

Member Function Documentation

template<typename SVar , typename MVar >
Pdf< SVar > * BFL::Filter< SVar, MVar >::PostGet ( )
virtual

Get Posterior density.

Get the current Posterior density

Returns
a pointer to the current posterior

Reimplemented in BFL::MixtureParticleFilter< StateVar, MeasVar >, BFL::ParticleFilter< StateVar, MeasVar >, BFL::ParticleFilter< ColumnVector, ColumnVector >, BFL::HistogramFilter< MeasVar >, and BFL::KalmanFilter.

Definition at line 126 of file filter.cpp.

template<typename SVar, typename MVar >
void BFL::Filter< SVar, MVar >::Reset ( Pdf< SVar > *  prior)
virtual

Reset Filter.

Definition at line 41 of file filter.cpp.

template<typename SVar , typename MVar >
int BFL::Filter< SVar, MVar >::TimeStepGet ( ) const

Get current time.

Get the current time of the filter

Returns
the current timestep

Definition at line 49 of file filter.cpp.

template<typename SVar, typename MVar>
bool BFL::Filter< SVar, MVar >::Update ( SystemModel< SVar > *const  sysmodel,
const SVar &  u,
MeasurementModel< MVar, SVar > *const  measmodel,
const MVar &  z,
const SVar &  s 
)
virtual

Full Update (system with inputs/sensing params)

Parameters
sysmodelpointer to the system model to use for update
uinput to the system
measmodelpointer to the measurement model to use for update
zmeasurement
s"sensing parameter"

Definition at line 56 of file filter.h.

template<typename SVar, typename MVar>
bool BFL::Filter< SVar, MVar >::Update ( SystemModel< SVar > *const  sysmodel,
MeasurementModel< MVar, SVar > *const  measmodel,
const MVar &  z,
const SVar &  s 
)
virtual

Full Update (system without inputs, with sensing params)

Parameters
sysmodelpointer to the system model to use for update
measmodelpointer to the measurement model to use for update
zmeasurement
s"sensing parameter"

Definition at line 66 of file filter.h.

template<typename SVar, typename MVar>
bool BFL::Filter< SVar, MVar >::Update ( SystemModel< SVar > *const  sysmodel,
MeasurementModel< MVar, SVar > *const  measmodel,
const MVar &  z 
)
virtual

Full Update (system without inputs/sensing params)

Parameters
sysmodelpointer to the system model to use for update
measmodelpointer to the measurement model to use for update
zmeasurement

Definition at line 76 of file filter.h.

template<typename SVar, typename MVar>
bool BFL::Filter< SVar, MVar >::Update ( SystemModel< SVar > *const  sysmodel,
const SVar &  u,
MeasurementModel< MVar, SVar > *const  measmodel,
const MVar &  z 
)
virtual

Full Update (system with inputs, without sensing params)

Parameters
sysmodelpointer to the system model to use for update
uinput to the system
measmodelpointer to the measurement model to use for update
zmeasurement

Definition at line 85 of file filter.h.

template<typename SVar, typename MVar >
bool BFL::Filter< SVar, MVar >::Update ( SystemModel< SVar > *const  sysmodel,
const SVar &  u 
)
virtual

System Update (system with inputs)

Parameters
sysmodelpointer to the system model to use for update
uinput to the system

Definition at line 95 of file filter.h.

template<typename SVar, typename MVar >
bool BFL::Filter< SVar, MVar >::Update ( SystemModel< SVar > *const  sysmodel)
virtual

System Update (system without inputs)

Parameters
sysmodelpointer to the system model to use for update

Definition at line 103 of file filter.h.

template<typename SVar, typename MVar>
bool BFL::Filter< SVar, MVar >::Update ( MeasurementModel< MVar, SVar > *const  measmodel,
const MVar &  z,
const SVar &  s 
)
virtual

Measurement Update (system with "sensing params")

Parameters
measmodelpointer to the measurement model to use for update
zmeasurement
s"sensing parameter"

Definition at line 110 of file filter.h.

template<typename SVar, typename MVar>
bool BFL::Filter< SVar, MVar >::Update ( MeasurementModel< MVar, SVar > *const  measmodel,
const MVar &  z 
)
virtual

Measurement Update (system without "sensing params")

Parameters
measmodelpointer to the measurement model to use for update
zmeasurement

Definition at line 119 of file filter.h.

template<typename StateVar, typename MeasVar>
virtual bool BFL::Filter< StateVar, MeasVar >::UpdateInternal ( SystemModel< StateVar > *const  sysmodel,
const StateVar u,
MeasurementModel< MeasVar, StateVar > *const  measmodel,
const MeasVar z,
const StateVar s 
)
protectedpure virtual

Actual implementation of Update, varies along filters.

Parameters
sysmodelpointer to the used system model
uinput param for proposal density
measmodelpointer to the used measurementmodel
zmeasurement param for proposal density
ssensor param for proposal density

Implemented in BFL::ParticleFilter< StateVar, MeasVar >, BFL::ParticleFilter< ColumnVector, ColumnVector >, BFL::KalmanFilter, BFL::MixtureParticleFilter< StateVar, MeasVar >, BFL::HistogramFilter< MeasVar >, BFL::ASIRFilter< StateVar, MeasVar >, BFL::BootstrapFilter< StateVar, MeasVar >, BFL::MixtureBootstrapFilter< StateVar, MeasVar >, and BFL::EKParticleFilter.

Member Data Documentation

template<typename StateVar, typename MeasVar>
Pdf<StateVar>* BFL::Filter< StateVar, MeasVar >::_post
protected

Pointer to the Posterior Pdf.

The Posterior Pdf represents the subjective belief of the person applying the filter AFTER processing inputs and measurements. A filter does not maintain the beliefs at all timesteps t, since this leads to non-constant (or ever growing if you prefer) memory requirements. However, it is possible, to copy the Posterior density at all timesteps in your application by means of the PostGet() member function

See also
PostGet()

Definition at line 95 of file filter.h.

template<typename StateVar, typename MeasVar>
Pdf<StateVar>* BFL::Filter< StateVar, MeasVar >::_prior
protected

prior Pdf

Definition at line 82 of file filter.h.

template<typename StateVar, typename MeasVar>
int BFL::Filter< StateVar, MeasVar >::_timestep
protected

Represents the current timestep of the filter.

Todo:
Check wether this really belongs here

Definition at line 100 of file filter.h.


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


bfl
Author(s): Klaas Gadeyne, Wim Meeussen, Tinne Delaet and many others. See web page for a full contributor list. ROS package maintained by Wim Meeussen.
autogenerated on Mon Jun 10 2019 12:48:01