MRPT  2.0.4
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
mrpt::obs::CObservationPointCloud::ExternalStorageFormat::None
@ None
is always stored in memory
mrpt::obs::CObservationPointCloud::m_externally_stored
ExternalStorageFormat m_externally_stored
Definition: CObservationPointCloud.h:47
mrpt::obs::CObservationPointCloud::load
void load() const override
Makes sure all images and other fields which may be externally stored are loaded in memory.
Definition: CObservationPointCloud.cpp:116
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
CPointsMap.h
mrpt::obs::CObservationPointCloud::overrideExternalStorageFormatFlag
void overrideExternalStorageFormatFlag(const ExternalStorageFormat fmt)
Definition: CObservationPointCloud.h:89
mrpt::obs::CObservationPointCloud::ExternalStorageFormat::PlainTextFile
@ PlainTextFile
Plain text, each line has "x y z [i]" coords.
mrpt::obs::CObservationPointCloud::ExternalStorageFormat
ExternalStorageFormat
Definition: CObservationPointCloud.h:38
mrpt::obs::CObservationPointCloud::getSensorPose
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const override
A general method to retrieve the sensor pose on the robot.
Definition: CObservationPointCloud.cpp:34
mrpt::obs::CObservationPointCloud::ExternalStorageFormat::KittiBinFile
@ KittiBinFile
Uses Kitti .bin file format.
mrpt::obs
This namespace contains representation of robot actions and observations.
Definition: CParticleFilter.h:17
mrpt::obs::CObservationPointCloud::CObservationPointCloud
CObservationPointCloud()=default
mrpt::maps::CPointsMap::Ptr
std::shared_ptr< CPointsMap > Ptr
Definition: CPointsMap.h:72
mrpt::obs::CObservationPointCloud::sensorPose
mrpt::poses::CPose3D sensorPose
Sensor placement wrt the vehicle/robot.
Definition: CObservationPointCloud.h:62
mrpt::obs::CObservation3DRangeScan
A range or depth 3D scan measurement, as from a time-of-flight range camera or a structured-light dep...
Definition: CObservation3DRangeScan.h:168
mrpt::obs::CObservationPointCloud::pointcloud
mrpt::maps::CPointsMap::Ptr pointcloud
The pointcloud.
Definition: CObservationPointCloud.h:56
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:85
mrpt::obs::CObservationPointCloud::getExternalStorageFile
const std::string & getExternalStorageFile() const
Definition: CObservationPointCloud.h:82
mrpt::obs::CObservationPointCloud::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: CObservationPointCloud.cpp:43
mrpt::obs::CObservationPointCloud::isExternallyStored
bool isExternallyStored() const
Definition: CObservationPointCloud.h:78
mrpt::obs::CObservationPointCloud::unload
void unload() override
Unload all images, for the case they being delayed-load images stored in external files (othewise,...
Definition: CObservationPointCloud.cpp:204
CObservation.h
mrpt::obs::CObservation
Declares a class that represents any robot's observation.
Definition: CObservation.h:43
mrpt::obs::CObservationPointCloud
An observation from any sensor that can be summarized as a pointcloud.
Definition: CObservationPointCloud.h:33
mrpt::obs::CObservationPointCloud::setAsExternalStorage
void setAsExternalStorage(const std::string &fileName, const ExternalStorageFormat fmt)
Definition: CObservationPointCloud.cpp:250
mrpt::obs::CObservationPointCloud::m_external_file
std::string m_external_file
Definition: CObservationPointCloud.h:48
mrpt::obs::CObservationPointCloud::ExternalStorageFormat::MRPT_Serialization
@ MRPT_Serialization
Uses mrpt-serialization binary file.
mrpt::obs::CObservationPointCloud::setSensorPose
void setSensorPose(const mrpt::poses::CPose3D &p) override
A general method to change the sensor pose on the robot.
Definition: CObservationPointCloud.cpp:39



Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sun Jul 19 17:54:30 UTC 2020