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::slam
18 {
19 /** Declares a class that represents a Probability Density Function (PDF) over a
20  * 3D pose (x,y,phi,yaw,pitch,roll), using a set of weighted samples.
21  *
22  * This class also implements particle filtering for robot localization. See
23  * the MRPT
24  * application "app/pf-localization" for an example of usage.
25  *
26  * \sa CMonteCarloLocalization2D, CPose2D, CPosePDF, CPoseGaussianPDF,
27  * CParticleFilterCapable
28  * \ingroup mrpt_slam_grp
29  */
32  public PF_implementation<
33  mrpt::math::TPose3D, CMonteCarloLocalization3D,
34  mrpt::bayes::particle_storage_mode::VALUE>
35 {
36  public:
37  /** MCL parameters */
39 
40  /** Constructor
41  * \param M The number of m_particles.
42  */
43  CMonteCarloLocalization3D(size_t M = 1);
44 
45  /** Update the m_particles, predicting the posterior of robot pose and map
46  * after a movement command.
47  * This method has additional configuration parameters in "options".
48  * Performs the update stage of the RBPF, using the sensed CSensoryFrame:
49  *
50  * \param action This is a pointer to CActionCollection, containing the
51  * pose change the robot has been commanded.
52  * \param observation This must be a pointer to a CSensoryFrame object,
53  * with robot sensed observations.
54  *
55  * \sa options
56  */
58  const mrpt::obs::CActionCollection* action,
59  const mrpt::obs::CSensoryFrame* observation,
61 
62  /** Update the m_particles, predicting the posterior of robot pose and map
63  * after a movement command.
64  * This method has additional configuration parameters in "options".
65  * Performs the update stage of the RBPF, using the sensed CSensoryFrame:
66  *
67  * \param Action This is a pointer to CActionCollection, containing the
68  * pose change the robot has been commanded.
69  * \param observation This must be a pointer to a CSensoryFrame object,
70  * with robot sensed observations.
71  *
72  * \sa options
73  */
75  const mrpt::obs::CActionCollection* action,
76  const mrpt::obs::CSensoryFrame* observation,
78 
79  /** Update the m_particles, predicting the posterior of robot pose and map
80  * after a movement command.
81  * This method has additional configuration parameters in "options".
82  * Performs the update stage of the RBPF, using the sensed CSensoryFrame:
83  *
84  * \param Action This is a pointer to CActionCollection, containing the
85  * pose change the robot has been commanded.
86  * \param observation This must be a pointer to a CSensoryFrame object,
87  * with robot sensed observations.
88  *
89  * \sa options
90  */
92  const mrpt::obs::CActionCollection* action,
93  const mrpt::obs::CSensoryFrame* observation,
95 
96  /** \name Virtual methods that the PF_implementations assume exist.
97  @{ */
98  /** Return the robot pose for the i'th particle. is_valid is
99  * always true in this class. */
101  const size_t i, bool& is_valid_pose) const override;
102 
104  CParticleDataContent* particleData,
105  const mrpt::math::TPose3D& newPose) const;
106 
107  // We'll redefine this one:
109  CParticleList& old_particles,
110  const std::vector<mrpt::math::TPose3D>& newParticles,
111  const std::vector<double>& newParticlesWeight,
112  const std::vector<size_t>& newParticlesDerivedFromIdx) const;
113 
114  /** Evaluate the observation likelihood for one particle at a given location
115  */
118  const size_t particleIndexForMap,
119  const mrpt::obs::CSensoryFrame& observation,
120  const mrpt::poses::CPose3D& x) const;
121  /** @} */
122 
123 }; // End of class def.
124 
125 }
126 #endif
127 
128 
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:52
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...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:86
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: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020