9 #ifndef CPARTICLEFILTERCAPABLE_H 10 #define CPARTICLEFILTERCAPABLE_H 19 #define INVALID_LIKELIHOOD_VALUE (-1e300) // An invalid log-likelihood value, used to signal non-initialized likelihood variables. 54 typedef double ( *TParticleProbabilityEvaluator) (
59 const void * observation );
70 const void * observation )
94 void prepareFastDrawSample(
96 TParticleProbabilityEvaluator partEvaluator = defaultEvaluator,
97 const void * action = NULL,
98 const void * observation = NULL
115 virtual double getW(
size_t i)
const = 0;
119 virtual void setW(
size_t i,
double w) = 0;
123 virtual size_t particlesCount()
const = 0;
129 void prediction_and_update(
138 virtual void performSubstitution(
const std::vector<size_t> &indx) = 0;
144 virtual double normalizeWeights(
double *out_max_log_w = NULL ) =0;
149 virtual double ESS()
const = 0;
166 static void computeResampling(
168 const std::vector<double> &in_logWeights,
169 std::vector<size_t> &out_indexes,
170 size_t out_particle_count = 0
176 static void log2linearWeights(
177 const std::vector<double> &in_logWeights,
178 std::vector<double> &out_linWeights );
185 virtual void prediction_and_update_pfStandardProposal(
192 virtual void prediction_and_update_pfAuxiliaryPFStandard(
199 virtual void prediction_and_update_pfOptimalProposal(
206 virtual void prediction_and_update_pfAuxiliaryPFOptimal(
219 alreadyDrawnIndexes(),
220 alreadyDrawnNextOne(0)
static double defaultEvaluator(const bayes::CParticleFilter::TParticleFilterOptions &PF_options, const CParticleFilterCapable *obj, size_t index, const void *action, const void *observation)
The default evaluator function, which simply returns the particle weight.
std::vector< uint32_t > vector_uint
std::vector< double > CDF
size_t alreadyDrawnNextOne
vector_uint alreadyDrawnIndexes
GLsizei GLsizei GLuint * obj
Declares a class for storing a collection of robot actions.
Auxiliary vectors, see CParticleFilterCapable::prepareFastDrawSample for more information.
GLubyte GLubyte GLubyte GLubyte w
TParticleResamplingAlgorithm
Defines the different resampling algorithms.
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
virtual ~CParticleFilterCapable()
Virtual destructor.
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
This virtual class defines the interface that any particles based PDF class must implement in order t...
std::vector< double > PDF
This class acts as a common interface to the different interfaces (see CParticleFilter::TParticleFilt...
TFastDrawAuxVars m_fastDrawAuxiliary
Auxiliary vectors, see CParticleFilterCapable::prepareFastDrawSample for more information.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
The configuration of a particle filter.
static const unsigned PARTICLE_FILTER_CAPABLE_FAST_DRAW_BINS