Main MRPT website > C++ reference
MRPT logo
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-2014, 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 
16 #include <mrpt/slam/link_pragmas.h>
17 
18 namespace mrpt
19 {
20  namespace slam
21  {
22  class CSensoryFrame;
23 
24  using namespace mrpt::poses;
25  using namespace mrpt::slam;
26  using namespace mrpt::bayes;
27 
28  /** 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.
29  *
30  * This class also implements particle filtering for robot localization. See the MRPT
31  * application "app/pf-localization" for an example of usage.
32  *
33  * \sa CMonteCarloLocalization2D, CPose2D, CPosePDF, CPoseGaussianPDF, CParticleFilterCapable
34  * \ingroup mrpt_slam_grp
35  */
37  public CPose3DPDFParticles,
38  public PF_implementation<CPose3D,CMonteCarloLocalization3D>
39  {
40  //template <class PARTICLE_TYPE, class MYSELF> friend class PF_implementation;
41 
42  public:
44 
45  /** Constructor
46  * \param M The number of m_particles.
47  */
48  CMonteCarloLocalization3D( size_t M = 1 );
49 
50  /** Destructor */
51  virtual ~CMonteCarloLocalization3D();
52 
53  /** Update the m_particles, predicting the posterior of robot pose and map 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 pose change the robot has been commanded.
58  * \param observation This must be a pointer to a CSensoryFrame object, with robot sensed observations.
59  *
60  * \sa options
61  */
62  void prediction_and_update_pfStandardProposal(
63  const mrpt::slam::CActionCollection * action,
64  const mrpt::slam::CSensoryFrame * observation,
66 
67  /** Update the m_particles, predicting the posterior of robot pose and map after a movement command.
68  * This method has additional configuration parameters in "options".
69  * Performs the update stage of the RBPF, using the sensed CSensoryFrame:
70  *
71  * \param Action This is a pointer to CActionCollection, containing the pose change the robot has been commanded.
72  * \param observation This must be a pointer to a CSensoryFrame object, with robot sensed observations.
73  *
74  * \sa options
75  */
76  void prediction_and_update_pfAuxiliaryPFStandard(
77  const mrpt::slam::CActionCollection * action,
78  const mrpt::slam::CSensoryFrame * observation,
80 
81  /** Update the m_particles, predicting the posterior of robot pose and map after a movement command.
82  * This method has additional configuration parameters in "options".
83  * Performs the update stage of the RBPF, using the sensed CSensoryFrame:
84  *
85  * \param Action This is a pointer to CActionCollection, containing the pose change the robot has been commanded.
86  * \param observation This must be a pointer to a CSensoryFrame object, with robot sensed observations.
87  *
88  * \sa options
89  */
90  void prediction_and_update_pfAuxiliaryPFOptimal(
91  const mrpt::slam::CActionCollection * action,
92  const mrpt::slam::CSensoryFrame * observation,
94 
95  //protected:
96  /** \name Virtual methods that the PF_implementations assume exist.
97  @{ */
98  /** Return a pointer to the last robot pose in the i'th particle (or NULL if it's a path and it's empty). */
99  const TPose3D * getLastPose(const size_t i) const;
100 
101  void PF_SLAM_implementation_custom_update_particle_with_new_pose(
102  CParticleDataContent *particleData,
103  const TPose3D &newPose) const;
104 
105  // We'll redefine this one:
106  void PF_SLAM_implementation_replaceByNewParticleSet(
107  CParticleList &old_particles,
108  const std::vector<TPose3D> &newParticles,
109  const vector<double> &newParticlesWeight,
110  const std::vector<size_t> &newParticlesDerivedFromIdx ) const;
111 
112  /** Evaluate the observation likelihood for one particle at a given location */
113  double PF_SLAM_computeObservationLikelihoodForParticle(
114  const CParticleFilter::TParticleFilterOptions &PF_options,
115  const size_t particleIndexForMap,
116  const CSensoryFrame &observation,
117  const CPose3D &x ) const;
118  /** @} */
119 
120 
121  }; // End of class def.
122 
123  } // End of namespace
124 } // End of namespace
125 
126 #endif
The struct for passing extra simulation parameters to the prediction stage when running a particle fi...
The namespace for Bayesian filtering algorithm: different particle filters and Kalman filter algorith...
This namespace contains algorithms for SLAM, localization, map building, representation of robot's ac...
Declares a class for storing a collection of robot actions.
A set of common data shared by PF implementations for both SLAM and localization. ...
TMonteCarloLocalizationParams options
MCL parameters.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Definition: CPoint.h:17
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.
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
Definition: CSensoryFrame.h:53
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:69
The configuration of a particle filter.
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
Declares a class that represents a Probability Density function (PDF) of a 3D pose.



Page generated by Doxygen 1.8.8 for MRPT 1.2.2 SVN:Unversioned directory at Tue Oct 14 02:14:08 UTC 2014