Go to the documentation of this file.
26 class CActionCollection;
53 obj.prediction_and_update(action, observation,
m_options);
57 obj.normalizeWeights();
63 const size_t M =
obj.particlesCount();
71 double weightsMean = 0, var = 0;
72 for (
size_t i = 0; i < M; i++) weightsMean += exp(
obj.getW(i));
74 for (
size_t i = 0; i < M; i++)
75 var +=
square(exp(
obj.getW(i)) - weightsMean);
91 "Resampling particles (ESS was %.02f)\n",
obj.ESS()));
106 PF_algorithm,
"The PF algorithm to use. See TParticleFilterAlgorithm");
109 "The resampling algorithm to use. See TParticleResamplingAlgorithm");
113 "A flag that indicates whether the CParticleFilterCapable object "
114 "should perform adative sample size (default=false)");
117 "The resampling of particles will be performed when ESS (in range "
118 "[0,1]) < BETA (default is 0.5)");
121 "The initial number of particles in the filter (it can change only if "
122 "adaptiveSampleSize=true) (default=1)");
127 "An optional step to smooth dramatic changes in the observation model "
128 "to affect the variance of the particle weights (default=1)");
131 "Only for PF_algorithm=pfAuxiliaryPFOptimal");
134 "Only for PF_algorithm==pfAuxiliaryPFStandard");
147 adaptiveSampleSize,
bool,
iniFile, section.c_str());
152 max_loglikelihood_dyn_range,
double,
iniFile, section.c_str());
153 ASSERT_(max_loglikelihood_dyn_range >= 0);
156 section,
"PF_algorithm", PF_algorithm,
true);
158 section,
"resamplingMethod", resamplingMethod,
true);
163 pfAuxFilterOptimal_MaximumSearchSamples,
int,
iniFile,
169 pfAuxFilterOptimal_MaximumSearchSamples,
int,
iniFile,
174 pfAuxFilterStandard_FirstStageWeightsMonteCarlo,
bool,
iniFile,
177 pfAuxFilterOptimal_MLE,
bool,
iniFile, section.c_str());
bool adaptiveSampleSize
A flag that indicates whether the CParticleFilterCapable object should perform adative sample size (d...
void executeOn(CParticleFilterCapable &obj, const mrpt::obs::CActionCollection *action, const mrpt::obs::CSensoryFrame *observation, TParticleFilterStats *stats=nullptr)
Executes a complete prediction + update step of the selected particle filtering algorithm.
unsigned int pfAuxFilterOptimal_MaximumSearchSamples
In the algorithm "CParticleFilter::pfAuxiliaryPFOptimal" (and in "CParticleFilter::pfAuxiliaryPFStand...
#define MRPT_SAVE_CONFIG_VAR_COMMENT(variableName, __comment)
#define MRPT_LOAD_CONFIG_VAR( variableName, variableType, configFileObject, sectionNameStr)
An useful macro for loading variables stored in a INI-like file under a key with the same name that t...
#define MRPT_LOG_DEBUG(_STRING)
Use: MRPT_LOG_DEBUG("message");
Statistics for being returned from the "execute" method.
CParticleFilter::TParticleFilterOptions m_options
The options to be used in the PF, must be set before executing any step of the particle filter.
TParticleFilterAlgorithm
Defines different types of particle filter algorithms.
GLsizei GLsizei GLuint * obj
TParticleResamplingAlgorithm
Defines the different resampling algorithms.
virtual void saveToConfigFile(mrpt::config::CConfigFileBase &target, const std::string §ion) const override
This method saves the options to a ".ini"-like file or memory-stored string list.
double powFactor
An optional step to "smooth" dramatic changes in the observation model to affect the variance of the ...
double weightsVariance_beforeResample
double max_loglikelihood_dyn_range
Only for PF_algorithm=pfAuxiliaryPFOptimal: If a given particle has a max_likelihood (from the a-prio...
Declares a class for storing a collection of robot actions.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
mrpt::system::COutputLogger COutputLogger
#define ASSERT_(f)
Defines an assertion mechanism.
T square(const T x)
Inline function for the square of a number.
TParticleFilterAlgorithm PF_algorithm
The PF algorithm to use (default=pfStandardProposal) See TParticleFilterAlgorithm for the posibilitie...
#define MRPT_LOAD_CONFIG_VAR_NO_DEFAULT( variableName, variableType, configFileObject, sectionNameStr)
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
double ESS_beforeResample
This virtual class defines the interface that any particles based PDF class must implement in order t...
bool pfAuxFilterStandard_FirstStageWeightsMonteCarlo
Only for PF_algorithm==pfAuxiliaryPFStandard: If false, the APF will predict the first stage weights ...
This class allows loading and storing values and vectors of different types from a configuration text...
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
double BETA
The resampling of particles will be performed when ESS (in range [0,1]) < BETA (default is 0....
void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string §ion) override
This method load the options from a ".ini"-like file or memory-stored string list.
string iniFile(myDataDir+string("benchmark-options.ini"))
CParticleFilter()
Default constructor.
The namespace for Bayesian filtering algorithm: different particle filters and Kalman filter algorith...
GLsizei const GLchar ** string
unsigned int sampleSize
The initial number of particles in the filter (it can change only if adaptiveSampleSize=true) (defaul...
TParticleResamplingAlgorithm resamplingMethod
The resampling algorithm to use (default=prMultinomial).
bool pfAuxFilterOptimal_MLE
(Default=false) In the algorithm "CParticleFilter::pfAuxiliaryPFOptimal", if set to true,...
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |