31 : m_points3D_external_stored(false),
32 m_rangeImage_external_stored(false),
36 hasIntensityImage(false),
49 CObservationRGBD360::~CObservationRGBD360()
51 #ifdef COBS3DRANGE_USE_MEMPOOL 57 uint8_t CObservationRGBD360::serializeGetVersion()
const {
return 0; }
61 out << maxRange << sensorPose;
78 for (
unsigned i = 0; i < NUM_SENSORS; i++) out << rangeImages[i];
79 out << hasIntensityImage;
80 if (hasIntensityImage)
81 for (
unsigned i = 0; i < NUM_SENSORS; i++) out << intensityImages[i];
84 for (
unsigned i = 0; i < NUM_SENSORS; i++) out << timestamps[i];
90 out << m_points3D_external_stored << m_points3D_external_file;
91 out << m_rangeImage_external_stored << m_rangeImage_external_file;
94 void CObservationRGBD360::serializeFrom(
101 in >> maxRange >> sensorPose;
104 for (
unsigned i = 0; i < NUM_SENSORS; i++)
106 #ifdef COBS3DRANGE_USE_MEMPOOL 109 this->rangeImage_setSize(240, 320, i);
111 in >> rangeImages[i];
114 in >> hasIntensityImage;
115 if (hasIntensityImage)
116 for (
unsigned i = 0; i < NUM_SENSORS; i++)
117 in >> intensityImages[i];
125 for (
unsigned i = 0; i < NUM_SENSORS; i++) in >> timestamps[i];
130 in >> m_points3D_external_stored >> m_points3D_external_file;
131 in >> m_rangeImage_external_stored >> m_rangeImage_external_file;
141 void CObservationRGBD360::rangeImage_setSize(
142 const int H,
const int W,
const unsigned sensor_id)
144 #ifdef COBS3DRANGE_USE_MEMPOOL 149 CObservationRGBD360_Ranges_MemPoolParams mem_params;
153 CObservationRGBD360_Ranges_MemPoolData* mem_block =
158 rangeImage.swap(mem_block->rangeImage);
166 rangeImages[sensor_id].setSize(H, W);
169 void CObservationRGBD360::getDescriptionAsText(std::ostream& o)
const 171 CObservation::getDescriptionAsText(o);
Declares a class derived from "CObservation" that encapsules an omnidirectional RGBD measurement from...
void mempool_donate_range_matrix(CObservation3DRangeScan &obs)
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
POOLABLE_DATA * request_memory(const DATA_PARAMS ¶ms)
Request a block of data which fulfils the size requirements stated in params.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
A generic system for versatile memory pooling.
This base provides a set of functions for maths stuff.
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.
Declares a class that represents any robot's observation.
void mempool_donate_xyz_buffers(CObservation3DRangeScan &obs)
static CGenericMemoryPool< DATA_PARAMS, POOLABLE_DATA > * getInstance(const size_t max_pool_entries=5)
Construct-on-first-use (~singleton) pattern: Return the unique instance of this class for a given tem...