Class CSimplePointsMap

Inheritance Relationships

Base Type

Class Documentation

class CSimplePointsMap : public mrpt::maps::CPointsMap

A cloud of points in 2D or 3D, which can be built from a sequence of laser scans. This class only stores the coordinates (x,y,z) of each point.

See mrpt::maps::CPointsMap and derived classes for other point cloud classes.

See also

CMetricMap, CPoint, mrpt::serialization::CSerializable

Pure virtual interfaces to be implemented by any class derived

from CPointsMap

friend struct detail::loadFromRangeImpl
friend struct detail::pointmap_traits
virtual void reserve(size_t newLength) override

Reserves memory for a given number of points: the size of the map does not change, it only reserves the memory. This is useful for situations where it is approximately known the final size of the map. This method is more efficient than constantly increasing the size of the buffers. Refer to the STL C++ library’s “reserve” methods.

virtual void resize(size_t newLength) override

Resizes all point buffers so they can hold the given number of points: newly created points are set to default values, and old contents are not changed.

virtual void setSize(size_t newLength) override

Resizes all point buffers so they can hold the given number of points, erasing all previous contents and leaving all points to default values.

void insertPointFast(float x, float y, float z = 0)

The virtual method for insertPoint() without calling mark_as_modified()

inline virtual void getPointAllFieldsFast(size_t index, std::vector<float> &point_data) const override

Get all the data fields for one point as a vector: [X Y Z] Unlike getPointAllFields(), this method does not check for index out of bounds

inline virtual void setPointAllFieldsFast(size_t index, const std::vector<float> &point_data) override

Set all the data fields for one point as a vector: [X Y Z] Unlike setPointAllFields(), this method does not check for index out of bounds

virtual void loadFromRangeScan(const mrpt::obs::CObservation2DRangeScan &rangeScan, const std::optional<const mrpt::poses::CPose3D> &robotPose) override

Transform the range scan into a set of cartessian coordinated points. The options in “insertionOptions” are considered in this method.

Only ranges marked as “valid=true” in the observation will be inserted

See also

CObservation2DRangeScan, CObservation3DRangeScan

Note

Each derived class may enrich points in different ways (color, weight, etc..), so please refer to the description of the specific implementation of mrpt::maps::CPointsMap you are using.

Note

The actual generic implementation of this file lives in <src>/CPointsMap_crtp_common.h, but specific instantiations are generated at each derived class.

Parameters:
  • rangeScan – The scan to be inserted into this map

  • robotPose – Default to (0,0,0|0deg,0deg,0deg). Changes the frame of reference for the point cloud (i.e. the vehicle/robot pose in world coordinates).

virtual void loadFromRangeScan(const mrpt::obs::CObservation3DRangeScan &rangeScan, const std::optional<const mrpt::poses::CPose3D> &robotPose) override

Overload of loadFromRangeScan() for 3D range scans (for example, Kinect observations).

Note

Each derived class may enrich points in different ways (color, weight, etc..), so please refer to the description of the specific implementation of mrpt::maps::CPointsMap you are using.

Note

The actual generic implementation of this file lives in <src>/CPointsMap_crtp_common.h, but specific instantiations are generated at each derived class.

Parameters:
  • rangeScan – The scan to be inserted into this map

  • robotPose – Default to (0,0,0|0deg,0deg,0deg). Changes the frame of reference for the point cloud (i.e. the vehicle/robot pose in world coordinates).

PLY Import virtual methods to implement in base classes

virtual void PLY_import_set_vertex_count(size_t N) override

In a base class, reserve memory to prepare subsequent calls to PLY_import_set_vertex

inline void PLY_import_set_vertex_timestamp([[maybe_unused]] size_t idx, [[maybe_unused]] const double unixTimestamp) override

Public Functions

CSimplePointsMap() = default

Default constructor

inline explicit CSimplePointsMap(const CPointsMap &o)
inline CSimplePointsMap(const CSimplePointsMap &o)
inline CSimplePointsMap &operator=(const CPointsMap &o)
inline CSimplePointsMap &operator=(const CSimplePointsMap &o)
inline const mrpt::maps::CSimplePointsMap *getAsSimplePointsMap() const override

Protected Functions

void internal_clear() override

Clear the map, erasing all the points.

Protected Attributes

mrpt::maps::CPointsMap::TInsertionOptions insertionOpts

Observations insertion options

mrpt::maps::CPointsMap::TLikelihoodOptions likelihoodOpts

Probabilistic observation likelihood options

mrpt::maps::CPointsMap::TRenderOptions renderOpts

Rendering as 3D object options