Main MRPT website > C++ reference for MRPT 1.5.7
obs/CObservationRange.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 CObservationRange_H
10 #define CObservationRange_H
11 
13 #include <mrpt/obs/CObservation.h>
14 #include <mrpt/poses/CPose3D.h>
15 #include <mrpt/poses/CPose2D.h>
16 
17 namespace mrpt
18 {
19 namespace obs
20 {
21  DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CObservationRange , CObservation,OBS_IMPEXP )
22 
23  /** Declares a class derived from "CObservation" that
24  encapsules a single range measurement, and associated parameters. This can be used
25  * for example to store measurements from infrared proximity sensors (IR) or ultrasonic sensors (sonars).
26  *
27  * \sa CObservation
28  * \ingroup mrpt_obs_grp
29  */
31  {
32  // This must be added to any CSerializable derived class:
34 
35  public:
36  /** Default constructor.
37  */
39 
40  /** The data members
41  */
44  float sensorConeApperture; //!< Cone aperture of each ultrasonic beam, in radians.
45 
47  {
48  TMeasurement() : sensorID(0), sensorPose(), sensedDistance(0)
49  {}
50 
51  /** Some kind of sensor ID which identifies it on the bus (if applicable, 0 otherwise)
52  */
54 
55  /** The 6D position of the sensor on the robot.
56  */
58 
59  /** The measured range, in meters (or a value of 0 if there was no detected echo).
60  */
62  };
63 
64  typedef std::deque<TMeasurement> TMeasurementList;
67 
68  TMeasurementList sensedData; //!< All the measurements
69 
70 
71  iterator begin() { return sensedData.begin(); }
72  iterator end() { return sensedData.end(); }
73  const_iterator begin() const { return sensedData.begin(); }
74  const_iterator end() const { return sensedData.end(); }
75 
76  // See base class docs
77  void getSensorPose( mrpt::poses::CPose3D &out_sensorPose ) const MRPT_OVERRIDE;
78  void setSensorPose( const mrpt::poses::CPose3D &newSensorPose ) MRPT_OVERRIDE;
79  void getDescriptionAsText(std::ostream &o) const MRPT_OVERRIDE;
80 
81  }; // End of class def.
82  DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE( CObservationRange , CObservation,OBS_IMPEXP )
83  } // End of namespace
84 } // End of namespace
85 #endif
Declares a class derived from "CObservation" that encapsules a single range measurement, and associated parameters.
unsigned __int16 uint16_t
Definition: rptypes.h:46
float minSensorDistance
The data members.
float sensorConeApperture
Cone aperture of each ultrasonic beam, in radians.
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
Scalar * iterator
Definition: eigen_plugins.h:23
const Scalar * const_iterator
Definition: eigen_plugins.h:24
std::deque< TMeasurement > TMeasurementList
std::deque< TMeasurement >::const_iterator const_iterator
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
float sensedDistance
The measured range, in meters (or a value of 0 if there was no detected echo).
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
uint16_t sensorID
Some kind of sensor ID which identifies it on the bus (if applicable, 0 otherwise) ...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:72
Declares a class that represents any robot&#39;s observation.
math::TPose3D sensorPose
The 6D position of the sensor on the robot.
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
std::deque< TMeasurement >::iterator iterator
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
TMeasurementList sensedData
All the measurements.



Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019