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



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020