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(
41 std::ostream& out)
const 43 this->insertionOpts.dumpToTextStream(out);
44 this->likelihoodOpts.dumpToTextStream(out);
68 CWeightedPointsMap::~CWeightedPointsMap() {}
72 void CWeightedPointsMap::reserve(
size_t newLength)
74 m_x.reserve(newLength);
75 m_y.reserve(newLength);
76 m_z.reserve(newLength);
77 pointWeight.reserve(newLength);
83 void CWeightedPointsMap::resize(
size_t newLength)
85 m_x.resize(newLength, 0);
86 m_y.resize(newLength, 0);
87 m_z.resize(newLength, 0);
88 pointWeight.resize(newLength, 1);
96 m_x.assign(newLength, 0);
97 m_y.assign(newLength, 0);
98 m_z.assign(newLength, 0);
99 pointWeight.assign(newLength, 1);
102 void CWeightedPointsMap::setPointFast(
size_t index,
float x,
float y,
float z)
111 void CWeightedPointsMap::insertPointFast(
float x,
float y,
float z)
116 this->pointWeight.push_back(1);
125 CPointsMap::base_copyFrom(
139 void CWeightedPointsMap::addFrom_classSpecific(
140 const CPointsMap& anotherMap,
const size_t nPreviousPoints)
142 const size_t nOther = anotherMap.
size();
150 for (
size_t i = 0, j = nPreviousPoints; i < nOther; i++, j++)
155 uint8_t CWeightedPointsMap::serializeGetVersion()
const {
return 2; }
171 out << genericMapParams;
172 insertionOptions.writeToStream(
174 likelihoodOptions.writeToStream(out);
177 void CWeightedPointsMap::serializeFrom(
196 in.ReadBufferFixEndianness(&m_x[0],
n);
197 in.ReadBufferFixEndianness(&m_y[0],
n);
198 in.ReadBufferFixEndianness(&m_z[0],
n);
199 in.ReadBufferFixEndianness(&pointWeight[0],
n);
205 in >> genericMapParams;
208 bool disableSaveAs3DObject;
209 in >> disableSaveAs3DObject;
210 genericMapParams.enableSaveAs3DObject =
211 !disableSaveAs3DObject;
214 insertionOptions.readFromStream(
in);
221 in >> insertionOptions.minDistBetweenLaserPoints >>
222 insertionOptions.addToExistingPointsMap >>
223 insertionOptions.also_interpolate >>
224 insertionOptions.disableDeletion >>
225 insertionOptions.fuseWithExisting >>
226 insertionOptions.isPlanarMap >>
227 insertionOptions.maxDistForInterpolatePoints;
229 bool disableSaveAs3DObject;
230 in >> disableSaveAs3DObject;
231 genericMapParams.enableSaveAs3DObject =
232 !disableSaveAs3DObject;
234 in >> insertionOptions.horizontalTolerance;
237 likelihoodOptions.readFromStream(
in);
248 void CWeightedPointsMap::internal_clear()
346 void CWeightedPointsMap::loadFromRangeScan(
354 void CWeightedPointsMap::loadFromRangeScan(
366 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)
This must be inserted in 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.
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...
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.
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()
void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string §ionNamePrefix) override
Load all params from a config file/source.
unsigned __int32 uint32_t
void vector_strong_clear(VECTOR_T &v)
Like calling a std::vector<>'s clear() method, but really forcing deallocating the memory...
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.