9 #ifndef CMonteCarloLocalization2D_H 10 #define CMonteCarloLocalization2D_H 23 class COccupancyGridMap2D;
41 mrpt::poses::CPose2D, mrpt::poses::CPosePDFParticles>
82 const double freeCellsThreshold = 0.7,
const int particlesCount = -1,
83 const double x_min = -1e10f,
const double x_max = 1e10f,
84 const double y_min = -1e10f,
const double y_max = 1e10f,
85 const double phi_min = -
M_PI,
const double phi_max =
M_PI);
116 T::template PF_SLAM_implementation<
129 const size_t i,
bool& is_valid_pose)
const override;
138 const std::vector<mrpt::math::TPose3D>& newParticles,
139 const std::vector<double>& newParticlesWeight,
140 const std::vector<size_t>& newParticlesDerivedFromIdx)
const override;
146 const size_t particleIndexForMap,
The struct for passing extra simulation parameters to the prediction stage when running a particle fi...
mrpt::poses::CPosePDFParticles::CParticleDataContent CParticleDataContent
virtual ~CMonteCarloLocalization2D()
Destructor.
TMonteCarloLocalizationParams options
MCL parameters.
mrpt::maps::TMetricMapList metricMaps
[update stage] Alternative way (if metricMap==nullptr): A metric map is supplied for each particle: T...
Statistics for being returned from the "execute" method.
mrpt::maps::CMetricMap * metricMap
[update stage] Must be set to a metric map used to estimate the likelihood of observations ...
Declares a class for storing a collection of robot actions.
CMonteCarloLocalization2D(size_t M=1)
Constructor.
A set of common data shared by PF implementations for both SLAM and localization. ...
CPose2D CParticleDataContent
This is the type inside the corresponding CParticleData class.
void resetUniformFreeSpace(mrpt::maps::COccupancyGridMap2D *theMap, const double freeCellsThreshold=0.7, const int particlesCount=-1, const double x_min=-1e10f, const double x_max=1e10f, const double y_min=-1e10f, const double y_max=1e10f, const double phi_min=-M_PI, const double phi_max=M_PI)
Reset the PDF to an uniformly distributed one, but only in the free-space of a given 2D occupancy-gri...
CParticleList m_particles
The array of particles.
void PF_SLAM_implementation_replaceByNewParticleSet(CParticleList &old_particles, const std::vector< mrpt::math::TPose3D > &newParticles, const std::vector< double > &newParticlesWeight, const std::vector< size_t > &newParticlesDerivedFromIdx) const override
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
Declares a class that represents a Probability Density Function (PDF) over a 2D pose (x...
This class acts as a common interface to the different interfaces (see CParticleFilter::TParticleFilt...
double PF_SLAM_computeObservationLikelihoodForParticle(const mrpt::bayes::CParticleFilter::TParticleFilterOptions &PF_options, const size_t particleIndexForMap, const mrpt::obs::CSensoryFrame &observation, const mrpt::poses::CPose3D &x) const override
Evaluate the observation likelihood for one particle at a given location.
mrpt::poses::CPosePDFParticles m_poseParticles
Declares a class that represents a Probability Density Function (PDF) over a 2D pose (x...
mrpt::math::TPose3D getLastPose(const size_t i, bool &is_valid_pose) const override
Return the robot pose for the i'th particle.
Auxiliary structure used in KLD-sampling in particle filters.
A class for storing an occupancy grid map.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
std::deque< CParticleData > CParticleList
Use this type to refer to the list of particles m_particles.
TParticleFilterAlgorithm
Defines different types of particle filter algorithms.
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
The configuration of a particle filter.
void prediction_and_update(const mrpt::obs::CActionCollection *actions, const mrpt::obs::CSensoryFrame *observation, const bayes::CParticleFilter::TParticleFilterOptions &PF_options)
Update the m_particles, predicting the posterior of robot pose and map after a movement command...
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
void PF_SLAM_implementation_custom_update_particle_with_new_pose(CParticleDataContent *particleData, const mrpt::math::TPose3D &newPose) const override
void executeOn(mrpt::bayes::CParticleFilter &pf, const mrpt::obs::CActionCollection *action, const mrpt::obs::CSensoryFrame *observation, mrpt::bayes::CParticleFilter::TParticleFilterStats *stats, mrpt::bayes::CParticleFilter::TParticleFilterAlgorithm PF_algorithm)
mrpt::poses::CPosePDFParticles::CParticleList CParticleList
TKLDParams KLD_params
Parameters for dynamic sample size, KLD method.