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-2020, 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  CObservationRange() = default;
33 
34  /** The data members
35  */
38 
39  /** Cone aperture of each ultrasonic beam, in radians. */
40  float sensorConeApperture = mrpt::d2f(20.0_deg);
41 
42  struct TMeasurement
43  {
45  /** Some kind of sensor ID which identifies it on the bus (if
46  * applicable, 0 otherwise)
47  */
48  uint16_t sensorID{0};
49 
50  /** The 6D position of the sensor on the robot.
51  */
53 
54  /** The measured range, in meters (or a value of 0 if there was no
55  * detected echo).
56  */
57  float sensedDistance{0};
58  };
59 
60  using TMeasurementList = std::deque<TMeasurement>;
61  using const_iterator = std::deque<TMeasurement>::const_iterator;
62  using iterator = std::deque<TMeasurement>::iterator;
63 
64  /** All the measurements */
66 
67  iterator begin() { return sensedData.begin(); }
68  iterator end() { return sensedData.end(); }
69  const_iterator begin() const { return sensedData.begin(); }
70  const_iterator end() const { return sensedData.end(); }
71  // See base class docs
72  void getSensorPose(mrpt::poses::CPose3D& out_sensorPose) const override;
73  void setSensorPose(const mrpt::poses::CPose3D& newSensorPose) override;
74  void getDescriptionAsText(std::ostream& o) const override;
75 
76 }; // End of class def.
77 } // namespace mrpt::obs
const_iterator begin() const
Declares a class derived from "CObservation" that encapsules a single range measurement, and associated parameters.
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
float d2f(const double d)
shortcut for static_cast<float>(double)
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.
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:85
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:24
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...
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
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: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020