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



Page generated by Doxygen 1.8.14 for MRPT 1.1.0 SVN: at lun oct 28 00:54:49 CET 2019 Hosted on:
SourceForge.net Logo