MRPT  2.0.1
CObservationPointCloud.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 
10 #pragma once
11 
12 #include <mrpt/maps/CPointsMap.h>
13 #include <mrpt/obs/CObservation.h>
14 
15 namespace mrpt::obs
16 {
17 class CObservation3DRangeScan;
18 
19 /** An observation from any sensor that can be summarized as a pointcloud.
20  * The cloud can comprise plain XYZ points, or can include intensity, or RGB
21  * data; in particular, the point cloud can be any of the derived classes of
22  * mrpt::maps::CPointsMap.
23  *
24  * The pointcloud has as frame of coordinates the `sensorPose` field, which
25  * may match the origin of the vehicle/robot or not.
26  *
27  * \note This is a mrpt::obs::CObservation class, but it is defined in the
28  * mrpt_maps_grp library, so it can use mrpt::maps::CPointsMap.
29  *
30  * \sa CObservation, mrpt::maps::CPointsMap
31  * \ingroup mrpt_maps_grp
32  */
34 {
36 
37  public:
38  enum class ExternalStorageFormat : uint8_t
39  {
40  None = 0, //!< is always stored in memory
41  MRPT_Serialization, //!< Uses mrpt-serialization binary file
42  KittiBinFile, //!< Uses Kitti .bin file format
43  PlainTextFile //!< Plain text, each line has "x y z [i]" coords
44  };
45 
46  protected:
48  std::string m_external_file;
49 
50  public:
51  CObservationPointCloud() = default;
52 
54 
55  /** The pointcloud */
57 
58  /** Sensor placement wrt the vehicle/robot.
59  * i.e. A point at (0,0,0) in \a pointcloud is at \a sensorPose wrt the
60  * vehicle.
61  */
63 
64  // See base class docs
65  void getSensorPose(mrpt::poses::CPose3D& out_sensorPose) const override;
66  void setSensorPose(const mrpt::poses::CPose3D& p) override;
67  void getDescriptionAsText(std::ostream& o) const override;
68 
69  /** @name Delayed-load manual control methods.
70  @{ */
71  // See base class docs.
72  void load() const override;
73  void unload() override;
74  /** @} */
75 
76  /** \name Point cloud external storage functions
77  * @{ */
78  inline bool isExternallyStored() const
79  {
81  }
82  inline const std::string& getExternalStorageFile() const
83  {
84  return m_external_file;
85  }
87  const std::string& fileName, const ExternalStorageFormat fmt);
88 
90  {
91  m_externally_stored = fmt;
92  }
93  /** @} */
94 
95 }; // End of class def.
96 
97 } // namespace mrpt::obs
void load() const override
Makes sure all images and other fields which may be externally stored are loaded in memory...
An observation from any sensor that can be summarized as a pointcloud.
void overrideExternalStorageFormatFlag(const ExternalStorageFormat fmt)
A range or depth 3D scan measurement, as from a time-of-flight range camera or a structured-light dep...
void setSensorPose(const mrpt::poses::CPose3D &p) override
A general method to change the sensor pose on the robot.
mrpt::poses::CPose3D sensorPose
Sensor placement wrt the vehicle/robot.
void unload() override
Unload all images, for the case they being delayed-load images stored in external files (othewise...
This namespace contains representation of robot actions and observations.
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const override
A general method to retrieve the sensor pose on the robot.
mrpt::maps::CPointsMap::Ptr pointcloud
The pointcloud.
void setAsExternalStorage(const std::string &fileName, const ExternalStorageFormat fmt)
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
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
void getDescriptionAsText(std::ostream &o) const override
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
const std::string & getExternalStorageFile() const



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