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-2018, 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
26  * application "app/pf-localization" for an example of usage.
27  *
28  * \sa CMonteCarloLocalization2D, CPose2D, CPosePDF, CPoseGaussianPDF,
29  * CParticleFilterCapable
30  * \ingroup mrpt_slam_grp
31  */
34  public PF_implementation<
35  mrpt::math::TPose3D, CMonteCarloLocalization3D,
36  mrpt::bayes::particle_storage_mode::VALUE>
37 {
38  public:
39  /** MCL parameters */
41 
42  /** Constructor
43  * \param M The number of m_particles.
44  */
45  CMonteCarloLocalization3D(size_t M = 1);
46 
47  /** Update the m_particles, predicting the posterior of robot pose and map
48  * after a movement command.
49  * This method has additional configuration parameters in "options".
50  * Performs the update stage of the RBPF, using the sensed CSensoryFrame:
51  *
52  * \param action This is a pointer to CActionCollection, containing the
53  * pose change the robot has been commanded.
54  * \param observation This must be a pointer to a CSensoryFrame object,
55  * with robot sensed observations.
56  *
57  * \sa options
58  */
60  const mrpt::obs::CActionCollection* action,
61  const mrpt::obs::CSensoryFrame* observation,
63 
64  /** Update the m_particles, predicting the posterior of robot pose and map
65  * after a movement command.
66  * This method has additional configuration parameters in "options".
67  * Performs the update stage of the RBPF, using the sensed CSensoryFrame:
68  *
69  * \param Action This is a pointer to CActionCollection, containing the
70  * pose change the robot has been commanded.
71  * \param observation This must be a pointer to a CSensoryFrame object,
72  * with robot sensed observations.
73  *
74  * \sa options
75  */
77  const mrpt::obs::CActionCollection* action,
78  const mrpt::obs::CSensoryFrame* observation,
80 
81  /** Update the m_particles, predicting the posterior of robot pose and map
82  * after a movement command.
83  * This method has additional configuration parameters in "options".
84  * Performs the update stage of the RBPF, using the sensed CSensoryFrame:
85  *
86  * \param Action This is a pointer to CActionCollection, containing the
87  * pose change the robot has been commanded.
88  * \param observation This must be a pointer to a CSensoryFrame object,
89  * with robot sensed observations.
90  *
91  * \sa options
92  */
94  const mrpt::obs::CActionCollection* action,
95  const mrpt::obs::CSensoryFrame* observation,
97 
98  /** \name Virtual methods that the PF_implementations assume exist.
99  @{ */
100  /** Return the robot pose for the i'th particle. is_valid is
101  * always true in this class. */
103  const size_t i, bool& is_valid_pose) const override;
104 
106  CParticleDataContent* particleData,
107  const mrpt::math::TPose3D& newPose) const;
108 
109  // We'll redefine this one:
111  CParticleList& old_particles,
112  const std::vector<mrpt::math::TPose3D>& newParticles,
113  const std::vector<double>& newParticlesWeight,
114  const std::vector<size_t>& newParticlesDerivedFromIdx) const;
115 
116  /** Evaluate the observation likelihood for one particle at a given location
117  */
120  const size_t particleIndexForMap,
121  const mrpt::obs::CSensoryFrame& observation,
122  const mrpt::poses::CPose3D& x) const;
123  /** @} */
124 
125 }; // End of class def.
126 
127 } // End of namespace
128 } // End of namespace
129 
130 #endif
void prediction_and_update_pfAuxiliaryPFStandard(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...
The struct for passing extra simulation parameters to the prediction stage when running a particle fi...
void prediction_and_update_pfStandardProposal(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...
Declares a class for storing a collection of robot actions.
A set of common data shared by PF implementations for both SLAM and localization. ...
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.
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
std::deque< CParticleData > CParticleList
Use this type to refer to the list of particles m_particles.
void prediction_and_update_pfAuxiliaryPFOptimal(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...
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.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
The configuration of a particle filter.
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
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
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.
mrpt::math::TPose3D CParticleDataContent
This is the type inside the corresponding CParticleData class.



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019