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
mrpt::bayes::CParticleFilterData< mrpt::math::TPose3D, mrpt::bayes::particle_storage_mode::VALUE >::CParticleList
std::deque< CParticleData > CParticleList
Use this type to refer to the list of particles m_particles.
Definition: CParticleFilterData.h:214
mrpt::slam::CMonteCarloLocalization3D::prediction_and_update_pfAuxiliaryPFOptimal
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.
Definition: CMonteCarloLocalization3D.cpp:149
mrpt::slam::CMonteCarloLocalization3D
Declares a class that represents a Probability Density Function (PDF) over a 3D pose (x,...
Definition: CMonteCarloLocalization3D.h:32
mrpt::slam::CMonteCarloLocalization3D::getLastPose
mrpt::math::TPose3D getLastPose(const size_t i, bool &is_valid_pose) const override
Return the robot pose for the i'th particle.
Definition: CMonteCarloLocalization3D.cpp:84
TMonteCarloLocalizationParams.h
PF_implementations_data.h
mrpt::obs::CActionCollection
Declares a class for storing a collection of robot actions.
Definition: CActionCollection.h:28
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::slam::CMonteCarloLocalization3D::CMonteCarloLocalization3D
CMonteCarloLocalization3D(size_t M=1)
Constructor.
Definition: CMonteCarloLocalization3D.cpp:78
mrpt::slam::CMonteCarloLocalization3D::PF_SLAM_implementation_replaceByNewParticleSet
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
Definition: CMonteCarloLocalization3D.cpp:204
mrpt::obs::CSensoryFrame
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
Definition: CSensoryFrame.h:54
mrpt::bayes::CParticleFilterData< mrpt::math::TPose3D, mrpt::bayes::particle_storage_mode::VALUE >::CParticleDataContent
mrpt::math::TPose3D CParticleDataContent
This is the type inside the corresponding CParticleData class.
Definition: CParticleFilterData.h:210
mrpt::slam::CMonteCarloLocalization3D::prediction_and_update_pfStandardProposal
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.
Definition: CMonteCarloLocalization3D.cpp:98
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
mrpt::slam::PF_implementation
A set of common data shared by PF implementations for both SLAM and localization.
Definition: PF_implementations_data.h:40
obs_frwds.h
mrpt::math::TPose3D
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
Definition: lightweight_geom_data.h:603
mrpt::poses::CPose3DPDFParticles
Declares a class that represents a Probability Density function (PDF) of a 3D pose.
Definition: CPose3DPDFParticles.h:31
mrpt::slam::CMonteCarloLocalization3D::PF_SLAM_computeObservationLikelihoodForParticle
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.
Definition: CMonteCarloLocalization3D.cpp:173
mrpt::slam::CMonteCarloLocalization3D::PF_SLAM_implementation_custom_update_particle_with_new_pose
void PF_SLAM_implementation_custom_update_particle_with_new_pose(CParticleDataContent *particleData, const mrpt::math::TPose3D &newPose) const
Definition: CMonteCarloLocalization3D.cpp:198
mrpt::slam::CMonteCarloLocalization3D::prediction_and_update_pfAuxiliaryPFStandard
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.
Definition: CMonteCarloLocalization3D.cpp:123
mrpt::slam::TMonteCarloLocalizationParams
The struct for passing extra simulation parameters to the prediction stage when running a particle fi...
Definition: TMonteCarloLocalizationParams.h:23
mrpt::slam::CMonteCarloLocalization3D::options
TMonteCarloLocalizationParams options
MCL parameters.
Definition: CMonteCarloLocalization3D.h:40
mrpt::bayes::CParticleFilter::TParticleFilterOptions
The configuration of a particle filter.
Definition: CParticleFilter.h:102
x
GLenum GLint x
Definition: glext.h:3538
CPose3DPDFParticles.h



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST