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
14#include <mrpt/poses/CPose3D.h>
15#include <mrpt/poses/CPose2D.h>
16
17namespace mrpt
18{
19namespace obs
20{
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;
65 typedef std::deque<TMeasurement>::const_iterator const_iterator;
66 typedef std::deque<TMeasurement>::iterator iterator;
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.
83 } // End of namespace
84} // End of namespace
85#endif
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
#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...
Declares a class that represents any robot's observation.
Declares a class derived from "CObservation" that encapsules a single range measurement,...
std::deque< TMeasurement >::const_iterator const_iterator
std::deque< TMeasurement > TMeasurementList
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const MRPT_OVERRIDE
A general method to retrieve the sensor pose on the robot.
float sensorConeApperture
Cone aperture of each ultrasonic beam, in radians.
TMeasurementList sensedData
All the measurements.
std::deque< TMeasurement >::iterator iterator
float minSensorDistance
The data members.
CObservationRange()
Default constructor.
void setSensorPose(const mrpt::poses::CPose3D &newSensorPose) MRPT_OVERRIDE
A general method to change the sensor pose on the robot.
void getDescriptionAsText(std::ostream &o) const MRPT_OVERRIDE
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:73
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
Definition: mrpt_macros.h:28
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
unsigned int uint16_t
Definition: pstdint.h:170
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
uint16_t sensorID
Some kind of sensor ID which identifies it on the bus (if applicable, 0 otherwise)
math::TPose3D sensorPose
The 6D position of the sensor on the robot.
float sensedDistance
The measured range, in meters (or a value of 0 if there was no detected echo).



Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Wed Feb 15 01:46:32 UTC 2023