34 CObservationRGBD360::~CObservationRGBD360() {}
36 uint8_t CObservationRGBD360::serializeGetVersion()
const {
return 1; }
40 out << maxRange << sensorPose;
44 for (
const auto& ri : rangeImages)
46 out.WriteAs<uint32_t>(ri.rows());
47 out.WriteAs<uint32_t>(ri.cols());
48 if (ri.size() == 0)
continue;
49 out.WriteBufferFixEndianness<uint16_t>(ri.data(), ri.size());
51 out << hasIntensityImage;
52 if (hasIntensityImage)
53 for (
const auto& intensityImage : intensityImages)
54 out << intensityImage;
57 for (
auto t : timestamps)
out << t;
63 out << m_points3D_external_stored << m_points3D_external_file;
64 out << m_rangeImage_external_stored << m_rangeImage_external_file;
67 void CObservationRGBD360::serializeFrom(
74 "Import from serialization version 0 not implemented!");
78 in >> maxRange >> sensorPose;
81 for (
auto& ri : rangeImages)
83 const auto rows = in.
ReadAs<uint32_t>();
84 const auto cols = in.
ReadAs<uint32_t>();
85 ri.setSize(rows, cols);
89 in >> hasIntensityImage;
90 if (hasIntensityImage)
91 for (
auto& intensityImage : intensityImages)
94 for (
auto& t : timestamps) in >> t;
99 in >> m_points3D_external_stored >> m_points3D_external_file;
100 in >> m_rangeImage_external_stored >> m_rangeImage_external_file;
110 void CObservationRGBD360::rangeImage_setSize(
111 const int H,
const int W,
const unsigned sensor_id)
114 rangeImages[sensor_id].setSize(H, W);
117 void CObservationRGBD360::getDescriptionAsText(std::ostream& o)
const 119 CObservation::getDescriptionAsText(o);
Declares a class derived from "CObservation" that encapsules an omnidirectional RGBD measurement from...
#define THROW_EXCEPTION(msg)
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
To be added to all CSerializable-classes implementation files.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
This base provides a set of functions for maths stuff.
STORED_TYPE ReadAs()
De-serialize a variable and returns it by value.
This namespace contains representation of robot actions and observations.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Virtual base class for "archives": classes abstracting I/O streams.
mrpt::vision::TStereoCalibResults out
Declares a class that represents any robot's observation.
size_t ReadBufferFixEndianness(T *ptr, size_t ElementCount)
Reads a sequence of elemental datatypes, taking care of reordering their bytes from the MRPT stream s...