Main MRPT website > C++ reference for MRPT 1.4.0
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-2016, 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 #include <mrpt/slam/link_pragmas.h>
18 
19 namespace mrpt
20 {
21  namespace slam
22  {
23  /** Declares a class that represents a Probability Density Function (PDF) over a 3D pose (x,y,phi,yaw,pitch,roll), using a set of weighted samples.
24  *
25  * This class also implements particle filtering for robot localization. See the MRPT
26  * application "app/pf-localization" for an example of usage.
27  *
28  * \sa CMonteCarloLocalization2D, CPose2D, CPosePDF, CPoseGaussianPDF, CParticleFilterCapable
29  * \ingroup mrpt_slam_grp
30  */
33  public PF_implementation<mrpt::poses::CPose3D,CMonteCarloLocalization3D>
34  {
35  //template <class PARTICLE_TYPE, class MYSELF> friend class PF_implementation;
36 
37  public:
39 
40  /** Constructor
41  * \param M The number of m_particles.
42  */
43  CMonteCarloLocalization3D( size_t M = 1 );
44 
45  /** Destructor */
46  virtual ~CMonteCarloLocalization3D();
47 
48  /** Update the m_particles, predicting the posterior of robot pose and map 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 pose change the robot has been commanded.
53  * \param observation This must be a pointer to a CSensoryFrame object, with robot sensed observations.
54  *
55  * \sa options
56  */
57  void prediction_and_update_pfStandardProposal(
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 after a movement command.
63  * This method has additional configuration parameters in "options".
64  * Performs the update stage of the RBPF, using the sensed CSensoryFrame:
65  *
66  * \param Action This is a pointer to CActionCollection, containing the pose change the robot has been commanded.
67  * \param observation This must be a pointer to a CSensoryFrame object, with robot sensed observations.
68  *
69  * \sa options
70  */
71  void prediction_and_update_pfAuxiliaryPFStandard(
72  const mrpt::obs::CActionCollection * action,
73  const mrpt::obs::CSensoryFrame * observation,
75 
76  /** Update the m_particles, predicting the posterior of robot pose and map after a movement command.
77  * This method has additional configuration parameters in "options".
78  * Performs the update stage of the RBPF, using the sensed CSensoryFrame:
79  *
80  * \param Action This is a pointer to CActionCollection, containing the pose change the robot has been commanded.
81  * \param observation This must be a pointer to a CSensoryFrame object, with robot sensed observations.
82  *
83  * \sa options
84  */
85  void prediction_and_update_pfAuxiliaryPFOptimal(
86  const mrpt::obs::CActionCollection * action,
87  const mrpt::obs::CSensoryFrame * observation,
89 
90  /** \name Virtual methods that the PF_implementations assume exist.
91  @{ */
92  /** Return a pointer to the last robot pose in the i'th particle (or NULL if it's a path and it's empty). */
93  const mrpt::math::TPose3D * getLastPose(const size_t i) const;
94 
95  void PF_SLAM_implementation_custom_update_particle_with_new_pose(
96  CParticleDataContent *particleData,
97  const mrpt::math::TPose3D &newPose) const;
98 
99  // We'll redefine this one:
100  void PF_SLAM_implementation_replaceByNewParticleSet(
101  CParticleList &old_particles,
102  const std::vector<mrpt::math::TPose3D> &newParticles,
103  const std::vector<double> &newParticlesWeight,
104  const std::vector<size_t> &newParticlesDerivedFromIdx ) const;
105 
106  /** Evaluate the observation likelihood for one particle at a given location */
107  double PF_SLAM_computeObservationLikelihoodForParticle(
109  const size_t particleIndexForMap,
110  const mrpt::obs::CSensoryFrame &observation,
111  const mrpt::poses::CPose3D &x ) const;
112  /** @} */
113 
114 
115  }; // End of class def.
116 
117  } // End of namespace
118 } // End of namespace
119 
120 #endif
mrpt::bayes::CParticleFilterData< CPose3D >::CParticleList
std::deque< CParticleData > CParticleList
Use this type to refer to the list of particles m_particles.
Definition: CParticleFilterData.h:182
mrpt::slam::CMonteCarloLocalization3D
Declares a class that represents a Probability Density Function (PDF) over a 3D pose (x,...
Definition: CMonteCarloLocalization3D.h:31
TMonteCarloLocalizationParams.h
PF_implementations_data.h
mrpt::obs::CActionCollection
Declares a class for storing a collection of robot actions.
Definition: obs/CActionCollection.h:30
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CParticleFilter.h:16
mrpt::obs::CSensoryFrame
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
Definition: obs/CSensoryFrame.h:52
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:72
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:389
mrpt::poses::CPose3DPDFParticles
Declares a class that represents a Probability Density function (PDF) of a 3D pose.
Definition: CPose3DPDFParticles.h:33
mrpt::slam::TMonteCarloLocalizationParams
The struct for passing extra simulation parameters to the prediction stage when running a particle fi...
Definition: TMonteCarloLocalizationParams.h:25
mrpt::slam::CMonteCarloLocalization3D::options
TMonteCarloLocalizationParams options
MCL parameters.
Definition: CMonteCarloLocalization3D.h:38
mrpt::bayes::CParticleFilter::TParticleFilterOptions
The configuration of a particle filter.
Definition: CParticleFilter.h:80
mrpt::bayes::CParticleFilterData< CPose3D >::CParticleDataContent
CPose3D CParticleDataContent
This is the type inside the corresponding CParticleData class.
Definition: CParticleFilterData.h:180
CPose3DPDFParticles.h



Page generated by Doxygen 1.8.16 for MRPT 1.4.0 SVN: at Mon Oct 14 22:32:58 UTC 2019