9 #ifndef CWeightedPointsMap_H
10 #define CWeightedPointsMap_H
61 virtual
void getPointAllFieldsFast( const
size_t index, std::vector<
float> & point_data ) const
MRPT_OVERRIDE {
63 point_data[0] = x[index];
64 point_data[1] = y[index];
65 point_data[2] = z[index];
66 point_data[3] = pointWeight[index];
75 x[index] = point_data[0];
76 y[index] = point_data[1];
77 z[index] = point_data[2];
78 pointWeight[index] = point_data[3];
142 static const int HAS_RGB = 0;
143 static const int HAS_RGBf = 0;
144 static const int HAS_RGBu8 = 0;
149 inline size_t size()
const {
return m_obj.
size(); }
154 template <
typename T>
155 inline void getPointXYZ(
const size_t idx, T &x,T &y, T &z)
const {
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
#define MAP_DEFINITION_END(_CLASS_NAME_, _LINKAGE_)
#define MAP_DEFINITION_START(_CLASS_NAME_, _LINKAGE_)
Add a MAP_DEFINITION_START() ...
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans or other sensors.
void getPointFast(size_t index, float &x, float &y, float &z) const
Just like getPoint() but without checking out-of-bound index and without returning the point weight,...
size_t size() const
Returns the number of stored points in the map.
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans.
virtual void reserve(size_t newLength) MRPT_OVERRIDE
Reserves memory for a given number of points: the size of the map does not change,...
std::vector< uint32_t > pointWeight
The points weights.
CWeightedPointsMap()
Default constructor.
virtual void internal_clear() MRPT_OVERRIDE
Clear the map, erasing all the points.
virtual void setPointFast(size_t index, float x, float y, float z) MRPT_OVERRIDE
Changes the coordinates of the given point (0-based index), without checking for out-of-bounds and wi...
virtual ~CWeightedPointsMap()
Destructor.
virtual void insertPointFast(float x, float y, float z=0) MRPT_OVERRIDE
The virtual method for insertPoint() without calling mark_as_modified()
virtual unsigned int getPointWeight(size_t index) const MRPT_OVERRIDE
Gets the point weight, which is ignored in all classes (defaults to 1) but in those which actually st...
virtual void addFrom_classSpecific(const CPointsMap &anotherMap, const size_t nPreviousPoints) MRPT_OVERRIDE
Auxiliary method called from within addFrom() automatically, to finish the copying of class-specific ...
virtual void loadFromRangeScan(const mrpt::obs::CObservation3DRangeScan &rangeScan, const mrpt::poses::CPose3D *robotPose=NULL) MRPT_OVERRIDE
See CPointsMap::loadFromRangeScan()
virtual void loadFromRangeScan(const mrpt::obs::CObservation2DRangeScan &rangeScan, const mrpt::poses::CPose3D *robotPose=NULL) MRPT_OVERRIDE
See CPointsMap::loadFromRangeScan()
virtual void resize(size_t newLength) MRPT_OVERRIDE
Resizes all point buffers so they can hold the given number of points: newly created points are set t...
virtual void setPointAllFieldsFast(const size_t index, const std::vector< float > &point_data) MRPT_OVERRIDE
Set all the data fields for one point as a vector: [X Y Z WEIGHT] Unlike setPointAllFields(),...
virtual void setPointWeight(size_t index, unsigned long w) MRPT_OVERRIDE
Sets the point weight, which is ignored in all classes but those which actually store that field (Not...
virtual void setSize(size_t newLength) MRPT_OVERRIDE
Resizes all point buffers so they can hold the given number of points, erasing all previous contents ...
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
Declares a class derived from "CObservation" that encapsules a 3D range scan measurement,...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
PointCloudAdapter(const mrpt::maps::CWeightedPointsMap &obj)
Constructor (accept a const ref for convenience)
void setPointXYZ(const size_t idx, const coords_t x, const coords_t y, const coords_t z)
Set XYZ coordinates of i'th point.
mrpt::maps::CWeightedPointsMap & m_obj
size_t size() const
Get number of points.
float coords_t
The type of each point XYZ coordinates.
void getPointXYZ(const size_t idx, T &x, T &y, T &z) const
Get XYZ coordinates of i'th point.
void resize(const size_t N)
Set number of points (to uninitialized values)
An adapter to different kinds of point cloud object.
A helper base class for those PointCloudAdapter<> which do not handle RGB data; it declares needed in...
#define ASSERTDEB_(f)
Defines an assertion mechanism - only when compiled in debug.
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
With this struct options are provided to the observation insertion process.
Options used when evaluating "computeObservationLikelihood" in the derived classes.