Main MRPT website > C++ reference for MRPT 1.4.0
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-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 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  */
53  uint16_t sensorID;
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
mrpt::obs::CObservationRange::iterator
std::deque< TMeasurement >::iterator iterator
Definition: obs/CObservationRange.h:66
iterator
Scalar * iterator
Definition: eigen_plugins.h:23
mrpt::obs::CObservationRange::begin
iterator begin()
Definition: obs/CObservationRange.h:71
CObservation.h
mrpt::obs::CObservationRange::TMeasurement
Definition: obs/CObservationRange.h:46
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CParticleFilter.h:16
const_iterator
const typedef Scalar * const_iterator
Definition: eigen_plugins.h:24
CPose2D.h
mrpt::obs::CObservationRange::const_iterator
std::deque< TMeasurement >::const_iterator const_iterator
Definition: obs/CObservationRange.h:65
mrpt::obs::CObservationRange::TMeasurement::sensedDistance
float sensedDistance
The measured range, in meters (or a value of 0 if there was no detected echo).
Definition: obs/CObservationRange.h:61
mrpt::obs::CObservationRange::TMeasurementList
std::deque< TMeasurement > TMeasurementList
Definition: obs/CObservationRange.h:64
mrpt::obs::CObservationRange::sensedData
TMeasurementList sensedData
All the measurements.
Definition: obs/CObservationRange.h:68
mrpt::obs::CObservationRange::TMeasurement::sensorID
uint16_t sensorID
Some kind of sensor ID which identifies it on the bus (if applicable, 0 otherwise)
Definition: obs/CObservationRange.h:53
mrpt::obs::CObservationRange::sensorConeApperture
float sensorConeApperture
Cone aperture of each ultrasonic beam, in radians.
Definition: obs/CObservationRange.h:44
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:72
DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
Definition: CSerializable.h:174
mrpt::math::TPose3D
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
Definition: lightweight_geom_data.h:389
mrpt::obs::CObservationRange::end
const_iterator end() const
Definition: obs/CObservationRange.h:74
mrpt::obs::CObservationRange::minSensorDistance
float minSensorDistance
The data members.
Definition: obs/CObservationRange.h:42
mrpt::obs::CObservationRange::TMeasurement::sensorPose
math::TPose3D sensorPose
The 6D position of the sensor on the robot.
Definition: obs/CObservationRange.h:57
CPose3D.h
mrpt::obs::CObservationRange
Declares a class derived from "CObservation" that encapsules a single range measurement,...
Definition: obs/CObservationRange.h:30
mrpt::obs::CObservationRange::maxSensorDistance
float maxSensorDistance
Definition: obs/CObservationRange.h:43
mrpt::obs::CObservationRange::begin
const_iterator begin() const
Definition: obs/CObservationRange.h:73
DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE
#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...
Definition: CSerializable.h:170
DEFINE_SERIALIZABLE
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Definition: CSerializable.h:147
mrpt::obs::CObservation
Declares a class that represents any robot's observation.
Definition: obs/CObservation.h:47
mrpt::obs::CObservationRange::TMeasurement::TMeasurement
TMeasurement()
Definition: obs/CObservationRange.h:48
mrpt::obs::CObservationRange::end
iterator end()
Definition: obs/CObservationRange.h:72
CSerializable.h
MRPT_OVERRIDE
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
Definition: mrpt_macros.h:28



Page generated by Doxygen 1.8.16 for MRPT 1.4.0 SVN: at Mon Oct 14 23:08:25 UTC 2019