This class acts as a common interface to the different interfaces (see CParticleFilter::TParticleFilterAlgorithm) any bayes::CParticleFilterCapable class can implement: it is the invoker of particle filter algorithms.
The particle filter is executed on a probability density function (PDF) described by a CParticleFilterCapable object, passed in the constructor or alternatively through the CParticleFilter::executeOn method.
For a complete example and further details, see the Particle Filter tutorial.
The basic SIR algorithm (pfStandardProposal) consists of:
Definition at line 40 of file CParticleFilter.h.
#include <mrpt/bayes/CParticleFilter.h>
Classes | |
struct | TParticleFilterOptions |
The configuration of a particle filter. More... | |
struct | TParticleFilterStats |
Statistics for being returned from the "execute" method. More... | |
Public Types | |
enum | TParticleFilterAlgorithm { pfStandardProposal = 0 , pfAuxiliaryPFStandard , pfOptimalProposal , pfAuxiliaryPFOptimal } |
Defines different types of particle filter algorithms. More... | |
enum | TParticleResamplingAlgorithm { prMultinomial = 0 , prResidual , prStratified , prSystematic } |
Defines the different resampling algorithms. More... | |
Public Member Functions | |
CParticleFilter () | |
Default constructor. | |
virtual | ~CParticleFilter () |
void | executeOn (CParticleFilterCapable &obj, const mrpt::obs::CActionCollection *action, const mrpt::obs::CSensoryFrame *observation, TParticleFilterStats *stats=NULL) |
Executes a complete prediction + update step of the selected particle filtering algorithm. | |
Static Public Member Functions | |
static void | printf_debug (const char *frmt,...) |
Sends a formated text to "debugOut" if not NULL, or to cout otherwise. | |
Public Attributes | |
CParticleFilter::TParticleFilterOptions | m_options |
The options to be used in the PF, must be set before executing any step of the particle filter. | |
Defines different types of particle filter algorithms.
The defined SIR implementations are:
See the theoretical discussion in resampling schemes.
Enumerator | |
---|---|
pfStandardProposal | |
pfAuxiliaryPFStandard | |
pfOptimalProposal | |
pfAuxiliaryPFOptimal |
Definition at line 53 of file CParticleFilter.h.
Defines the different resampling algorithms.
The implemented resampling methods are:
See the theoretical discussion in resampling schemes.
Enumerator | |
---|---|
prMultinomial | |
prResidual | |
prStratified | |
prSystematic |
Definition at line 70 of file CParticleFilter.h.
mrpt::bayes::CParticleFilter::CParticleFilter | ( | ) |
Default constructor.
After creating the PF object, set the options in CParticleFilter::m_options, then execute steps through CParticleFilter::executeOn.
|
inlinevirtual |
Definition at line 129 of file CParticleFilter.h.
void mrpt::bayes::CParticleFilter::executeOn | ( | CParticleFilterCapable & | obj, |
const mrpt::obs::CActionCollection * | action, | ||
const mrpt::obs::CSensoryFrame * | observation, | ||
TParticleFilterStats * | stats = NULL |
||
) |
Executes a complete prediction + update step of the selected particle filtering algorithm.
The member CParticleFilter::m_options must be set before calling this to settle the algorithm parameters.
obj | The object representing the probability distribution function (PDF) which apply the particle filter algorithm to. |
action | A pointer to an action in the form of a CActionCollection, or NULL if there is no action. |
observation | A pointer to observations in the form of a CSensoryFrame, or NULL if there is no observation. |
stats | An output structure for gathering statistics of the particle filter execution, or set to NULL if you do not need it (see CParticleFilter::TParticleFilterStats). |
|
staticinherited |
Sends a formated text to "debugOut" if not NULL, or to cout otherwise.
Referenced by mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::execute().
CParticleFilter::TParticleFilterOptions mrpt::bayes::CParticleFilter::m_options |
The options to be used in the PF, must be set before executing any step of the particle filter.
Definition at line 150 of file CParticleFilter.h.
Page generated by Doxygen 1.9.8 for MRPT 1.4.0 SVN: at Wed Dec 6 15:06:50 UTC 2023 |