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
DEFINE_SERIALIZABLE
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Definition: CSerializable.h:152
mrpt::obs::CObservationBearingRange::TMeasurement
Each one of the measurements:
Definition: CObservationBearingRange.h:51
mrpt::obs::CObservationBearingRange::sensor_std_yaw
float sensor_std_yaw
Definition: CObservationBearingRange.h:91
mrpt::obs::CObservationBearingRange::TMeasurement::pitch
float pitch
Definition: CObservationBearingRange.h:61
mrpt::obs::CObservationBearingRange::sensedData
TMeasurementList sensedData
The list of observed ranges:
Definition: CObservationBearingRange.h:75
mrpt::obs
This namespace contains representation of robot actions and observations.
Definition: CParticleFilter.h:17
mrpt::obs::CObservationBearingRange::validCovariances
bool validCovariances
True: The individual 3x3 covariance matrices must be taken into account, false (default): All the mea...
Definition: CObservationBearingRange.h:82
mrpt::obs::CObservationBearingRange::getSensorPose
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const override
A general method to retrieve the sensor pose on the robot.
Definition: CObservationBearingRange.h:98
mrpt::obs::CObservationBearingRange::setSensorPose
void setSensorPose(const mrpt::poses::CPose3D &newSensorPose) override
A general method to change the sensor pose on the robot.
Definition: CObservationBearingRange.h:102
mrpt::math::CMatrixFixed< double, 3, 3 >
mrpt::obs::CObservationBearingRange::TMeasurement::yaw
float yaw
The sensed landmark direction, in radians, measured as the yaw (azimuth) and pitch (negative elevatio...
Definition: CObservationBearingRange.h:61
mrpt::obs::CObservationBearingRange::TMeasurement::landmarkID
int32_t landmarkID
The ID of the sensed beacon, or INVALID_LANDMARK_ID (-1) if the sensor does not identify the landmark...
Definition: CObservationBearingRange.h:65
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:85
mrpt::obs::CObservationBearingRange::TMeasurement::covariance
mrpt::math::CMatrixDouble33 covariance
The covariance matrix of the landmark, with variable indices [0,1,2] being [range,...
Definition: CObservationBearingRange.h:69
mrpt::d2f
float d2f(const double d)
shortcut for static_cast<float>(double)
Definition: core/include/mrpt/core/bits_math.h:189
mrpt::obs::CObservationBearingRange::maxSensorDistance
float maxSensorDistance
Definition: CObservationBearingRange.h:35
mrpt::obs::CObservationBearingRange
This observation represents a number of range-bearing value pairs, each one for a detected landmark,...
Definition: CObservationBearingRange.h:28
mrpt::obs::CObservationBearingRange::sensorLocationOnRobot
mrpt::poses::CPose3D sensorLocationOnRobot
The position of the sensor on the robot.
Definition: CObservationBearingRange.h:47
mrpt::obs::CObservationBearingRange::debugPrintOut
void debugPrintOut()
Prints out the contents of the object.
Definition: CObservationBearingRange.cpp:141
CPose3D.h
mrpt::obs::CObservationBearingRange::fieldOfView_pitch
float fieldOfView_pitch
Information about the sensor: The "field-of-view" of the sensor, in radians (for pitch ).
Definition: CObservationBearingRange.h:43
mrpt::obs::CObservationBearingRange::sensor_std_pitch
float sensor_std_pitch
Definition: CObservationBearingRange.h:91
mrpt::obs::CObservationBearingRange::sensor_std_range
float sensor_std_range
Taken into account only if validCovariances=false: the standard deviation of the sensor noise model f...
Definition: CObservationBearingRange.h:91
CObservation.h
mrpt::obs::CObservation
Declares a class that represents any robot's observation.
Definition: CObservation.h:43
mrpt::obs::CObservationBearingRange::fieldOfView_yaw
float fieldOfView_yaw
Information about the.
Definition: CObservationBearingRange.h:40
mrpt::obs::CObservationBearingRange::getDescriptionAsText
void getDescriptionAsText(std::ostream &o) const override
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
Definition: CObservationBearingRange.cpp:163
mrpt::obs::CObservationBearingRange::minSensorDistance
float minSensorDistance
Definition: CObservationBearingRange.h:35
mrpt::obs::CObservationBearingRange::TMeasurement::range
float range
The sensed landmark distance, in meters.
Definition: CObservationBearingRange.h:54
mrpt::obs::CObservationBearingRange::CObservationBearingRange
CObservationBearingRange()=default
CSerializable.h
mrpt::obs::CObservationBearingRange::TMeasurementList
std::vector< TMeasurement > TMeasurementList
Definition: CObservationBearingRange.h:72



Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Fri Jul 17 08:43:33 UTC 2020