Main MRPT website > C++ reference for MRPT 1.9.9
CMonteCarloLocalization3D.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #ifndef CMonteCarloLocalization3D_H
10 #define CMonteCarloLocalization3D_H
11 
15 #include <mrpt/obs/obs_frwds.h>
16 
17 namespace mrpt
18 {
19 namespace slam
20 {
21 /** Declares a class that represents a Probability Density Function (PDF) over a
22  * 3D pose (x,y,phi,yaw,pitch,roll), using a set of weighted samples.
23  *
24  * This class also implements particle filtering for robot localization. See
25  * the MRPT application "app/pf-localization" for an example of usage.
26  *
27  * \sa CMonteCarloLocalization2D, CPose2D, CPosePDF, CPoseGaussianPDF,
28  * \ingroup mrpt_slam_grp
29  */
31  : public PF_implementation<
32  mrpt::poses::CPose3D, mrpt::poses::CPose3DPDFParticles>
33 {
34  public:
38 
40 
41  /** MCL parameters */
43 
44  /** Constructor
45  * \param M The number of m_particles.
46  */
47  CMonteCarloLocalization3D(size_t M = 1);
48 
49  /** Destructor */
51 
52  /** Update the m_particles, predicting the posterior of robot pose and map
53  * after a movement command.
54  * This method has additional configuration parameters in "options".
55  * Performs the update stage of the RBPF, using the sensed CSensoryFrame:
56  *
57  * \param action This is a pointer to CActionCollection, containing the
58  * pose change the robot has been commanded.
59  * \param observation This must be a pointer to a CSensoryFrame object,
60  * with robot sensed observations.
61  *
62  * \sa options
63  */
64  template <typename T>
66  const mrpt::obs::CActionCollection* action,
67  const mrpt::obs::CSensoryFrame* observation,
69 
70  /** \name Virtual methods that the PF_implementations assume exist.
71  @{ */
72  /** Return the robot pose for the i'th particle. is_valid is
73  * always true in this class. */
75  const size_t i, bool& is_valid_pose) const override;
76 
78  CParticleDataContent* particleData,
79  const mrpt::math::TPose3D& newPose) const;
80 
81  // We'll redefine this one:
83  CParticleList& old_particles,
84  const std::vector<mrpt::math::TPose3D>& newParticles,
85  const std::vector<double>& newParticlesWeight,
86  const std::vector<size_t>& newParticlesDerivedFromIdx) const;
87 
88  /** Evaluate the observation likelihood for one particle at a given location
89  */
92  const size_t particleIndexForMap,
93  const mrpt::obs::CSensoryFrame& observation,
94  const mrpt::poses::CPose3D& x) const;
95  /** @} */
96 
97  void executeOn(
99  const mrpt::obs::CActionCollection* action,
100  const mrpt::obs::CSensoryFrame* observation,
103 
104 }; // End of class def.
105 
106 } // namespace slam
107 } // namespace mrpt
108 
109 #endif
std::deque< CParticleData > CParticleList
Use this type to refer to the list of particles m_particles.
CPose3D CParticleDataContent
This is the type inside the corresponding CParticleData class.
This class acts as a common interface to the different interfaces (see CParticleFilter::TParticleFilt...
TParticleFilterAlgorithm
Defines different types of particle filter algorithms.
Declares a class for storing a collection of robot actions.
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
Definition: CSensoryFrame.h:55
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:89
Declares a class that represents a Probability Density function (PDF) of a 3D pose.
Declares a class that represents a Probability Density Function (PDF) over a 3D pose (x,...
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
Evaluate the observation likelihood for one particle at a given location.
mrpt::poses::CPose3DPDFParticles::CParticleDataContent CParticleDataContent
void prediction_and_update(const mrpt::obs::CActionCollection *action, 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.
mrpt::poses::CPose3DPDFParticles::CParticleList CParticleList
void PF_SLAM_implementation_custom_update_particle_with_new_pose(CParticleDataContent *particleData, const mrpt::math::TPose3D &newPose) const
mrpt::poses::CPose3DPDFParticles m_poseParticles
TMonteCarloLocalizationParams options
MCL parameters.
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
mrpt::math::TPose3D getLastPose(const size_t i, bool &is_valid_pose) const override
Return the robot pose for the i'th particle.
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)
A set of common data shared by PF implementations for both SLAM and localization.
GLenum GLint x
Definition: glext.h:3538
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
The configuration of a particle filter.
Statistics for being returned from the "execute" method.
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
The struct for passing extra simulation parameters to the prediction stage when running a particle fi...



Page generated by Doxygen 1.9.1 for MRPT 1.9.9 Git: 63ea9d1f1 Thu Nov 23 00:06:53 2017 +0100 at mar 26 may 2026 12:19:29 CEST