29 CWeightedPointsMap::TMapDefinition::TMapDefinition() =
default;
30 void CWeightedPointsMap::TMapDefinition::loadFromConfigFile_map_specific(
34 insertionOpts.loadFromConfigFile(
35 source, sectionNamePrefix +
string(
"_insertOpts"));
36 likelihoodOpts.loadFromConfigFile(
37 source, sectionNamePrefix +
string(
"_likelihoodOpts"));
40 void CWeightedPointsMap::TMapDefinition::dumpToTextStream_map_specific(
41 std::ostream& out)
const 43 this->insertionOpts.dumpToTextStream(out);
44 this->likelihoodOpts.dumpToTextStream(out);
63 void CWeightedPointsMap::reserve(
size_t newLength)
65 m_x.reserve(newLength);
66 m_y.reserve(newLength);
67 m_z.reserve(newLength);
68 pointWeight.reserve(newLength);
74 void CWeightedPointsMap::resize(
size_t newLength)
76 m_x.resize(newLength, 0);
77 m_y.resize(newLength, 0);
78 m_z.resize(newLength, 0);
79 pointWeight.resize(newLength, 1);
85 void CWeightedPointsMap::setSize(
size_t newLength)
87 m_x.assign(newLength, 0);
88 m_y.assign(newLength, 0);
89 m_z.assign(newLength, 0);
90 pointWeight.assign(newLength, 1);
93 void CWeightedPointsMap::insertPointFast(
float x,
float y,
float z)
98 this->pointWeight.push_back(1);
105 CPointsMap::base_copyFrom(
obj);
117 void CWeightedPointsMap::addFrom_classSpecific(
118 const CPointsMap& anotherMap,
const size_t nPreviousPoints)
120 const size_t nOther = anotherMap.
size();
123 const auto* anotheMap_w =
128 for (
size_t i = 0, j = nPreviousPoints; i < nOther; i++, j++)
133 uint8_t CWeightedPointsMap::serializeGetVersion()
const {
return 2; }
149 out << genericMapParams;
150 insertionOptions.writeToStream(
152 likelihoodOptions.writeToStream(out);
155 void CWeightedPointsMap::serializeFrom(
174 in.ReadBufferFixEndianness(&m_x[0],
n);
175 in.ReadBufferFixEndianness(&m_y[0],
n);
176 in.ReadBufferFixEndianness(&m_z[0],
n);
177 in.ReadBufferFixEndianness(&pointWeight[0],
n);
183 in >> genericMapParams;
186 bool disableSaveAs3DObject;
187 in >> disableSaveAs3DObject;
188 genericMapParams.enableSaveAs3DObject =
189 !disableSaveAs3DObject;
192 insertionOptions.readFromStream(
in);
199 in >> insertionOptions.minDistBetweenLaserPoints >>
200 insertionOptions.addToExistingPointsMap >>
201 insertionOptions.also_interpolate >>
202 insertionOptions.disableDeletion >>
203 insertionOptions.fuseWithExisting >>
204 insertionOptions.isPlanarMap >>
205 insertionOptions.maxDistForInterpolatePoints;
207 bool disableSaveAs3DObject;
208 in >> disableSaveAs3DObject;
209 genericMapParams.enableSaveAs3DObject =
210 !disableSaveAs3DObject;
212 in >> insertionOptions.horizontalTolerance;
215 likelihoodOptions.readFromStream(
in);
226 void CWeightedPointsMap::internal_clear()
324 void CWeightedPointsMap::loadFromRangeScan(
332 void CWeightedPointsMap::loadFromRangeScan(
344 void CWeightedPointsMap::PLY_import_set_vertex_count(
const size_t N)
Virtual base for specifying the kind and parameters of one map (normally, to be inserted into mrpt::m...
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
To be added to all CSerializable-classes implementation files.
void WriteBufferFixEndianness(const T *ptr, size_t ElementCount)
Writes a sequence of elemental datatypes, taking care of reordering their bytes from the running arch...
Declares a class derived from "CObservation" that encapsules a 3D range scan measurement, as from a time-of-flight range camera or any other RGBD sensor.
static void internal_loadFromRangeScan3D_init(CWeightedPointsMap &me, mrpt::maps::CPointsMap::TLaserRange3DInsertContext &lric)
Helper method fot the generic implementation of CPointsMap::loadFromRangeScan(), to be called only on...
mrpt::maps::CPointsMap::TInsertionOptions insertionOpts
Observations insertion options.
GLsizei GLsizei GLuint * obj
static void internal_loadFromRangeScan2D_prepareOneRange(CWeightedPointsMap &me, const float gx, const float gy, const float gz, mrpt::maps::CPointsMap::TLaserRange2DInsertContext &lric)
Helper method fot the generic implementation of CPointsMap::loadFromRangeScan(), to be called once pe...
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
With this struct options are provided to the observation insertion process.
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans or other sensors...
This class allows loading and storing values and vectors of different types from a configuration text...
This base provides a set of functions for maths stuff.
This namespace contains representation of robot actions and observations.
static void templ_loadFromRangeScan(Derived &obj, const mrpt::obs::CObservation2DRangeScan &rangeScan, const mrpt::poses::CPose3D *robotPose)
GLsizei const GLchar ** string
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
static void internal_loadFromRangeScan2D_postPushBack(CWeightedPointsMap &me, mrpt::maps::CPointsMap::TLaserRange2DInsertContext &lric)
Helper method fot the generic implementation of CPointsMap::loadFromRangeScan(), to be called after e...
mrpt::maps::CPointsMap::TLikelihoodOptions likelihoodOpts
Probabilistic observation likelihood options.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define MAP_DEFINITION_REGISTER(_CLASSNAME_STRINGS, _CLASSNAME_WITH_NS)
Registers one map class into TMetricMapInitializer factory.
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
Virtual base class for "archives": classes abstracting I/O streams.
void vector_strong_clear(VECTOR_T &v)
Like calling a std::vector<>'s clear() method, but really forcing deallocating the memory...
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans. ...
static void internal_loadFromRangeScan3D_prepareOneRange(CWeightedPointsMap &me, const float gx, const float gy, const float gz, mrpt::maps::CPointsMap::TLaserRange3DInsertContext &lric)
Helper method fot the generic implementation of CPointsMap::loadFromRangeScan(), to be called once pe...
Declares a virtual base class for all metric maps storage classes.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
mrpt::aligned_std_vector< uint32_t > pointWeight
The points weights.
GLsizei GLsizei GLchar * source
Helper struct used for internal_loadFromRangeScan3D_prepareOneRange()
unsigned __int32 uint32_t
size_t size() const
Returns the number of stored points in the map.
static void internal_loadFromRangeScan3D_postOneRange(CWeightedPointsMap &me, mrpt::maps::CPointsMap::TLaserRange3DInsertContext &lric)
Helper method fot the generic implementation of CPointsMap::loadFromRangeScan(), to be called once pe...
static void internal_loadFromRangeScan2D_init(CWeightedPointsMap &me, mrpt::maps::CPointsMap::TLaserRange2DInsertContext &lric)
Helper method fot the generic implementation of CPointsMap::loadFromRangeScan(), to be called only on...
Helper struct used for internal_loadFromRangeScan2D_prepareOneRange()
static void internal_loadFromRangeScan3D_postPushBack(CWeightedPointsMap &me, mrpt::maps::CPointsMap::TLaserRange3DInsertContext &lric)
Helper method fot the generic implementation of CPointsMap::loadFromRangeScan(), to be called after e...
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.