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
18
19namespace 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 */
44
45 /** Destructor */
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 */
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 */
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 */
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
96 CParticleDataContent *particleData,
97 const mrpt::math::TPose3D &newPose) const;
98
99 // We'll redefine this one:
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 */
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
std::deque< CParticleData > CParticleList
Use this type to refer to the list of particles m_particles.
CPose3D CParticleDataContent
This is the type inside the corresponding CParticleData class.
Declares a class for storing a collection of robot actions.
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:73
Declares a class that represents a Probability Density function (PDF) of a 3D pose.
Declares a class that represents a Probability Density Function (PDF) over a 3D pose (x,...
CMonteCarloLocalization3D(size_t M=1)
Constructor.
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.
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.
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.
void PF_SLAM_implementation_custom_update_particle_with_new_pose(CParticleDataContent *particleData, const mrpt::math::TPose3D &newPose) const
TMonteCarloLocalizationParams options
MCL parameters.
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
const mrpt::math::TPose3D * getLastPose(const size_t i) const
Return a pointer to the last robot pose in the i'th particle (or NULL if it's a path and it's empty).
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.
virtual ~CMonteCarloLocalization3D()
Destructor.
A set of common data shared by PF implementations for both SLAM and localization.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
The configuration of a particle filter.
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
The struct for passing extra simulation parameters to the prediction stage when running a particle fi...



Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Fri Jan 20 00:45:34 UTC 2023