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:
35  using CParticleDataContent =
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
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.
The struct for passing extra simulation parameters to the prediction stage when running a particle fi...
void PF_SLAM_implementation_custom_update_particle_with_new_pose(CParticleDataContent *particleData, const mrpt::math::TPose3D &newPose) const
mrpt::poses::CPose3DPDFParticles::CParticleList CParticleList
Statistics for being returned from the "execute" method.
Declares a class for storing a collection of robot actions.
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...
A set of common data shared by PF implementations for both SLAM and localization. ...
CPose3D CParticleDataContent
This is the type inside the corresponding CParticleData class.
TMonteCarloLocalizationParams options
MCL parameters.
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
Definition: CSensoryFrame.h:54
This class acts as a common interface to the different interfaces (see CParticleFilter::TParticleFilt...
Declares a class that represents a Probability Density Function (PDF) over a 3D pose (x...
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 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
mrpt::poses::CPose3DPDFParticles m_poseParticles
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)
The configuration of a particle filter.
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
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
GLenum GLint x
Definition: glext.h:3538
mrpt::math::TPose3D getLastPose(const size_t i, bool &is_valid_pose) const override
Return the robot pose for the i&#39;th particle.
Declares a class that represents a Probability Density function (PDF) of a 3D pose.



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019