MRPT  2.0.1
CObservationStereoImagesFeatures.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/img/CImage.h>
12 #include <mrpt/img/TCamera.h>
13 #include <mrpt/obs/CObservation.h>
14 #include <mrpt/poses/CPose2D.h>
15 #include <mrpt/poses/CPose3D.h>
16 #include <mrpt/poses/CPose3DQuat.h>
18 
19 namespace mrpt::obs
20 {
22 {
23  std::pair<mrpt::img::TPixelCoordf, mrpt::img::TPixelCoordf> pixels;
24  unsigned int ID;
25 };
26 
27 /** Declares a class derived from "CObservation" that encapsules a pair of
28  cameras and a set of matched image features extracted from them.
29  *
30  <b>NOTE:</b> The image features stored in this class are NOT supposed to be
31  UNDISTORTED, but the TCamera members must provide their distortion params.
32  A zero-vector of distortion params means a set of UNDISTORTED pixels.<br>
33  * \sa CObservation
34  * \ingroup mrpt_obs_grp
35  */
37 {
39 
40  public:
42  /** Other constructor providing members initialization.
43  */
45  const mrpt::img::TCamera& cLeft /*left camera*/,
46  const mrpt::img::TCamera& cRight /*right camera*/,
47  const mrpt::poses::CPose3DQuat& rCPose /*rightCameraPose*/,
48  const mrpt::poses::CPose3DQuat& cPORobot /*cameraPoseOnRobot*/);
49 
50  /** A method for storing the set of observed features in a text file in the
51  * format: <br>
52  * ID ul vl ur vr <br>
53  * being (ul,vl) and (ur,vr) the "x" and "y" coordinates for the left and
54  * right feature, respectively.
55  */
56  void saveFeaturesToTextFile(const std::string& filename);
57 
58  // ------------------
59  // Class Members
60  // ------------------
62 
63  /** The pose of the right camera, relative to the left one:
64  * Note that for the Bumblebee stereo camera and using the conventional
65  * reference coordinates for the left
66  * camera ("x" points to the right, "y" down), the "right" camera is
67  * situated
68  * at position (BL, 0, 0) with q = [1 0 0 0], where BL is the BASELINE.
69  */
71 
72  /** The pose of the LEFT camera, relative to the robot.
73  */
75 
76  /** Vectors of image feature pairs (with ID).
77  */
78  std::vector<TStereoImageFeatures> theFeatures;
79 
80  // See base class docs
81  void getSensorPose(mrpt::poses::CPose3D& out_sensorPose) const override
82  {
83  out_sensorPose = mrpt::poses::CPose3D(cameraPoseOnRobot);
84  }
85  // See base class docs
86  void getSensorPose(mrpt::poses::CPose3DQuat& out_sensorPose) const
87  {
88  out_sensorPose = cameraPoseOnRobot;
89  }
90  // See base class docs
91  void getDescriptionAsText(std::ostream& o) const override;
92 
93  /** A general method to change the sensor pose on the robot in a
94  * mrpt::poses::CPose3D form.
95  * Note that most sensors will use the full (6D) CPose3DQuat, but see the
96  * derived classes for more details or special cases.
97  * \sa getSensorPose
98  */
99  inline void setSensorPose(
100  const mrpt::poses::CPose3D& newSensorPose) override
101  {
103  }
104 
105  /** A general method to change the sensor pose on the robot in a CPose3DQuat
106  * form.
107  * Note that most sensors will use the full (6D) CPose3DQuat, but see the
108  * derived classes for more details or special cases.
109  * \sa getSensorPose
110  */
111  inline void setSensorPose(const mrpt::poses::CPose3DQuat& newSensorPose)
112  {
113  cameraPoseOnRobot = newSensorPose;
114  }
115 }; // End of class def.
116 
117 } // namespace mrpt::obs
void saveFeaturesToTextFile(const std::string &filename)
A method for storing the set of observed features in a text file in the format: ID ul vl ur vr be...
Declares a class derived from "CObservation" that encapsules a pair of cameras and a set of matched i...
std::vector< TStereoImageFeatures > theFeatures
Vectors of image feature pairs (with ID).
std::pair< mrpt::img::TPixelCoordf, mrpt::img::TPixelCoordf > pixels
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const override
A general method to retrieve the sensor pose on the robot.
This namespace contains representation of robot actions and observations.
Parameters for the Brown-Conrady camera lens distortion model.
Definition: TCamera.h:26
void getSensorPose(mrpt::poses::CPose3DQuat &out_sensorPose) const
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,qz).
Definition: CPose3DQuat.h:45
mrpt::poses::CPose3DQuat cameraPoseOnRobot
The pose of the LEFT camera, relative to the robot.
void setSensorPose(const mrpt::poses::CPose3D &newSensorPose) override
A general method to change the sensor pose on the robot in a mrpt::poses::CPose3D form...
void getDescriptionAsText(std::ostream &o) const override
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
mrpt::poses::CPose3DQuat rightCameraPose
The pose of the right camera, relative to the left one: Note that for the Bumblebee stereo camera and...
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 setSensorPose(const mrpt::poses::CPose3DQuat &newSensorPose)
A general method to change the sensor pose on the robot in a CPose3DQuat form.
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...



Page generated by Doxygen 1.8.14 for MRPT 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020