MRPT  2.0.4
CObservationBearingRange.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/CPose3D.h>
14 
15 namespace mrpt::obs
16 {
17 /** This observation represents a number of range-bearing value pairs, each one
18  * for a detected landmark, which optionally can have identification IDs.
19  * This class can manage sensors that detect landmarks in a 2D plane (e.g. a
20  * laser scanner) or in the 3D space (e.g. a camera). There are
21  * two direction angles: yaw (azimuth) and pitch (negative elevation). For 2D
22  * sensors, the pitch must be always set to 0.
23  * See CObservationBearingRange::validCovariances for the instructions to fill
24  * the uncertainty covariances.
25  * \sa CObservation
26  * \ingroup mrpt_obs_grp
27  */
29 {
31 
32  public:
33  CObservationBearingRange() = default;
34 
35  float minSensorDistance{0}, maxSensorDistance{0}; //! Information about the
36  //! sensor: Ranges, in meters
37  //! (0: there is no limits)
38  /** Information about the sensor: The "field-of-view" of the sensor, in
39  * radians (for yaw ). */
40  float fieldOfView_yaw = mrpt::d2f(180.0_deg);
41  /** Information about the sensor: The "field-of-view" of the sensor, in
42  * radians (for pitch ). */
43  float fieldOfView_pitch = mrpt::d2f(90.0_deg);
44 
45  /** The position of the sensor on the robot.
46  */
48 
49  /** Each one of the measurements:
50  */
51  struct TMeasurement
52  {
53  /** The sensed landmark distance, in meters. */
54  float range;
55 
56  /** The sensed landmark direction, in radians, measured as the yaw
57  * (azimuth) and pitch (negative elevation).
58  * Set pitch to zero for 2D sensors.
59  * See mrpt::poses::CPose3D for a definition of the 3D angles.
60  */
61  float yaw, pitch;
62 
63  /** The ID of the sensed beacon, or INVALID_LANDMARK_ID (-1) if the
64  * sensor does not identify the landmark. */
65  int32_t landmarkID;
66 
67  /** The covariance matrix of the landmark, with variable indices [0,1,2]
68  * being [range,yaw,pitch]. */
70  };
71 
72  using TMeasurementList = std::vector<TMeasurement>;
73 
74  /** The list of observed ranges: */
76 
77  /** True: The individual 3x3 covariance matrices must be taken into account,
78  * false (default): All the measurements have identical, diagonal 3x3
79  * covariance matrices given by the values
80  * sensor_std_range,sensor_std_yaw,sensor_std_pitch.
81  */
82  bool validCovariances{false};
83 
84  /** Taken into account only if validCovariances=false: the standard
85  * deviation of the sensor noise model for range,yaw and pitch (in meters
86  * and radians).
87  * If validCovariances=true, these 3 values are ignored and the individual
88  * 3x3 covariance matrices contain the actual uncertainties for each of the
89  * detected landmarks.
90  */
92 
93  /** Prints out the contents of the object.
94  */
95  void debugPrintOut();
96 
97  // See base class docs
98  void getSensorPose(mrpt::poses::CPose3D& out_sensorPose) const override
99  {
100  out_sensorPose = sensorLocationOnRobot;
101  }
102  void setSensorPose(const mrpt::poses::CPose3D& newSensorPose) override
103  {
104  sensorLocationOnRobot = newSensorPose;
105  }
106  void getDescriptionAsText(std::ostream& o) const override;
107 
108 }; // End of class def.
109 
110 } // namespace mrpt::obs
float fieldOfView_yaw
Information about the.
void setSensorPose(const mrpt::poses::CPose3D &newSensorPose) override
A general method to change the sensor pose on the robot.
float range
The sensed landmark distance, in meters.
float yaw
The sensed landmark direction, in radians, measured as the yaw (azimuth) and pitch (negative elevatio...
int32_t landmarkID
The ID of the sensed beacon, or INVALID_LANDMARK_ID (-1) if the sensor does not identify the landmark...
float d2f(const double d)
shortcut for static_cast<float>(double)
std::vector< TMeasurement > TMeasurementList
float fieldOfView_pitch
Information about the sensor: The "field-of-view" of the sensor, in radians (for pitch )...
This namespace contains representation of robot actions and observations.
mrpt::poses::CPose3D sensorLocationOnRobot
The position of the sensor on the robot.
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
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const override
A general method to retrieve the sensor pose on the robot.
This observation represents a number of range-bearing value pairs, each one for a detected landmark...
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
bool validCovariances
True: The individual 3x3 covariance matrices must be taken into account, false (default): All the mea...
void debugPrintOut()
Prints out the contents of the object.
void getDescriptionAsText(std::ostream &o) const override
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
float sensor_std_range
Taken into account only if validCovariances=false: the standard deviation of the sensor noise model f...
TMeasurementList sensedData
The list of observed ranges:
mrpt::math::CMatrixDouble33 covariance
The covariance matrix of the landmark, with variable indices [0,1,2] being [range,yaw,pitch].



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 3e8ecd670 Mon May 18 14:23:19 2020 +0200 at lun may 18 14:30:11 CEST 2020