MRPT  1.9.9
CObservationRange.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2019, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include <mrpt/obs/CObservation.h>
12 #include <mrpt/poses/CPose2D.h>
13 #include <mrpt/poses/CPose3D.h>
15 
16 namespace mrpt::obs
17 {
18 /** Declares a class derived from "CObservation" that
19  encapsules a single range measurement, and associated parameters. This
20  can be used
21  * for example to store measurements from infrared proximity sensors (IR) or
22  ultrasonic sensors (sonars).
23  *
24  * \sa CObservation
25  * \ingroup mrpt_obs_grp
26  */
28 {
30 
31  public:
32  /** Default constructor.
33  */
35 
36  /** The data members
37  */
40  /** Cone aperture of each ultrasonic beam, in radians. */
42 
43  struct TMeasurement
44  {
46  /** Some kind of sensor ID which identifies it on the bus (if
47  * applicable, 0 otherwise)
48  */
50 
51  /** The 6D position of the sensor on the robot.
52  */
54 
55  /** The measured range, in meters (or a value of 0 if there was no
56  * detected echo).
57  */
58  float sensedDistance{0};
59  };
60 
61  using TMeasurementList = std::deque<TMeasurement>;
62  using const_iterator = std::deque<TMeasurement>::const_iterator;
63  using iterator = std::deque<TMeasurement>::iterator;
64 
65  /** All the measurements */
67 
68  iterator begin() { return sensedData.begin(); }
69  iterator end() { return sensedData.end(); }
70  const_iterator begin() const { return sensedData.begin(); }
71  const_iterator end() const { return sensedData.end(); }
72  // See base class docs
73  void getSensorPose(mrpt::poses::CPose3D& out_sensorPose) const override;
74  void setSensorPose(const mrpt::poses::CPose3D& newSensorPose) override;
75  void getDescriptionAsText(std::ostream& o) const override;
76 
77 }; // End of class def.
78 } // namespace mrpt::obs
const_iterator begin() const
Declares a class derived from "CObservation" that encapsules a single range measurement, and associated parameters.
unsigned __int16 uint16_t
Definition: rptypes.h:47
const_iterator end() const
float minSensorDistance
The data members.
float sensorConeApperture
Cone aperture of each ultrasonic beam, in radians.
std::deque< TMeasurement >::const_iterator const_iterator
std::deque< TMeasurement > TMeasurementList
CObservationRange()
Default constructor.
float sensedDistance
The measured range, in meters (or a value of 0 if there was no detected echo).
This namespace contains representation of robot actions and observations.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
std::deque< TMeasurement >::iterator iterator
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:84
Declares a class that represents any robot&#39;s observation.
Definition: CObservation.h:43
math::TPose3D sensorPose
The 6D position of the sensor on the robot.
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
Definition: TPose3D.h:23
void setSensorPose(const mrpt::poses::CPose3D &newSensorPose) override
A general method to change the sensor pose on the robot.
void getDescriptionAsText(std::ostream &o) const override
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const override
A general method to retrieve the sensor pose on the robot.
TMeasurementList sensedData
All the measurements.



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019