Main MRPT website > C++ reference for MRPT 1.9.9
CRejectionSamplingRangeOnlyLocalization.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 CRejectionSamplingRangeOnlyLocalization_H
10 #define CRejectionSamplingRangeOnlyLocalization_H
11 
12 #include <mrpt/poses/CPose2D.h>
13 #include <mrpt/poses/CPoint3D.h>
14 #include <mrpt/poses/CPoint2D.h>
17 #include <mrpt/obs/obs_frwds.h>
18 
19 namespace mrpt
20 {
21 namespace maps
22 {
23 class CLandmarksMap;
24 }
25 
26 namespace slam
27 {
28 /** An implementation of rejection sampling for generating 2D robot pose from
29  * range-only measurements within a landmarks (beacons) map.
30  * Before calling the method "rejectionSampling" to generate the samples, you
31  * must call "setParams".
32  * It is assumed a planar scenario, where the robot is at a fixed height
33  * (default=0).
34  * \sa bayes::CRejectionSamplingCapable \ingroup mrpt_slam_grp
35  */
37  : public bayes::CRejectionSamplingCapable<mrpt::poses::CPose2D>
38 {
39  public:
40  /** Constructor
41  */
43 
44  /** Destructor
45  */
47  /** The parameters used in the generation of random samples:
48  * \param beaconsMap The map containing the N beacons (indexed by their
49  * "beacon ID"s). Only the mean 3D position of the beacons is used, the
50  * covariance is ignored.
51  * \param observation An observation with, at least ONE range measurement.
52  * \param sigmaRanges The standard deviation of the "range measurement
53  * noise".
54  * \param robot_z The height of the robot on the floor (default=0). Note
55  * that the beacon sensor on the robot may be at a different height,
56  * according to data within the observation object.
57  * \param autoCheckAngleRanges Whether to make a simple check for potential
58  * good angles from the beacons to generate samples (disable to speed-up the
59  * preparation vs. making slower the drawn).
60  * This method fills out the member "m_dataPerBeacon".
61  * \return true if at least ONE beacon has been successfully loaded, false
62  * otherwise. In this case do not call "rejectionSampling" or an exception
63  * will be launch, since there is no information to generate samples.
64  */
65  bool setParams(
66  const mrpt::maps::CLandmarksMap& beaconsMap,
67  const mrpt::obs::CObservationBeaconRanges& observation,
68  float sigmaRanges, const mrpt::poses::CPose2D& oldPose,
69  float robot_z = 0, bool autoCheckAngleRanges = true);
70 
71  protected:
72  /** Generates one sample, drawing from some proposal distribution.
73  */
75 
76  /** Returns the NORMALIZED observation likelihood (linear, not
77  * exponential!!!) at a given point of the state space (values in the range
78  * [0,1]).
79  */
81 
82  /** Z coordinate of the robot.
83  */
84  float m_z_robot;
85 
88 
89  /** The index in "m_dataPerBeacon" used to draw samples (the rest will be
90  * used to evaluate the likelihood)
91  */
92  size_t m_drawIndex;
93 
94  /** Data for each beacon observation with a correspondence with the map.
95  */
97  {
99  : sensorOnRobot(),
100  beaconPosition(),
102  minAngle(0),
103  maxAngle(0)
104  {
105  }
106 
111  };
112 
113  /** Data for each beacon observation with a correspondence with the map.
114  */
115  std::deque<TDataPerBeacon> m_dataPerBeacon;
116 };
117 
118 } // End of namespace
119 } // End of namespace
120 
121 #endif
CPoint2D.h
mrpt::slam::CRejectionSamplingRangeOnlyLocalization::setParams
bool setParams(const mrpt::maps::CLandmarksMap &beaconsMap, const mrpt::obs::CObservationBeaconRanges &observation, float sigmaRanges, const mrpt::poses::CPose2D &oldPose, float robot_z=0, bool autoCheckAngleRanges=true)
The parameters used in the generation of random samples:
Definition: CRejectionSamplingRangeOnlyLocalization.cpp:120
mrpt::slam::CRejectionSamplingRangeOnlyLocalization::m_sigmaRanges
float m_sigmaRanges
Definition: CRejectionSamplingRangeOnlyLocalization.h:86
mrpt::slam::CRejectionSamplingRangeOnlyLocalization::TDataPerBeacon::beaconPosition
mrpt::math::TPoint2D beaconPosition
Definition: CRejectionSamplingRangeOnlyLocalization.h:108
mrpt::bayes::CRejectionSamplingCapable
A base class for implementing rejection sampling in a generic state space.
Definition: CRejectionSamplingCapable.h:30
mrpt::slam::CRejectionSamplingRangeOnlyLocalization::m_oldPose
mrpt::poses::CPose2D m_oldPose
Definition: CRejectionSamplingRangeOnlyLocalization.h:87
mrpt::slam::CRejectionSamplingRangeOnlyLocalization::RS_drawFromProposal
void RS_drawFromProposal(mrpt::poses::CPose2D &outSample)
Generates one sample, drawing from some proposal distribution.
Definition: CRejectionSamplingRangeOnlyLocalization.cpp:42
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::slam::CRejectionSamplingRangeOnlyLocalization
An implementation of rejection sampling for generating 2D robot pose from range-only measurements wit...
Definition: CRejectionSamplingRangeOnlyLocalization.h:36
mrpt::slam::CRejectionSamplingRangeOnlyLocalization::m_drawIndex
size_t m_drawIndex
The index in "m_dataPerBeacon" used to draw samples (the rest will be used to evaluate the likelihood...
Definition: CRejectionSamplingRangeOnlyLocalization.h:92
CPose2D.h
lightweight_geom_data.h
mrpt::slam::CRejectionSamplingRangeOnlyLocalization::TDataPerBeacon::maxAngle
float maxAngle
Definition: CRejectionSamplingRangeOnlyLocalization.h:110
mrpt::obs::CObservationBeaconRanges
Declares a class derived from "CObservation" that represents one (or more) range measurements to labe...
Definition: CObservationBeaconRanges.h:27
mrpt::slam::CRejectionSamplingRangeOnlyLocalization::TDataPerBeacon::radiusAtRobotPlane
float radiusAtRobotPlane
Definition: CRejectionSamplingRangeOnlyLocalization.h:109
mrpt::poses::CPose2D
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle.
Definition: CPose2D.h:40
obs_frwds.h
mrpt::slam::CRejectionSamplingRangeOnlyLocalization::m_dataPerBeacon
std::deque< TDataPerBeacon > m_dataPerBeacon
Data for each beacon observation with a correspondence with the map.
Definition: CRejectionSamplingRangeOnlyLocalization.h:115
mrpt::slam::CRejectionSamplingRangeOnlyLocalization::TDataPerBeacon
Data for each beacon observation with a correspondence with the map.
Definition: CRejectionSamplingRangeOnlyLocalization.h:96
mrpt::math::TPoint2D
Lightweight 2D point.
Definition: lightweight_geom_data.h:42
mrpt::slam::CRejectionSamplingRangeOnlyLocalization::~CRejectionSamplingRangeOnlyLocalization
virtual ~CRejectionSamplingRangeOnlyLocalization()
Destructor.
Definition: CRejectionSamplingRangeOnlyLocalization.h:46
CPoint3D.h
mrpt::slam::CRejectionSamplingRangeOnlyLocalization::TDataPerBeacon::TDataPerBeacon
TDataPerBeacon()
Definition: CRejectionSamplingRangeOnlyLocalization.h:98
mrpt::math::TPoint3D
Lightweight 3D point.
Definition: lightweight_geom_data.h:378
mrpt::slam::CRejectionSamplingRangeOnlyLocalization::RS_observationLikelihood
double RS_observationLikelihood(const mrpt::poses::CPose2D &x)
Returns the NORMALIZED observation likelihood (linear, not exponential!!!) at a given point of the st...
Definition: CRejectionSamplingRangeOnlyLocalization.cpp:86
mrpt::slam::CRejectionSamplingRangeOnlyLocalization::m_z_robot
float m_z_robot
Z coordinate of the robot.
Definition: CRejectionSamplingRangeOnlyLocalization.h:84
mrpt::slam::CRejectionSamplingRangeOnlyLocalization::TDataPerBeacon::sensorOnRobot
mrpt::math::TPoint3D sensorOnRobot
Definition: CRejectionSamplingRangeOnlyLocalization.h:107
mrpt::maps::CLandmarksMap
A class for storing a map of 3D probabilistic landmarks.
Definition: CLandmarksMap.h:75
mrpt::slam::CRejectionSamplingRangeOnlyLocalization::TDataPerBeacon::minAngle
float minAngle
Definition: CRejectionSamplingRangeOnlyLocalization.h:110
mrpt::slam::CRejectionSamplingRangeOnlyLocalization::CRejectionSamplingRangeOnlyLocalization
CRejectionSamplingRangeOnlyLocalization()
Constructor.
Definition: CRejectionSamplingRangeOnlyLocalization.cpp:30
CRejectionSamplingCapable.h
x
GLenum GLint x
Definition: glext.h:3538



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST