30 void CWeightedPointsMap::TMapDefinition::loadFromConfigFile_map_specific(
35 source, sectionNamePrefix +
string(
"_insertOpts"));
36 likelihoodOpts.loadFromConfigFile(
37 source, sectionNamePrefix +
string(
"_likelihoodOpts"));
40 void CWeightedPointsMap::TMapDefinition::dumpToTextStream_map_specific(
43 this->insertionOpts.dumpToTextStream(out);
44 this->likelihoodOpts.dumpToTextStream(out);
68 CWeightedPointsMap::~CWeightedPointsMap() {}
72 void CWeightedPointsMap::reserve(
size_t newLength)
78 pointWeight.reserve(newLength);
84 void CWeightedPointsMap::resize(
size_t newLength)
86 this->reserve(newLength);
87 x.resize(newLength, 0);
88 y.resize(newLength, 0);
89 z.resize(newLength, 0);
90 pointWeight.resize(newLength, 1);
98 this->reserve(newLength);
99 x.assign(newLength, 0);
100 y.assign(newLength, 0);
101 z.assign(newLength, 0);
102 pointWeight.assign(newLength, 1);
105 void CWeightedPointsMap::setPointFast(
size_t index,
float x,
float y,
float z)
114 void CWeightedPointsMap::insertPointFast(
float x,
float y,
float z)
116 this->x.push_back(
x);
117 this->y.push_back(
y);
118 this->z.push_back(
z);
119 this->pointWeight.push_back(1);
128 CPointsMap::base_copyFrom(
142 void CWeightedPointsMap::addFrom_classSpecific(
143 const CPointsMap& anotherMap,
const size_t nPreviousPoints)
145 const size_t nOther = anotherMap.
size();
153 for (
size_t i = 0, j = nPreviousPoints; i < nOther; i++, j++)
163 void CWeightedPointsMap::writeToStream(
183 out << genericMapParams;
184 insertionOptions.writeToStream(
186 likelihoodOptions.writeToStream(out);
213 in.ReadBufferFixEndianness(&
x[0],
n);
214 in.ReadBufferFixEndianness(&
y[0],
n);
215 in.ReadBufferFixEndianness(&
z[0],
n);
216 in.ReadBufferFixEndianness(&pointWeight[0],
n);
222 in >> genericMapParams;
225 bool disableSaveAs3DObject;
226 in >> disableSaveAs3DObject;
227 genericMapParams.enableSaveAs3DObject =
228 !disableSaveAs3DObject;
231 insertionOptions.readFromStream(
in);
238 in >> insertionOptions.minDistBetweenLaserPoints >>
239 insertionOptions.addToExistingPointsMap >>
240 insertionOptions.also_interpolate >>
241 insertionOptions.disableDeletion >>
242 insertionOptions.fuseWithExisting >>
243 insertionOptions.isPlanarMap >>
244 insertionOptions.maxDistForInterpolatePoints;
246 bool disableSaveAs3DObject;
247 in >> disableSaveAs3DObject;
248 genericMapParams.enableSaveAs3DObject =
249 !disableSaveAs3DObject;
251 in >> insertionOptions.horizontalTolerance;
254 likelihoodOptions.readFromStream(
in);
265 void CWeightedPointsMap::internal_clear()
370 void CWeightedPointsMap::loadFromRangeScan(
378 void CWeightedPointsMap::loadFromRangeScan(
390 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...
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
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...
std::vector< uint32_t > pointWeight
The points weights.
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...
This class allows loading and storing values and vectors of different types from a configuration text...
With this struct options are provided to the observation insertion process.
void WriteBufferFixEndianness(const T *ptr, size_t ElementCount)
Writes a sequence of elemental datatypes, taking care of reordering their bytes from the running arch...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans or other sensors...
This base provides a set of functions for maths stuff.
T length2length4N(T len)
Returns the smaller number >=len such that it's a multiple of 4.
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
This namespace contains representation of robot actions and observations.
EIGEN_STRONG_INLINE void setSize(size_t row, size_t col)
Changes the size of matrix, maintaining its previous content as possible and padding with zeros where...
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...
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string §ionNamePrefix) override
Load all params from a config file/source.
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.
void vector_strong_clear(VECTOR_T &v)
Like calling a std::vector<>'s clear() method, but really forcing deallocating the memory...
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...
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).
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...