Main MRPT website > C++ reference for MRPT 1.5.7
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-2017, 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  public:
37 
38  /** Constructor
39  * \param M The number of m_particles.
40  */
41  CMonteCarloLocalization3D( size_t M = 1 );
42 
43  /** Destructor */
44  virtual ~CMonteCarloLocalization3D();
45 
46  /** Update the m_particles, predicting the posterior of robot pose and map 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 pose change the robot has been commanded.
51  * \param observation This must be a pointer to a CSensoryFrame object, with robot sensed observations.
52  *
53  * \sa options
54  */
55  void prediction_and_update_pfStandardProposal(
56  const mrpt::obs::CActionCollection * action,
57  const mrpt::obs::CSensoryFrame * observation,
59 
60  /** Update the m_particles, predicting the posterior of robot pose and map after a movement command.
61  * This method has additional configuration parameters in "options".
62  * Performs the update stage of the RBPF, using the sensed CSensoryFrame:
63  *
64  * \param Action This is a pointer to CActionCollection, containing the pose change the robot has been commanded.
65  * \param observation This must be a pointer to a CSensoryFrame object, with robot sensed observations.
66  *
67  * \sa options
68  */
69  void prediction_and_update_pfAuxiliaryPFStandard(
70  const mrpt::obs::CActionCollection * action,
71  const mrpt::obs::CSensoryFrame * observation,
73 
74  /** Update the m_particles, predicting the posterior of robot pose and map after a movement command.
75  * This method has additional configuration parameters in "options".
76  * Performs the update stage of the RBPF, using the sensed CSensoryFrame:
77  *
78  * \param Action This is a pointer to CActionCollection, containing the pose change the robot has been commanded.
79  * \param observation This must be a pointer to a CSensoryFrame object, with robot sensed observations.
80  *
81  * \sa options
82  */
83  void prediction_and_update_pfAuxiliaryPFOptimal(
84  const mrpt::obs::CActionCollection * action,
85  const mrpt::obs::CSensoryFrame * observation,
87 
88  /** \name Virtual methods that the PF_implementations assume exist.
89  @{ */
90  mrpt::math::TPose3D getLastPose(const size_t i, bool &pose_is_valid) const MRPT_OVERRIDE; // see docs in base
91 
92  void PF_SLAM_implementation_custom_update_particle_with_new_pose(
93  CParticleDataContent *particleData,
94  const mrpt::math::TPose3D &newPose) const;
95 
96  // We'll redefine this one:
97  void PF_SLAM_implementation_replaceByNewParticleSet(
98  CParticleList &old_particles,
99  const std::vector<mrpt::math::TPose3D> &newParticles,
100  const std::vector<double> &newParticlesWeight,
101  const std::vector<size_t> &newParticlesDerivedFromIdx ) const;
102 
103  /** Evaluate the observation likelihood for one particle at a given location */
104  double PF_SLAM_computeObservationLikelihoodForParticle(
106  const size_t particleIndexForMap,
107  const mrpt::obs::CSensoryFrame &observation,
108  const mrpt::poses::CPose3D &x ) const;
109  /** @} */
110 
111 
112  }; // End of class def.
113 
114  } // End of namespace
115 } // End of namespace
116 
117 #endif
The struct for passing extra simulation parameters to the prediction stage when running a particle fi...
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
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.
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
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:72
The configuration of a particle filter.
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
GLenum GLint x
Definition: glext.h:3516
Declares a class that represents a Probability Density function (PDF) of a 3D pose.



Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 8277875f6 Mon Jun 11 02:47:32 2018 +0200 at lun oct 28 01:50:49 CET 2019