Main MRPT website > C++ reference
MRPT logo
List of all members | Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes
mrpt::slam::CColouredPointsMap Class Reference

Detailed Description

A map of 2D/3D points with individual colours (RGB).

For different color schemes, see CColouredPointsMap::colorScheme Colors are defined in the range [0,1].

See also
mrpt::slam::CPointsMap, mrpt::slam::CMetricMap, mrpt::utils::CSerializable

Definition at line 36 of file CColouredPointsMap.h.

#include <mrpt/slam/CColouredPointsMap.h>

Inheritance diagram for mrpt::slam::CColouredPointsMap:
Inheritance graph
[legend]

Classes

struct  TColourOptions
 The definition of parameters for generating colors from laser scans. More...
 

Public Types

enum  TColouringMethod { cmFromHeightRelativeToSensor = 0, cmFromHeightRelativeToSensorJet = 0, cmFromHeightRelativeToSensorGray = 1, cmFromIntensityImage = 2 }
 The choices for coloring schemes: More...
 

Public Member Functions

virtual ~CColouredPointsMap ()
 Destructor. More...
 
 CColouredPointsMap ()
 Default constructor. More...
 
bool save3D_and_colour_to_text_file (const std::string &file) const
 Save to a text file. More...
 
virtual void setPoint (size_t index, float x, float y, float z, float R, float G, float B)
 Changes a given point from map. More...
 
void setPoint (size_t index, float x, float y, float z)
 
void setPoint (size_t index, CPoint2D &p)
 
void setPoint (size_t index, CPoint3D &p)
 
void setPoint (size_t index, float x, float y)
 
virtual void insertPoint (float x, float y, float z, float R, float G, float B)
 Adds a new point given its coordinates and color (colors range is [0,1]) More...
 
void insertPoint (const CPoint3D &p)
 
void insertPoint (const mrpt::math::TPoint3D &p)
 
void insertPoint (float x, float y, float z)
 
void setPointColor (size_t index, float R, float G, float B)
 Changes just the color of a given point from the map. More...
 
void setPointColor_fast (size_t index, float R, float G, float B)
 Like setPointColor but without checking for out-of-index erors. More...
 
virtual void getPoint (size_t index, float &x, float &y, float &z, float &R, float &G, float &B) const
 Retrieves a point and its color (colors range is [0,1]) More...
 
unsigned long getPoint (size_t index, float &x, float &y, float &z) const
 Retrieves a point. More...
 
void getPointColor (size_t index, float &R, float &G, float &B) const
 Retrieves a point color (colors range is [0,1]) More...
 
void getPointColor_fast (size_t index, float &R, float &G, float &B) const
 Like getPointColor but without checking for out-of-index erors. More...
 
virtual bool hasColorPoints () const
 Returns true if the point map has a color field for each point. More...
 
virtual void getAs3DObject (mrpt::opengl::CSetOfObjectsPtr &outObj) const
 Override of the default 3D scene builder to account for the individual points' color. More...
 
bool colourFromObservation (const CObservationImage &obs, const CPose3D &robotPose)
 Colour a set of points from a CObservationImage and the global pose of the robot. More...
 
void resetPointsMinDist (float defValue=2000.0f)
 Reset the minimum-observed-distance buffer for all the points to a predefined value. More...
 
virtual float squareDistanceToClosestCorrespondence (float x0, float y0) const MRPT_OVERRIDE
 Returns the square distance from the 2D point (x0,y0) to the closest correspondence in the map. More...
 
float squareDistanceToClosestCorrespondenceT (const TPoint2D &p0) const
 
virtual void addFrom (const CPointsMap &anotherMap)
 Adds all the points from anotherMap to this map, without fusing. More...
 
void operator+= (const CPointsMap &anotherMap)
 This operator is synonymous with addFrom. More...
 
void insertAnotherMap (const CPointsMap *otherMap, const CPose3D &otherPose)
 Insert the contents of another map into this one with some geometric transformation, without fusing close points. More...
 
size_t size () const
 Returns the number of stored points in the map. More...
 
size_t getPointsCount () const
 Returns the number of stored points in the map (DEPRECATED, use "size()" instead better) More...
 
unsigned long getPoint (size_t index, float &x, float &y) const
 
unsigned long getPoint (size_t index, double &x, double &y, double &z) const
 
unsigned long getPoint (size_t index, double &x, double &y) const
 
unsigned long getPoint (size_t index, CPoint2D &p) const
 
unsigned long getPoint (size_t index, CPoint3D &p) const
 
unsigned long getPoint (size_t index, mrpt::math::TPoint2D &p) const
 
unsigned long getPoint (size_t index, mrpt::math::TPoint3D &p) const
 
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, just XYZ. More...
 
virtual void setPointWeight (size_t index, unsigned long w)
 Sets the point weight, which is ignored in all classes but those which actually store that field (Note: No checks are done for out-of-bounds index). More...
 
virtual unsigned int getPointWeight (size_t index) const
 Gets the point weight, which is ignored in all classes (defaults to 1) but in those which actually store that field (Note: No checks are done for out-of-bounds index). More...
 
void getPointsBuffer (size_t &outPointsCount, const float *&xs, const float *&ys, const float *&zs) const
 Provides a direct access to points buffer, or NULL if there is no points in the map. More...
 
const std::vector< float > & getPointsBufferRef_x () const
 Provides a direct access to a read-only reference of the internal point buffer. More...
 
const std::vector< float > & getPointsBufferRef_y () const
 Provides a direct access to a read-only reference of the internal point buffer. More...
 
const std::vector< float > & getPointsBufferRef_z () const
 Provides a direct access to a read-only reference of the internal point buffer. More...
 
template<class VECTOR >
void getAllPoints (VECTOR &xs, VECTOR &ys, VECTOR &zs, size_t decimation=1) const
 Returns a copy of the 2D/3D points as a std::vector of float coordinates. More...
 
void getAllPoints (std::vector< TPoint3D > &ps, size_t decimation=1) const
 
void getAllPoints (std::vector< float > &xs, std::vector< float > &ys, size_t decimation=1) const
 Returns a copy of the 2D/3D points as a std::vector of float coordinates. More...
 
void getAllPoints (std::vector< TPoint2D > &ps, size_t decimation=1) const
 
template<typename VECTOR >
void setAllPointsTemplate (const VECTOR &X, const VECTOR &Y, const VECTOR &Z=VECTOR())
 Set all the points at once from vectors with X,Y and Z coordinates (if Z is not provided, it will be set to all zeros). More...
 
void setAllPoints (const std::vector< float > &X, const std::vector< float > &Y, const std::vector< float > &Z)
 Set all the points at once from vectors with X,Y and Z coordinates. More...
 
void setAllPoints (const std::vector< float > &X, const std::vector< float > &Y)
 Set all the points at once from vectors with X and Y coordinates (Z=0). More...
 
void getPointAllFields (const size_t index, std::vector< float > &point_data) const
 Get all the data fields for one point as a vector: depending on the implementation class this can be [X Y Z] or [X Y Z R G B], etc... More...
 
void setPointAllFields (const size_t index, const std::vector< float > &point_data)
 Set all the data fields for one point as a vector: depending on the implementation class this can be [X Y Z] or [X Y Z R G B], etc... More...
 
void clipOutOfRangeInZ (float zMin, float zMax)
 Delete points out of the given "z" axis range have been removed. More...
 
void clipOutOfRange (const CPoint2D &point, float maxRange)
 Delete points which are more far than "maxRange" away from the given "point". More...
 
void applyDeletionMask (const std::vector< bool > &mask)
 Remove from the map the points marked in a bool's array as "true". More...
 
virtual void determineMatching2D (const CMetricMap *otherMap, const CPose2D &otherMapPose, TMatchingPairList &correspondences, const TMatchingParams &params, TMatchingExtraResults &extraResults) const
 Computes the matching between this and another 2D point map, which includes finding: More...
 
virtual void determineMatching3D (const CMetricMap *otherMap, const CPose3D &otherMapPose, TMatchingPairList &correspondences, const TMatchingParams &params, TMatchingExtraResults &extraResults) const
 Computes the matchings between this and another 3D points map - method used in 3D-ICP. More...
 
float compute3DMatchingRatio (const CMetricMap *otherMap, const CPose3D &otherMapPose, float maxDistForCorr=0.10f, float maxMahaDistForCorr=2.0f) const
 Computes the ratio in [0,1] of correspondences between "this" and the "otherMap" map, whose 6D pose relative to "this" is "otherMapPose" In the case of a multi-metric map, this returns the average between the maps. More...
 
void compute3DDistanceToMesh (const CMetricMap *otherMap2, const CPose3D &otherMapPose, float maxDistForCorrespondence, TMatchingPairList &correspondences, float &correspondencesRatio)
 Computes the matchings between this and another 3D points map. More...
 
void fuseWith (CPointsMap *anotherMap, float minDistForFuse=0.02f, std::vector< bool > *notFusedPoints=NULL)
 Insert the contents of another map into this one, fusing the previous content with the new one. More...
 
void changeCoordinatesReference (const CPose2D &b)
 Replace each point $ p_i $ by $ p'_i = b \oplus p_i $ (pose compounding operator). More...
 
void changeCoordinatesReference (const CPose3D &b)
 Replace each point $ p_i $ by $ p'_i = b \oplus p_i $ (pose compounding operator). More...
 
void changeCoordinatesReference (const CPointsMap &other, const CPose3D &b)
 Copy all the points from "other" map to "this", replacing each point $ p_i $ by $ p'_i = b \oplus p_i $ (pose compounding operator). More...
 
virtual bool isEmpty () const
 Returns true if the map is empty/no observation has been inserted. More...
 
bool empty () const
 STL-like method to check whether the map is empty: More...
 
virtual const CSimplePointsMapgetAsSimplePointsMap () const
 If the map is a simple points map or it's a multi-metric map that contains EXACTLY one simple points map, return it. More...
 
virtual CSimplePointsMapgetAsSimplePointsMap ()
 
float getLargestDistanceFromOrigin () const
 This method returns the largest distance from the origin to any of the points, such as a sphere centered at the origin with this radius cover ALL the points in the map (the results are buffered, such as, if the map is not modified, the second call will be much faster than the first one). More...
 
float getLargestDistanceFromOriginNoRecompute (bool &output_is_valid) const
 Like getLargestDistanceFromOrigin() but returns in output_is_valid = false if the distance was not already computed, skipping its computation then, unlike getLargestDistanceFromOrigin() More...
 
void boundingBox (float &min_x, float &max_x, float &min_y, float &max_y, float &min_z, float &max_z) const
 Computes the bounding box of all the points, or (0,0 ,0,0, 0,0) if there are no points. More...
 
void boundingBox (TPoint3D &pMin, TPoint3D &pMax) const
 
void extractCylinder (const CPoint2D &center, const double radius, const double zmin, const double zmax, CPointsMap *outMap)
 Extracts the points in the map within a cylinder in 3D defined the provided radius and zmin/zmax values. More...
 
void extractPoints (const TPoint3D &corner1, const TPoint3D &corner2, CPointsMap *outMap, const double &R=1, const double &G=1, const double &B=1)
 Extracts the points in the map within the area defined by two corners. More...
 
virtual double computeObservationLikelihood (const CObservation *obs, const CPose3D &takenFrom)
 Computes the log-likelihood of a given observation given an arbitrary robot 3D pose. More...
 
double computeObservationLikelihood (const CObservation *obs, const CPose2D &takenFrom)
 Computes the log-likelihood of a given observation given an arbitrary robot 2D pose. More...
 
void clear ()
 Erase all the contents of the map. More...
 
void loadFromProbabilisticPosesAndObservations (const CSimpleMap &Map)
 Load the map contents from a CSimpleMap object, erasing all previous content of the map. More...
 
void loadFromSimpleMap (const CSimpleMap &Map)
 Load the map contents from a CSimpleMap object, erasing all previous content of the map. More...
 
bool insertObservation (const CObservation *obs, const CPose3D *robotPose=NULL)
 Insert the observation information into this map. More...
 
bool insertObservationPtr (const CObservationPtr &obs, const CPose3D *robotPose=NULL)
 A wrapper for smart pointers, just calls the non-smart pointer version. More...
 
virtual bool canComputeObservationLikelihood (const CObservation *obs)
 Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. More...
 
bool canComputeObservationLikelihood (const CObservationPtr &obs)
 
double computeObservationsLikelihood (const CSensoryFrame &sf, const CPose2D &takenFrom)
 Returns the sum of the log-likelihoods of each individual observation within a mrpt::slam::CSensoryFrame. More...
 
bool canComputeObservationsLikelihood (const CSensoryFrame &sf)
 Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. More...
 
void computeMatchingWith2D (const CMetricMap *otherMap, const CPose2D &otherMapPose, float maxDistForCorrespondence, float maxAngularDistForCorrespondence, const CPose2D &angularDistPivotPoint, TMatchingPairList &correspondences, float &correspondencesRatio, float *sumSqrDist=NULL, bool onlyKeepTheClosest=true, bool onlyUniqueRobust=false, const size_t decimation_other_map_points=1, const size_t offset_other_map_points=0) const MRPT_DEPRECATED_POST("Deprecated")
 DEPRECATED: Use alternative version determineMatching2D with struct parameters instead. More...
 
void computeMatchingWith3D (const CMetricMap *otherMap, const CPose3D &otherMapPose, float maxDistForCorrespondence, float maxAngularDistForCorrespondence, const CPoint3D &angularDistPivotPoint, TMatchingPairList &correspondences, float &correspondencesRatio, float *sumSqrDist=NULL, bool onlyKeepTheClosest=true, bool onlyUniqueRobust=false, const size_t decimation_other_map_points=1, const size_t offset_other_map_points=0) const MRPT_DEPRECATED_POST("Deprecated")
 DEPRECATED: Use alternative version determineMatching3D with struct parameters instead. More...
 
virtual void auxParticleFilterCleanUp ()
 This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation". More...
 
mrpt::utils::CObjectPtr duplicateGetSmartPtr () const
 Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer). More...
 
CObjectclone () const
 Cloning interface for smart pointers. More...
 
bool loadFromPlyFile (const std::string &filename, CStringList *file_comments=NULL, CStringList *file_obj_info=NULL)
 Loads from a PLY file. More...
 
std::string getLoadPLYErrorString () const
 Return a description of the error if loadFromPlyFile() returned false, or an empty string if the file was loaded without problems. More...
 
bool saveToPlyFile (const std::string &filename, bool save_in_binary=false, const CStringList &file_comments=CStringList(), const CStringList &file_obj_info=CStringList()) const
 Saves to a PLY file. More...
 
std::string getSavePLYErrorString () const
 Return a description of the error if loadFromPlyFile() returned false, or an empty string if the file was loaded without problems. More...
 
PCL library support
virtual bool savePCDFile (const std::string &filename, bool save_as_binary) const
 Save the point cloud as a PCL PCD file, in either ASCII or binary format. More...
 
template<class POINTCLOUD >
void setFromPCLPointCloudRGB (const POINTCLOUD &cloud)
 Loads a PCL point cloud (WITH RGB information) into this MRPT class (for clouds without RGB data, see CPointsMap::setFromPCLPointCloud() ). More...
 
File input/output methods
bool load2D_from_text_file (const std::string &file)
 Load from a text file. More...
 
bool load3D_from_text_file (const std::string &file)
 Load from a text file. More...
 
bool load2Dor3D_from_text_file (const std::string &file, const bool is_3D)
 2D or 3D generic implementation of load2D_from_text_file and load3D_from_text_file More...
 
bool save2D_to_text_file (const std::string &file) const
 Save to a text file. More...
 
bool save3D_to_text_file (const std::string &file) const
 Save to a text file. More...
 
void saveMetricMapRepresentationToFile (const std::string &filNamePrefix) const
 This virtual method saves the map to a file "filNamePrefix"+< some_file_extension >, as an image or in any other applicable way (Notice that other methods to save the map may be implemented in classes implementing this virtual interface). More...
 
virtual bool loadPCDFile (const std::string &filename)
 Load the point cloud from a PCL PCD file (requires MRPT built against PCL) More...
 
virtual bool saveLASFile (const std::string &filename, const LAS_WriteParams &params=LAS_WriteParams()) const
 Save the point cloud as an ASPRS LAS binary file (requires MRPT built against liblas). More...
 
virtual bool loadLASFile (const std::string &filename, LAS_HeaderInfo &out_headerInfo, const LAS_LoadParams &params=LAS_LoadParams())
 Load the point cloud from an ASPRS LAS binary file (requires MRPT built against liblas). More...
 
Filter-by-height stuff
void enableFilterByHeight (bool enable=true)
 Enable/disable the filter-by-height functionality. More...
 
bool isFilterByHeightEnabled () const
 Return whether filter-by-height is enabled. More...
 
void setHeightFilterLevels (const double _z_min, const double _z_max)
 Set the min/max Z levels for points to be actually inserted in the map (only if enableFilterByHeight() was called before). More...
 
void getHeightFilterLevels (double &_z_min, double &_z_max) const
 Get the min/max Z levels for points to be actually inserted in the map. More...
 
PCL library support
template<class POINTCLOUD >
void getPCLPointCloud (POINTCLOUD &cloud) const
 Use to convert this MRPT point cloud object into a PCL point cloud object. More...
 
template<class POINTCLOUD >
void setFromPCLPointCloud (const POINTCLOUD &cloud)
 Loads a PCL point cloud into this MRPT class (note: this method ignores potential RGB information, see CColouredPointsMap::setFromPCLPointCloudRGB() ). More...
 
Methods that MUST be implemented by children classes of KDTreeCapable
size_t kdtree_get_point_count () const
 Must return the number of data points. More...
 
float kdtree_get_pt (const size_t idx, int dim) const
 Returns the dim'th component of the idx'th point in the class: More...
 
float kdtree_distance (const float *p1, const size_t idx_p2, size_t size) const
 Returns the distance between the vector "p1[0:size-1]" and the data point with index "idx_p2" stored in the class: More...
 
template<typename BBOX >
bool kdtree_get_bbox (BBOX &bb) const
 

Public Attributes

TColourOptions colorScheme
 The options employed when inserting laser scans in the map. More...
 
TInsertionOptions insertionOptions
 The options used when inserting observations in the map. More...
 
TLikelihoodOptions likelihoodOptions
 
bool m_disableSaveAs3DObject
 When set to true (default=false), calling "getAs3DObject" will have no effects. More...
 

Static Public Attributes

static float COLOR_3DSCENE_R
 The color [0,1] of points when extracted from getAs3DObject (default=blue) More...
 
static float COLOR_3DSCENE_G
 
static float COLOR_3DSCENE_B
 
static const mrpt::utils::TRuntimeClassId classCObject
 
RTTI stuff
static const mrpt::utils::TRuntimeClassId classCPointsMap
 
RTTI stuff
static const mrpt::utils::TRuntimeClassId classCMetricMap
 
RTTI stuff
static const mrpt::utils::TRuntimeClassId classCSerializable
 

Protected Member Functions

virtual void internal_clear ()
 Minimum distance from where the points have been seen. More...
 
void mark_as_modified () const
 Called only by this class or children classes, set m_largestDistanceFromOriginIsUpdated=false and such. More...
 
bool internal_insertObservation (const CObservation *obs, const CPose3D *robotPose)
 This is a common version of CMetricMap::insertObservation() for point maps (actually, CMetricMap::internal_insertObservation), so derived classes don't need to worry implementing that method unless something special is really necesary. More...
 
void base_copyFrom (const CPointsMap &obj)
 Helper method for ::copyFrom() More...
 
void publishEvent (const mrptEvent &e) const
 Called when you want this object to emit an event to all the observers currently subscribed to this object. More...
 
bool hasSubscribers () const
 Can be called by a derived class before preparing an event for publishing with publishEvent to determine if there is no one subscribed, so it can save the wasted time preparing an event that will be not read. More...
 
CSerializable virtual methods
void writeToStream (mrpt::utils::CStream &out, int *getVersion) const
 Introduces a pure virtual method responsible for writing to a CStream. More...
 
void readFromStream (mrpt::utils::CStream &in, int version)
 Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori. More...
 
Redefinition of PLY Import virtual methods from CPointsMap
virtual void PLY_import_set_vertex (const size_t idx, const mrpt::math::TPoint3Df &pt, const mrpt::utils::TColorf *pt_color=NULL)
 In a base class, will be called after PLY_import_set_vertex_count() once for each loaded point. More...
 
virtual void PLY_import_set_vertex_count (const size_t N)
 In a base class, reserve memory to prepare subsequent calls to PLY_import_set_vertex. More...
 
Redefinition of PLY Export virtual methods from CPointsMap
virtual void PLY_export_get_vertex (const size_t idx, mrpt::math::TPoint3Df &pt, bool &pt_has_color, mrpt::utils::TColorf &pt_color) const
 In a base class, will be called after PLY_export_get_vertex_count() once for each exported point. More...
 
PLY Import virtual methods to implement in base classes
virtual void PLY_import_set_face_count (const size_t N)
 In a base class, reserve memory to prepare subsequent calls to PLY_import_set_face. More...
 
PLY Export virtual methods to implement in base classes
virtual size_t PLY_export_get_vertex_count () const
 In a base class, return the number of vertices. More...
 
virtual size_t PLY_export_get_face_count () const
 In a base class, return the number of faces. More...
 

Protected Attributes

std::vector< float > m_color_R
 The color data. More...
 
std::vector< float > m_color_G
 
std::vector< float > m_color_B
 
std::vector< float > x
 
std::vector< float > y
 
std::vector< float > z
 The point coordinates. More...
 
CSinCosLookUpTableFor2DScans m_scans_sincos_cache
 Cache of sin/cos values for the latest 2D scan geometries. More...
 
float m_largestDistanceFromOrigin
 Auxiliary variables used in "getLargestDistanceFromOrigin". More...
 
bool m_largestDistanceFromOriginIsUpdated
 Auxiliary variables used in "getLargestDistanceFromOrigin". More...
 
bool m_boundingBoxIsUpdated
 
float m_bb_min_x
 
float m_bb_max_x
 
float m_bb_min_y
 
float m_bb_max_y
 
float m_bb_min_z
 
float m_bb_max_z
 
double m_heightfilter_z_min
 The minimum and maximum height for a certain laser scan to be inserted into this map. More...
 
double m_heightfilter_z_max
 
bool m_heightfilter_enabled
 Whether or not (default=not) filter the input points by height. More...
 

RTTI stuff

typedef CColouredPointsMapPtr SmartPtr
 
static mrpt::utils::CLASSINIT _init_CColouredPointsMap
 
static mrpt::utils::TRuntimeClassId classCColouredPointsMap
 
static const mrpt::utils::TRuntimeClassIdclassinfo
 
static const mrpt::utils::TRuntimeClassId_GetBaseClass ()
 
virtual const mrpt::utils::TRuntimeClassIdGetRuntimeClass () const
 Returns information about the class of an object in runtime. More...
 
virtual mrpt::utils::CObjectduplicate () const
 Returns a copy of the object, indepently of its class. More...
 
static mrpt::utils::CObjectCreateObject ()
 
static CColouredPointsMapPtr Create ()
 

Pure virtual interfaces to be implemented by any class derived from CPointsMap

template<class Derived >
struct detail::loadFromRangeImpl
 
template<class Derived >
struct detail::pointmap_traits
 
virtual void reserve (size_t newLength)
 Reserves memory for a given number of points: the size of the map does not change, it only reserves the memory. More...
 
virtual void resize (size_t newLength)
 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. More...
 
virtual void setSize (size_t newLength)
 Resizes all point buffers so they can hold the given number of points, erasing all previous contents and leaving all points to default values. More...
 
virtual void setPointFast (size_t index, float x, float y, float z)
 Changes the coordinates of the given point (0-based index), without checking for out-of-bounds and without calling mark_as_modified() More...
 
virtual void insertPointFast (float x, float y, float z=0)
 The virtual method for insertPoint() without calling mark_as_modified() More...
 
virtual void copyFrom (const CPointsMap &obj)
 Virtual assignment operator, to be implemented in derived classes. More...
 
virtual void getPointAllFieldsFast (const size_t index, std::vector< float > &point_data) const
 Get all the data fields for one point as a vector: [X Y Z R G B] Unlike getPointAllFields(), this method does not check for index out of bounds. More...
 
virtual void setPointAllFieldsFast (const size_t index, const std::vector< float > &point_data)
 Set all the data fields for one point as a vector: [X Y Z R G B] Unlike setPointAllFields(), this method does not check for index out of bounds. More...
 
virtual void loadFromRangeScan (const CObservation2DRangeScan &rangeScan, const CPose3D *robotPose=NULL)
 See CPointsMap::loadFromRangeScan() More...
 
virtual void loadFromRangeScan (const CObservation3DRangeScan &rangeScan, const CPose3D *robotPose=NULL)
 See CPointsMap::loadFromRangeScan() More...
 
virtual void addFrom_classSpecific (const CPointsMap &anotherMap, const size_t nPreviousPoints)
 Auxiliary method called from within addFrom() automatically, to finish the copying of class-specific data. More...
 

Member Typedef Documentation

◆ SmartPtr

A typedef for the associated smart pointer

Definition at line 39 of file CColouredPointsMap.h.

Member Enumeration Documentation

◆ TColouringMethod

The choices for coloring schemes:

  • cmFromHeightRelativeToSensor: The Z coordinate wrt the sensor will be used to obtain the color using the limits z_min,z_max.
  • cmFromIntensityImage: When inserting 3D range scans, take the color from the intensity image channel, if available.
    See also
    TColourOptions
Enumerator
cmFromHeightRelativeToSensor 
cmFromHeightRelativeToSensorJet 
cmFromHeightRelativeToSensorGray 
cmFromIntensityImage 

Definition at line 224 of file CColouredPointsMap.h.

Constructor & Destructor Documentation

◆ ~CColouredPointsMap()

virtual mrpt::slam::CColouredPointsMap::~CColouredPointsMap ( )
virtual

Destructor.

◆ CColouredPointsMap()

mrpt::slam::CColouredPointsMap::CColouredPointsMap ( )

Default constructor.

Member Function Documentation

◆ _GetBaseClass()

static const mrpt::utils::TRuntimeClassId* mrpt::slam::CColouredPointsMap::_GetBaseClass ( )
staticprotected

◆ addFrom()

virtual void mrpt::slam::CPointsMap::addFrom ( const CPointsMap anotherMap)
virtualinherited

Adds all the points from anotherMap to this map, without fusing.

This operation can be also invoked via the "+=" operator, for example:

CSimplePointsMap m1, m2;
...
m1.addFrom( m2 ); // Add all points of m2 to m1
m1 += m2; // Exactly the same than above
Note
The method in CPointsMap is generic but derived classes may redefine this virtual method to another one more optimized.

◆ addFrom_classSpecific()

virtual void mrpt::slam::CColouredPointsMap::addFrom_classSpecific ( const CPointsMap anotherMap,
const size_t  nPreviousPoints 
)
protectedvirtual

Auxiliary method called from within addFrom() automatically, to finish the copying of class-specific data.

Implements mrpt::slam::CPointsMap.

◆ applyDeletionMask()

void mrpt::slam::CPointsMap::applyDeletionMask ( const std::vector< bool > &  mask)
inherited

Remove from the map the points marked in a bool's array as "true".

Exceptions
std::exceptionIf mask size is not equal to points count.

◆ auxParticleFilterCleanUp()

virtual void mrpt::slam::CMetricMap::auxParticleFilterCleanUp ( )
inlinevirtualinherited

This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation".

This method should normally do nothing, but in some cases can be used to free auxiliary cached variables.

Reimplemented in mrpt::slam::CLandmarksMap, and mrpt::slam::CMultiMetricMap.

Definition at line 362 of file CMetricMap.h.

◆ base_copyFrom()

void mrpt::slam::CPointsMap::base_copyFrom ( const CPointsMap obj)
protectedinherited

Helper method for ::copyFrom()

◆ boundingBox() [1/2]

void mrpt::slam::CPointsMap::boundingBox ( float &  min_x,
float &  max_x,
float &  min_y,
float &  max_y,
float &  min_z,
float &  max_z 
) const
inherited

Computes the bounding box of all the points, or (0,0 ,0,0, 0,0) if there are no points.

Results are cached unless the map is somehow modified to avoid repeated calculations.

◆ boundingBox() [2/2]

void mrpt::slam::CPointsMap::boundingBox ( TPoint3D pMin,
TPoint3D pMax 
) const
inlineinherited

◆ canComputeObservationLikelihood() [1/2]

virtual bool mrpt::slam::CMetricMap::canComputeObservationLikelihood ( const CObservation obs)
inlinevirtualinherited

Returns true if this map is able to compute a sensible likelihood function for this observation (i.e.

an occupancy grid map cannot with an image).

Parameters
obsThe observation.
See also
computeObservationLikelihood

Reimplemented in mrpt::slam::COccupancyGridMap2D, and mrpt::slam::CMultiMetricMap.

Definition at line 198 of file CMetricMap.h.

◆ canComputeObservationLikelihood() [2/2]

bool mrpt::slam::CMetricMap::canComputeObservationLikelihood ( const CObservationPtr obs)
inlineinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 204 of file CMetricMap.h.

References mrpt::slam::CMetricMap::canComputeObservationLikelihood(), and mrpt::slam::CObservationPtr::pointer().

Referenced by mrpt::slam::CMetricMap::canComputeObservationLikelihood().

◆ canComputeObservationsLikelihood()

bool mrpt::slam::CMetricMap::canComputeObservationsLikelihood ( const CSensoryFrame sf)
inherited

Returns true if this map is able to compute a sensible likelihood function for this observation (i.e.

an occupancy grid map cannot with an image).

Parameters
sfThe observations.
See also
canComputeObservationLikelihood

◆ changeCoordinatesReference() [1/3]

void mrpt::slam::CPointsMap::changeCoordinatesReference ( const CPose2D b)
inherited

Replace each point $ p_i $ by $ p'_i = b \oplus p_i $ (pose compounding operator).

◆ changeCoordinatesReference() [2/3]

void mrpt::slam::CPointsMap::changeCoordinatesReference ( const CPose3D b)
inherited

Replace each point $ p_i $ by $ p'_i = b \oplus p_i $ (pose compounding operator).

◆ changeCoordinatesReference() [3/3]

void mrpt::slam::CPointsMap::changeCoordinatesReference ( const CPointsMap other,
const CPose3D b 
)
inherited

Copy all the points from "other" map to "this", replacing each point $ p_i $ by $ p'_i = b \oplus p_i $ (pose compounding operator).

◆ clear()

void mrpt::slam::CMetricMap::clear ( )
inherited

◆ clipOutOfRange()

void mrpt::slam::CPointsMap::clipOutOfRange ( const CPoint2D point,
float  maxRange 
)
inherited

Delete points which are more far than "maxRange" away from the given "point".

◆ clipOutOfRangeInZ()

void mrpt::slam::CPointsMap::clipOutOfRangeInZ ( float  zMin,
float  zMax 
)
inherited

Delete points out of the given "z" axis range have been removed.

◆ clone()

CObject* mrpt::utils::CObject::clone ( ) const
inlineinherited

Cloning interface for smart pointers.

Definition at line 135 of file CObject.h.

◆ colourFromObservation()

bool mrpt::slam::CColouredPointsMap::colourFromObservation ( const CObservationImage obs,
const CPose3D robotPose 
)

Colour a set of points from a CObservationImage and the global pose of the robot.

◆ compute3DDistanceToMesh()

void mrpt::slam::CPointsMap::compute3DDistanceToMesh ( const CMetricMap otherMap2,
const CPose3D otherMapPose,
float  maxDistForCorrespondence,
TMatchingPairList correspondences,
float &  correspondencesRatio 
)
inherited

Computes the matchings between this and another 3D points map.

This method matches each point in the other map with the centroid of the 3 closest points in 3D from this map (if the distance is below a defined threshold).

Parameters
otherMap[IN] The other map to compute the matching with.
otherMapPose[IN] The pose of the other map as seen from "this".
maxDistForCorrespondence[IN] Maximum 2D linear distance between two points to be matched.
correspondences[OUT] The detected matchings pairs.
correspondencesRatio[OUT] The ratio [0,1] of points in otherMap with at least one correspondence.
See also
determineMatching3D

◆ compute3DMatchingRatio()

float mrpt::slam::CPointsMap::compute3DMatchingRatio ( const CMetricMap otherMap,
const CPose3D otherMapPose,
float  maxDistForCorr = 0.10f,
float  maxMahaDistForCorr = 2.0f 
) const
virtualinherited

Computes the ratio in [0,1] of correspondences between "this" and the "otherMap" map, whose 6D pose relative to "this" is "otherMapPose" In the case of a multi-metric map, this returns the average between the maps.

This method always return 0 for grid maps.

Parameters
otherMap[IN] The other map to compute the matching with.
otherMapPose[IN] The 6D pose of the other map as seen from "this".
maxDistForCorr[IN] The minimum distance between 2 non-probabilistic map elements for counting them as a correspondence.
maxMahaDistForCorr[IN] The minimum Mahalanobis distance between 2 probabilistic map elements for counting them as a correspondence.
Returns
The matching ratio [0,1]
See also
determineMatching2D

Reimplemented from mrpt::slam::CMetricMap.

◆ computeMatchingWith2D()

void mrpt::slam::CMetricMap::computeMatchingWith2D ( const CMetricMap otherMap,
const CPose2D otherMapPose,
float  maxDistForCorrespondence,
float  maxAngularDistForCorrespondence,
const CPose2D angularDistPivotPoint,
TMatchingPairList correspondences,
float &  correspondencesRatio,
float *  sumSqrDist = NULL,
bool  onlyKeepTheClosest = true,
bool  onlyUniqueRobust = false,
const size_t  decimation_other_map_points = 1,
const size_t  offset_other_map_points = 0 
) const
inherited

DEPRECATED: Use alternative version determineMatching2D with struct parameters instead.

◆ computeMatchingWith3D()

void mrpt::slam::CMetricMap::computeMatchingWith3D ( const CMetricMap otherMap,
const CPose3D otherMapPose,
float  maxDistForCorrespondence,
float  maxAngularDistForCorrespondence,
const CPoint3D angularDistPivotPoint,
TMatchingPairList correspondences,
float &  correspondencesRatio,
float *  sumSqrDist = NULL,
bool  onlyKeepTheClosest = true,
bool  onlyUniqueRobust = false,
const size_t  decimation_other_map_points = 1,
const size_t  offset_other_map_points = 0 
) const
inherited

DEPRECATED: Use alternative version determineMatching3D with struct parameters instead.

◆ computeObservationLikelihood() [1/2]

double mrpt::slam::CMetricMap::computeObservationLikelihood ( const CObservation obs,
const CPose2D takenFrom 
)
inlineinherited

Computes the log-likelihood of a given observation given an arbitrary robot 2D pose.

Parameters
takenFromThe robot's pose the observation is supposed to be taken from.
obsThe observation.
Returns
This method returns a log-likelihood.
See also
Used in particle filter algorithms, see: CMultiMetricMapPDF::update

Definition at line 189 of file CMetricMap.h.

◆ computeObservationLikelihood() [2/2]

virtual double mrpt::slam::CPointsMap::computeObservationLikelihood ( const CObservation obs,
const CPose3D takenFrom 
)
virtualinherited

Computes the log-likelihood of a given observation given an arbitrary robot 3D pose.

Parameters
takenFromThe robot's pose the observation is supposed to be taken from.
obsThe observation.
Returns
This method returns a log-likelihood.
See also
Used in particle filter algorithms, see: CMultiMetricMapPDF::update

Implements mrpt::slam::CMetricMap.

◆ computeObservationsLikelihood()

double mrpt::slam::CMetricMap::computeObservationsLikelihood ( const CSensoryFrame sf,
const CPose2D takenFrom 
)
inherited

Returns the sum of the log-likelihoods of each individual observation within a mrpt::slam::CSensoryFrame.

Parameters
takenFromThe robot's pose the observation is supposed to be taken from.
sfThe set of observations in a CSensoryFrame.
Returns
This method returns a log-likelihood.
See also
canComputeObservationsLikelihood

◆ copyFrom()

virtual void mrpt::slam::CColouredPointsMap::copyFrom ( const CPointsMap obj)
virtual

Virtual assignment operator, to be implemented in derived classes.

Implements mrpt::slam::CPointsMap.

◆ Create()

static CColouredPointsMapPtr mrpt::slam::CColouredPointsMap::Create ( )
static

◆ CreateObject()

static mrpt::utils::CObject* mrpt::slam::CColouredPointsMap::CreateObject ( )
static

◆ determineMatching2D()

virtual void mrpt::slam::CPointsMap::determineMatching2D ( const CMetricMap otherMap,
const CPose2D otherMapPose,
TMatchingPairList correspondences,
const TMatchingParams params,
TMatchingExtraResults extraResults 
) const
virtualinherited

Computes the matching between this and another 2D point map, which includes finding:

  • The set of points pairs in each map
  • The mean squared distance between corresponding pairs.

The algorithm is:

  • For each point in "otherMap":
    • Transform the point according to otherMapPose
    • Search with a KD-TREE the closest correspondences in "this" map.
    • Add to the set of candidate matchings, if it passes all the thresholds in params.

This method is the most time critical one into ICP-like algorithms.

Parameters
otherMap[IN] The other map to compute the matching with.
otherMapPose[IN] The pose of the other map as seen from "this".
params[IN] Parameters for the determination of pairings.
correspondences[OUT] The detected matchings pairs.
extraResults[OUT] Other results.
See also
compute3DMatchingRatio

Reimplemented from mrpt::slam::CMetricMap.

◆ determineMatching3D()

virtual void mrpt::slam::CPointsMap::determineMatching3D ( const CMetricMap otherMap,
const CPose3D otherMapPose,
TMatchingPairList correspondences,
const TMatchingParams params,
TMatchingExtraResults extraResults 
) const
virtualinherited

Computes the matchings between this and another 3D points map - method used in 3D-ICP.

This method finds the set of point pairs in each map.

The method is the most time critical one into ICP-like algorithms.

The algorithm is:

  • For each point in "otherMap":
    • Transform the point according to otherMapPose
    • Search with a KD-TREE the closest correspondences in "this" map.
    • Add to the set of candidate matchings, if it passes all the thresholds in params.
Parameters
otherMap[IN] The other map to compute the matching with.
otherMapPose[IN] The pose of the other map as seen from "this".
params[IN] Parameters for the determination of pairings.
correspondences[OUT] The detected matchings pairs.
extraResults[OUT] Other results.
See also
compute3DMatchingRatio

Reimplemented from mrpt::slam::CMetricMap.

◆ duplicate()

virtual mrpt::utils::CObject* mrpt::slam::CColouredPointsMap::duplicate ( ) const
virtual

Returns a copy of the object, indepently of its class.

Implements mrpt::utils::CObject.

◆ duplicateGetSmartPtr()

mrpt::utils::CObjectPtr mrpt::utils::CObject::duplicateGetSmartPtr ( ) const
inlineinherited

Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer).

Definition at line 132 of file CObject.h.

◆ empty()

bool mrpt::slam::CPointsMap::empty ( ) const
inlineinherited

STL-like method to check whether the map is empty:

Definition at line 636 of file CPointsMap.h.

◆ enableFilterByHeight()

void mrpt::slam::CPointsMap::enableFilterByHeight ( bool  enable = true)
inlineinherited

Enable/disable the filter-by-height functionality.

See also
setHeightFilterLevels
Note
Default upon construction is disabled.

Definition at line 689 of file CPointsMap.h.

◆ extractCylinder()

void mrpt::slam::CPointsMap::extractCylinder ( const CPoint2D center,
const double  radius,
const double  zmin,
const double  zmax,
CPointsMap outMap 
)
inherited

Extracts the points in the map within a cylinder in 3D defined the provided radius and zmin/zmax values.

◆ extractPoints()

void mrpt::slam::CPointsMap::extractPoints ( const TPoint3D corner1,
const TPoint3D corner2,
CPointsMap outMap,
const double &  R = 1,
const double &  G = 1,
const double &  B = 1 
)
inherited

Extracts the points in the map within the area defined by two corners.

The points are coloured according the R,G,B input data.

◆ fuseWith()

void mrpt::slam::CPointsMap::fuseWith ( CPointsMap anotherMap,
float  minDistForFuse = 0.02f,
std::vector< bool > *  notFusedPoints = NULL 
)
inherited

Insert the contents of another map into this one, fusing the previous content with the new one.

This means that points very close to existing ones will be "fused", rather than "added". This prevents the unbounded increase in size of these class of maps. NOTICE that "otherMap" is neither translated nor rotated here, so if this is desired it must done before calling this method.

Parameters
otherMapThe other map whose points are to be inserted into this one.
minDistForFuseMinimum distance (in meters) between two points, each one in a map, to be considered the same one and be fused rather than added.
notFusedPointsIf a pointer is supplied, this list will contain at output a list with a "bool" value per point in "this" map. This will be false/true according to that point having been fused or not.
See also
loadFromRangeScan, addFrom

◆ getAllPoints() [1/4]

template<class VECTOR >
void mrpt::slam::CPointsMap::getAllPoints ( VECTOR &  xs,
VECTOR &  ys,
VECTOR &  zs,
size_t  decimation = 1 
) const
inlineinherited

Returns a copy of the 2D/3D points as a std::vector of float coordinates.

If decimation is greater than 1, only 1 point out of that number will be saved in the output, effectively performing a subsampling of the points.

See also
getPointsBufferRef_x, getPointsBufferRef_y, getPointsBufferRef_z
Template Parameters
VECTORcan be std::vector<float or double> or any row/column Eigen::Array or Eigen::Matrix (this includes mrpt::vector_float and mrpt::vector_double).

Definition at line 417 of file CPointsMap.h.

References ASSERT_, MRPT_END, and MRPT_START.

◆ getAllPoints() [2/4]

void mrpt::slam::CPointsMap::getAllPoints ( std::vector< TPoint3D > &  ps,
size_t  decimation = 1 
) const
inlineinherited

Definition at line 435 of file CPointsMap.h.

◆ getAllPoints() [3/4]

void mrpt::slam::CPointsMap::getAllPoints ( std::vector< float > &  xs,
std::vector< float > &  ys,
size_t  decimation = 1 
) const
inherited

Returns a copy of the 2D/3D points as a std::vector of float coordinates.

If decimation is greater than 1, only 1 point out of that number will be saved in the output, effectively performing a subsampling of the points.

See also
setAllPoints

◆ getAllPoints() [4/4]

void mrpt::slam::CPointsMap::getAllPoints ( std::vector< TPoint2D > &  ps,
size_t  decimation = 1 
) const
inlineinherited

Definition at line 452 of file CPointsMap.h.

◆ getAs3DObject()

virtual void mrpt::slam::CColouredPointsMap::getAs3DObject ( mrpt::opengl::CSetOfObjectsPtr outObj) const
virtual

Override of the default 3D scene builder to account for the individual points' color.

See also
mrpt::global_settings::POINTSMAPS_3DOBJECT_POINTSIZE

Reimplemented from mrpt::slam::CPointsMap.

◆ getAsSimplePointsMap() [1/2]

virtual const CSimplePointsMap* mrpt::slam::CPointsMap::getAsSimplePointsMap ( ) const
inlinevirtualinherited

If the map is a simple points map or it's a multi-metric map that contains EXACTLY one simple points map, return it.

Otherwise, return NULL

Reimplemented from mrpt::slam::CMetricMap.

Reimplemented in mrpt::slam::CSimplePointsMap.

Definition at line 647 of file CPointsMap.h.

◆ getAsSimplePointsMap() [2/2]

virtual CSimplePointsMap* mrpt::slam::CPointsMap::getAsSimplePointsMap ( )
inlinevirtualinherited

Reimplemented from mrpt::slam::CMetricMap.

Reimplemented in mrpt::slam::CSimplePointsMap.

Definition at line 648 of file CPointsMap.h.

◆ getHeightFilterLevels()

void mrpt::slam::CPointsMap::getHeightFilterLevels ( double &  _z_min,
double &  _z_max 
) const
inlineinherited

Get the min/max Z levels for points to be actually inserted in the map.

See also
enableFilterByHeight, setHeightFilterLevels

Definition at line 696 of file CPointsMap.h.

◆ getLargestDistanceFromOrigin()

float mrpt::slam::CPointsMap::getLargestDistanceFromOrigin ( ) const
inherited

This method returns the largest distance from the origin to any of the points, such as a sphere centered at the origin with this radius cover ALL the points in the map (the results are buffered, such as, if the map is not modified, the second call will be much faster than the first one).

◆ getLargestDistanceFromOriginNoRecompute()

float mrpt::slam::CPointsMap::getLargestDistanceFromOriginNoRecompute ( bool &  output_is_valid) const
inlineinherited

Like getLargestDistanceFromOrigin() but returns in output_is_valid = false if the distance was not already computed, skipping its computation then, unlike getLargestDistanceFromOrigin()

Definition at line 655 of file CPointsMap.h.

◆ getLoadPLYErrorString()

std::string mrpt::utils::PLY_Importer::getLoadPLYErrorString ( ) const
inlineinherited

Return a description of the error if loadFromPlyFile() returned false, or an empty string if the file was loaded without problems.

Definition at line 41 of file PLY_import_export.h.

◆ getPCLPointCloud()

template<class POINTCLOUD >
void mrpt::slam::CPointsMap::getPCLPointCloud ( POINTCLOUD &  cloud) const
inlineinherited

Use to convert this MRPT point cloud object into a PCL point cloud object.

Usage example:

mrpt::slam::CPointsCloud pc;
pcl::PointCloud<pcl::PointXYZ> cloud;
pc.getPCLPointCloud(cloud);
See also
setFromPCLPointCloud

Definition at line 724 of file CPointsMap.h.

References mrpt::math::size().

◆ getPoint() [1/9]

virtual void mrpt::slam::CColouredPointsMap::getPoint ( size_t  index,
float &  x,
float &  y,
float &  z,
float &  R,
float &  G,
float &  B 
) const
virtual

Retrieves a point and its color (colors range is [0,1])

Reimplemented from mrpt::slam::CPointsMap.

Referenced by mrpt::utils::PointCloudAdapter< mrpt::slam::CColouredPointsMap >::getPointXYZ_RGBf().

◆ getPoint() [2/9]

unsigned long mrpt::slam::CColouredPointsMap::getPoint ( size_t  index,
float &  x,
float &  y,
float &  z 
) const

Retrieves a point.

◆ getPoint() [3/9]

unsigned long mrpt::slam::CPointsMap::getPoint ( size_t  index,
float &  x,
float &  y 
) const
inherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ getPoint() [4/9]

unsigned long mrpt::slam::CPointsMap::getPoint ( size_t  index,
double &  x,
double &  y,
double &  z 
) const
inherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ getPoint() [5/9]

unsigned long mrpt::slam::CPointsMap::getPoint ( size_t  index,
double &  x,
double &  y 
) const
inherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ getPoint() [6/9]

unsigned long mrpt::slam::CPointsMap::getPoint ( size_t  index,
CPoint2D p 
) const
inlineinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 352 of file CPointsMap.h.

References mrpt::slam::CPointsMap::getPoint(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::x(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::y().

Referenced by mrpt::slam::CPointsMap::getPoint().

◆ getPoint() [7/9]

unsigned long mrpt::slam::CPointsMap::getPoint ( size_t  index,
CPoint3D p 
) const
inlineinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 354 of file CPointsMap.h.

References mrpt::slam::CPointsMap::getPoint(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::x(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::y().

Referenced by mrpt::slam::CPointsMap::getPoint().

◆ getPoint() [8/9]

unsigned long mrpt::slam::CPointsMap::getPoint ( size_t  index,
mrpt::math::TPoint2D p 
) const
inlineinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 356 of file CPointsMap.h.

References mrpt::slam::CPointsMap::getPoint(), mrpt::math::TPoint2D::x, and mrpt::math::TPoint2D::y.

Referenced by mrpt::slam::CPointsMap::getPoint().

◆ getPoint() [9/9]

unsigned long mrpt::slam::CPointsMap::getPoint ( size_t  index,
mrpt::math::TPoint3D p 
) const
inlineinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 358 of file CPointsMap.h.

References mrpt::slam::CPointsMap::getPoint(), mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.

Referenced by mrpt::slam::CPointsMap::getPoint().

◆ getPointAllFields()

void mrpt::slam::CPointsMap::getPointAllFields ( const size_t  index,
std::vector< float > &  point_data 
) const
inlineinherited

Get all the data fields for one point as a vector: depending on the implementation class this can be [X Y Z] or [X Y Z R G B], etc...

See also
getPointAllFieldsFast, setPointAllFields, setPointAllFieldsFast

Definition at line 502 of file CPointsMap.h.

References ASSERT_BELOW_, and mrpt::math::size().

◆ getPointAllFieldsFast()

virtual void mrpt::slam::CColouredPointsMap::getPointAllFieldsFast ( const size_t  index,
std::vector< float > &  point_data 
) const
inlinevirtual

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

See also
getPointAllFields, setPointAllFields, setPointAllFieldsFast

Implements mrpt::slam::CPointsMap.

Definition at line 91 of file CColouredPointsMap.h.

◆ getPointColor()

void mrpt::slam::CColouredPointsMap::getPointColor ( size_t  index,
float &  R,
float &  G,
float &  B 
) const

Retrieves a point color (colors range is [0,1])

◆ getPointColor_fast()

void mrpt::slam::CColouredPointsMap::getPointColor_fast ( size_t  index,
float &  R,
float &  G,
float &  B 
) const
inline

Like getPointColor but without checking for out-of-index erors.

Definition at line 200 of file CColouredPointsMap.h.

Referenced by mrpt::stlplus::smart_ptr_base< vector_byte, constructor_copy< vector_byte >, mrpt::synch::CAtomicCounter >::handle().

◆ getPointFast()

void mrpt::slam::CPointsMap::getPointFast ( size_t  index,
float &  x,
float &  y,
float &  z 
) const
inlineinherited

◆ getPointsBuffer()

void mrpt::slam::CPointsMap::getPointsBuffer ( size_t &  outPointsCount,
const float *&  xs,
const float *&  ys,
const float *&  zs 
) const
inherited

Provides a direct access to points buffer, or NULL if there is no points in the map.

Referenced by mrpt::slam::COctoMapBase< octomap::OcTree, octomap::OcTreeNode >::insertPointCloud().

◆ getPointsBufferRef_x()

const std::vector<float>& mrpt::slam::CPointsMap::getPointsBufferRef_x ( ) const
inlineinherited

Provides a direct access to a read-only reference of the internal point buffer.

See also
getAllPoints

Definition at line 405 of file CPointsMap.h.

◆ getPointsBufferRef_y()

const std::vector<float>& mrpt::slam::CPointsMap::getPointsBufferRef_y ( ) const
inlineinherited

Provides a direct access to a read-only reference of the internal point buffer.

See also
getAllPoints

Definition at line 407 of file CPointsMap.h.

◆ getPointsBufferRef_z()

const std::vector<float>& mrpt::slam::CPointsMap::getPointsBufferRef_z ( ) const
inlineinherited

Provides a direct access to a read-only reference of the internal point buffer.

See also
getAllPoints

Definition at line 409 of file CPointsMap.h.

◆ getPointsCount()

size_t mrpt::slam::CPointsMap::getPointsCount ( ) const
inlineinherited

Returns the number of stored points in the map (DEPRECATED, use "size()" instead better)

Definition at line 337 of file CPointsMap.h.

References mrpt::math::size().

◆ getPointWeight()

virtual unsigned int mrpt::slam::CPointsMap::getPointWeight ( size_t  index) const
inlinevirtualinherited

Gets the point weight, which is ignored in all classes (defaults to 1) but in those which actually store that field (Note: No checks are done for out-of-bounds index).

See also
setPointWeight

Reimplemented in mrpt::slam::CWeightedPointsMap.

Definition at line 397 of file CPointsMap.h.

◆ GetRuntimeClass()

virtual const mrpt::utils::TRuntimeClassId* mrpt::slam::CColouredPointsMap::GetRuntimeClass ( ) const
virtual

Returns information about the class of an object in runtime.

Reimplemented from mrpt::slam::CPointsMap.

◆ getSavePLYErrorString()

std::string mrpt::utils::PLY_Exporter::getSavePLYErrorString ( ) const
inlineinherited

Return a description of the error if loadFromPlyFile() returned false, or an empty string if the file was loaded without problems.

Definition at line 87 of file PLY_import_export.h.

◆ hasColorPoints()

virtual bool mrpt::slam::CColouredPointsMap::hasColorPoints ( ) const
inlinevirtual

Returns true if the point map has a color field for each point.

Reimplemented from mrpt::slam::CPointsMap.

Definition at line 208 of file CColouredPointsMap.h.

◆ hasSubscribers()

bool mrpt::utils::CObservable::hasSubscribers ( ) const
inlineprotectedinherited

Can be called by a derived class before preparing an event for publishing with publishEvent to determine if there is no one subscribed, so it can save the wasted time preparing an event that will be not read.

Definition at line 50 of file CObservable.h.

◆ insertAnotherMap()

void mrpt::slam::CPointsMap::insertAnotherMap ( const CPointsMap otherMap,
const CPose3D otherPose 
)
inherited

Insert the contents of another map into this one with some geometric transformation, without fusing close points.

Parameters
otherMapThe other map whose points are to be inserted into this one.
otherPoseThe pose of the other map in the coordinates of THIS map
See also
fuseWith, addFrom

◆ insertObservation()

bool mrpt::slam::CMetricMap::insertObservation ( const CObservation obs,
const CPose3D robotPose = NULL 
)
inlineinherited

Insert the observation information into this map.

This method must be implemented in derived classes.

Parameters
obsThe observation
robotPoseThe 3D pose of the robot mobile base in the map reference system, or NULL (default) if you want to use the origin.
See also
CObservation::insertObservationInto

Definition at line 147 of file CMetricMap.h.

◆ insertObservationPtr()

bool mrpt::slam::CMetricMap::insertObservationPtr ( const CObservationPtr obs,
const CPose3D robotPose = NULL 
)
inlineinherited

A wrapper for smart pointers, just calls the non-smart pointer version.

Definition at line 161 of file CMetricMap.h.

References MRPT_END, MRPT_START, mrpt::slam::CObservationPtr::pointer(), mrpt::stlplus::smart_ptr_base< T, C, COUNTER >::present(), and THROW_EXCEPTION.

◆ insertPoint() [1/4]

virtual void mrpt::slam::CColouredPointsMap::insertPoint ( float  x,
float  y,
float  z,
float  R,
float  G,
float  B 
)
virtual

Adds a new point given its coordinates and color (colors range is [0,1])

Reimplemented from mrpt::slam::CPointsMap.

◆ insertPoint() [2/4]

void mrpt::slam::CColouredPointsMap::insertPoint ( const CPoint3D p)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 170 of file CColouredPointsMap.h.

◆ insertPoint() [3/4]

void mrpt::slam::CColouredPointsMap::insertPoint ( const mrpt::math::TPoint3D p)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 172 of file CColouredPointsMap.h.

References insertPoint(), mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.

Referenced by insertPoint().

◆ insertPoint() [4/4]

void mrpt::slam::CColouredPointsMap::insertPoint ( float  x,
float  y,
float  z 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 174 of file CColouredPointsMap.h.

◆ insertPointFast()

virtual void mrpt::slam::CColouredPointsMap::insertPointFast ( float  x,
float  y,
float  z = 0 
)
virtual

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

Implements mrpt::slam::CPointsMap.

◆ internal_clear()

virtual void mrpt::slam::CColouredPointsMap::internal_clear ( )
protectedvirtual

Minimum distance from where the points have been seen.

Clear the map, erasing all the points.

Implements mrpt::slam::CMetricMap.

◆ internal_insertObservation()

bool mrpt::slam::CPointsMap::internal_insertObservation ( const CObservation obs,
const CPose3D robotPose 
)
protectedvirtualinherited

This is a common version of CMetricMap::insertObservation() for point maps (actually, CMetricMap::internal_insertObservation), so derived classes don't need to worry implementing that method unless something special is really necesary.

See mrpt::slam::CPointsMap for the enumeration of types of observations which are accepted.

Implements mrpt::slam::CMetricMap.

◆ isEmpty()

virtual bool mrpt::slam::CPointsMap::isEmpty ( ) const
virtualinherited

Returns true if the map is empty/no observation has been inserted.

Implements mrpt::slam::CMetricMap.

◆ isFilterByHeightEnabled()

bool mrpt::slam::CPointsMap::isFilterByHeightEnabled ( ) const
inlineinherited

Return whether filter-by-height is enabled.

See also
enableFilterByHeight

Definition at line 691 of file CPointsMap.h.

◆ kdtree_distance()

float mrpt::slam::CPointsMap::kdtree_distance ( const float *  p1,
const size_t  idx_p2,
size_t  size 
) const
inlineinherited

Returns the distance between the vector "p1[0:size-1]" and the data point with index "idx_p2" stored in the class:

Definition at line 775 of file CPointsMap.h.

References mrpt::math::size().

◆ kdtree_get_bbox()

template<typename BBOX >
bool mrpt::slam::CPointsMap::kdtree_get_bbox ( BBOX &  bb) const
inlineinherited

Definition at line 796 of file CPointsMap.h.

◆ kdtree_get_point_count()

size_t mrpt::slam::CPointsMap::kdtree_get_point_count ( ) const
inlineinherited

Must return the number of data points.

Definition at line 765 of file CPointsMap.h.

References mrpt::math::size().

◆ kdtree_get_pt()

float mrpt::slam::CPointsMap::kdtree_get_pt ( const size_t  idx,
int  dim 
) const
inlineinherited

Returns the dim'th component of the idx'th point in the class:

Definition at line 768 of file CPointsMap.h.

◆ load2D_from_text_file()

bool mrpt::slam::CPointsMap::load2D_from_text_file ( const std::string &  file)
inlineinherited

Load from a text file.

Each line should contain an "X Y" coordinate pair, separated by whitespaces. Returns false if any error occured, true elsewere.

Definition at line 255 of file CPointsMap.h.

◆ load2Dor3D_from_text_file()

bool mrpt::slam::CPointsMap::load2Dor3D_from_text_file ( const std::string &  file,
const bool  is_3D 
)
inherited

2D or 3D generic implementation of load2D_from_text_file and load3D_from_text_file

◆ load3D_from_text_file()

bool mrpt::slam::CPointsMap::load3D_from_text_file ( const std::string &  file)
inlineinherited

Load from a text file.

Each line should contain an "X Y Z" coordinate tuple, separated by whitespaces. Returns false if any error occured, true elsewere.

Definition at line 260 of file CPointsMap.h.

◆ loadFromPlyFile()

bool mrpt::utils::PLY_Importer::loadFromPlyFile ( const std::string &  filename,
CStringList file_comments = NULL,
CStringList file_obj_info = NULL 
)
inherited

Loads from a PLY file.

Parameters
[in]filenameThe filename to open. It can be either in binary or text format.
[out]file_commentsIf provided (!=NULL) the list of comment strings stored in the file will be returned.
[out]file_obj_infoIf provided (!=NULL) the list of "object info" strings stored in the file will be returned.
Returns
false on any error in the file format or reading it. To obtain more details on the error you can call getLoadPLYErrorString()

◆ loadFromProbabilisticPosesAndObservations()

void mrpt::slam::CMetricMap::loadFromProbabilisticPosesAndObservations ( const CSimpleMap Map)
inherited

Load the map contents from a CSimpleMap object, erasing all previous content of the map.

This is automaticed invoking "insertObservation" for each observation at the mean 3D robot pose as given by the "poses::CPosePDF" in the CSimpleMap object.

See also
insertObservation, CSimpleMap
Exceptions
std::exceptionSome internal steps in invoked methods can raise exceptions on invalid parameters, etc...

◆ loadFromRangeScan() [1/2]

virtual void mrpt::slam::CColouredPointsMap::loadFromRangeScan ( const CObservation2DRangeScan rangeScan,
const CPose3D robotPose = NULL 
)
virtual

◆ loadFromRangeScan() [2/2]

virtual void mrpt::slam::CColouredPointsMap::loadFromRangeScan ( const CObservation3DRangeScan rangeScan,
const CPose3D robotPose = NULL 
)
virtual

◆ loadFromSimpleMap()

void mrpt::slam::CMetricMap::loadFromSimpleMap ( const CSimpleMap Map)
inlineinherited

Load the map contents from a CSimpleMap object, erasing all previous content of the map.

This is automaticed invoking "insertObservation" for each observation at the mean 3D robot pose as given by the "poses::CPosePDF" in the CSimpleMap object.

See also
insertObservation, CSimpleMap
Exceptions
std::exceptionSome internal steps in invoked methods can raise exceptions on invalid parameters, etc...

Definition at line 138 of file CMetricMap.h.

◆ loadLASFile()

virtual bool mrpt::slam::CPointsMap::loadLASFile ( const std::string &  filename,
LAS_HeaderInfo out_headerInfo,
const LAS_LoadParams params = LAS_LoadParams() 
)
virtualinherited

Load the point cloud from an ASPRS LAS binary file (requires MRPT built against liblas).

Refer to http://www.liblas.org/

Note
Color (RGB) information will be taken into account if using the derived class mrpt::slam::CColouredPointsMap
Returns
false on any error

◆ loadPCDFile()

virtual bool mrpt::slam::CPointsMap::loadPCDFile ( const std::string &  filename)
virtualinherited

Load the point cloud from a PCL PCD file (requires MRPT built against PCL)

Returns
false on any error

◆ mark_as_modified()

void mrpt::slam::CPointsMap::mark_as_modified ( ) const
inlineprotectedinherited

Called only by this class or children classes, set m_largestDistanceFromOriginIsUpdated=false and such.

Definition at line 832 of file CPointsMap.h.

◆ operator+=()

void mrpt::slam::CPointsMap::operator+= ( const CPointsMap anotherMap)
inlineinherited

This operator is synonymous with addFrom.

See also
addFrom

Definition at line 234 of file CPointsMap.h.

◆ PLY_export_get_face_count()

virtual size_t mrpt::slam::CPointsMap::PLY_export_get_face_count ( ) const
inlineprotectedvirtualinherited

In a base class, return the number of faces.

Implements mrpt::utils::PLY_Exporter.

Definition at line 869 of file CPointsMap.h.

◆ PLY_export_get_vertex()

virtual void mrpt::slam::CColouredPointsMap::PLY_export_get_vertex ( const size_t  idx,
mrpt::math::TPoint3Df pt,
bool &  pt_has_color,
mrpt::utils::TColorf pt_color 
) const
protectedvirtual

In a base class, will be called after PLY_export_get_vertex_count() once for each exported point.

Parameters
pt_colorWill be NULL if the loaded file does not provide color info.

Reimplemented from mrpt::slam::CPointsMap.

◆ PLY_export_get_vertex_count()

virtual size_t mrpt::slam::CPointsMap::PLY_export_get_vertex_count ( ) const
protectedvirtualinherited

In a base class, return the number of vertices.

Implements mrpt::utils::PLY_Exporter.

◆ PLY_import_set_face_count()

virtual void mrpt::slam::CPointsMap::PLY_import_set_face_count ( const size_t  N)
inlineprotectedvirtualinherited

In a base class, reserve memory to prepare subsequent calls to PLY_import_set_face.

Implements mrpt::utils::PLY_Importer.

Definition at line 854 of file CPointsMap.h.

◆ PLY_import_set_vertex()

virtual void mrpt::slam::CColouredPointsMap::PLY_import_set_vertex ( const size_t  idx,
const mrpt::math::TPoint3Df pt,
const mrpt::utils::TColorf pt_color = NULL 
)
protectedvirtual

In a base class, will be called after PLY_import_set_vertex_count() once for each loaded point.

Parameters
pt_colorWill be NULL if the loaded file does not provide color info.

Reimplemented from mrpt::slam::CPointsMap.

◆ PLY_import_set_vertex_count()

virtual void mrpt::slam::CColouredPointsMap::PLY_import_set_vertex_count ( const size_t  N)
protectedvirtual

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

Implements mrpt::utils::PLY_Importer.

◆ publishEvent()

void mrpt::utils::CObservable::publishEvent ( const mrptEvent e) const
protectedinherited

Called when you want this object to emit an event to all the observers currently subscribed to this object.

◆ readFromStream()

void mrpt::slam::CColouredPointsMap::readFromStream ( mrpt::utils::CStream in,
int  version 
)
protectedvirtual

Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori.

Parameters
inThe input binary stream where the object data must read from.
versionThe version of the object stored in the stream: use this version number in your code to know how to read the incoming data.
Exceptions
std::exceptionOn any error, see CStream::ReadBuffer
See also
CStream

Implements mrpt::utils::CSerializable.

◆ reserve()

virtual void mrpt::slam::CColouredPointsMap::reserve ( size_t  newLength)
virtual

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.

Implements mrpt::slam::CPointsMap.

◆ resetPointsMinDist()

void mrpt::slam::CColouredPointsMap::resetPointsMinDist ( float  defValue = 2000.0f)

Reset the minimum-observed-distance buffer for all the points to a predefined value.

◆ resize()

virtual void mrpt::slam::CColouredPointsMap::resize ( size_t  newLength)
virtual

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.

See also
reserve, setPoint, setPointFast, setSize

Implements mrpt::slam::CPointsMap.

Referenced by mrpt::utils::PointCloudAdapter< mrpt::slam::CColouredPointsMap >::resize().

◆ save2D_to_text_file()

bool mrpt::slam::CPointsMap::save2D_to_text_file ( const std::string &  file) const
inherited

Save to a text file.

Each line will contain "X Y" point coordinates. Returns false if any error occured, true elsewere.

◆ save3D_and_colour_to_text_file()

bool mrpt::slam::CColouredPointsMap::save3D_and_colour_to_text_file ( const std::string &  file) const

Save to a text file.

In each line contains X Y Z (meters) R G B (range [0,1]) for each point in the map. Returns false if any error occured, true elsewere.

◆ save3D_to_text_file()

bool mrpt::slam::CPointsMap::save3D_to_text_file ( const std::string &  file) const
inherited

Save to a text file.

Each line will contain "X Y Z" point coordinates. Returns false if any error occured, true elsewere.

◆ saveLASFile()

virtual bool mrpt::slam::CPointsMap::saveLASFile ( const std::string &  filename,
const LAS_WriteParams params = LAS_WriteParams() 
) const
virtualinherited

Save the point cloud as an ASPRS LAS binary file (requires MRPT built against liblas).

Refer to http://www.liblas.org/

Returns
false on any error

◆ saveMetricMapRepresentationToFile()

void mrpt::slam::CPointsMap::saveMetricMapRepresentationToFile ( const std::string &  filNamePrefix) const
inlinevirtualinherited

This virtual method saves the map to a file "filNamePrefix"+< some_file_extension >, as an image or in any other applicable way (Notice that other methods to save the map may be implemented in classes implementing this virtual interface).

Implements mrpt::slam::CMetricMap.

Definition at line 277 of file CPointsMap.h.

◆ savePCDFile()

virtual bool mrpt::slam::CColouredPointsMap::savePCDFile ( const std::string &  filename,
bool  save_as_binary 
) const
virtual

Save the point cloud as a PCL PCD file, in either ASCII or binary format.

Returns
false on any error

Reimplemented from mrpt::slam::CPointsMap.

◆ saveToPlyFile()

bool mrpt::utils::PLY_Exporter::saveToPlyFile ( const std::string &  filename,
bool  save_in_binary = false,
const CStringList file_comments = CStringList(),
const CStringList file_obj_info = CStringList() 
) const
inherited

Saves to a PLY file.

Parameters
[in]filenameThe filename to be saved.
[in]file_commentsIf provided (!=NULL) the list of comment strings stored in the file will be returned.
[in]file_obj_infoIf provided (!=NULL) the list of "object info" strings stored in the file will be returned.
Returns
false on any error writing the file. To obtain more details on the error you can call getSavePLYErrorString()

◆ setAllPoints() [1/2]

void mrpt::slam::CPointsMap::setAllPoints ( const std::vector< float > &  X,
const std::vector< float > &  Y,
const std::vector< float > &  Z 
)
inlineinherited

Set all the points at once from vectors with X,Y and Z coordinates.

See also
getAllPoints

Definition at line 490 of file CPointsMap.h.

◆ setAllPoints() [2/2]

void mrpt::slam::CPointsMap::setAllPoints ( const std::vector< float > &  X,
const std::vector< float > &  Y 
)
inlineinherited

Set all the points at once from vectors with X and Y coordinates (Z=0).

See also
getAllPoints

Definition at line 495 of file CPointsMap.h.

◆ setAllPointsTemplate()

template<typename VECTOR >
void mrpt::slam::CPointsMap::setAllPointsTemplate ( const VECTOR &  X,
const VECTOR &  Y,
const VECTOR &  Z = VECTOR() 
)
inlineinherited

Set all the points at once from vectors with X,Y and Z coordinates (if Z is not provided, it will be set to all zeros).

Template Parameters
VECTORcan be mrpt::vector_float or std::vector<float> or any other column or row Eigen::Matrix.

Definition at line 477 of file CPointsMap.h.

References ASSERT_, ASSERT_EQUAL_, and setSize().

◆ setFromPCLPointCloud()

template<class POINTCLOUD >
void mrpt::slam::CPointsMap::setFromPCLPointCloud ( const POINTCLOUD &  cloud)
inlineinherited

Loads a PCL point cloud into this MRPT class (note: this method ignores potential RGB information, see CColouredPointsMap::setFromPCLPointCloudRGB() ).

Usage example:

pcl::PointCloud<pcl::PointXYZ> cloud;
mrpt::slam::CPointsCloud pc;
pc.setFromPCLPointCloud(cloud);
See also
getPCLPointCloud, CColouredPointsMap::setFromPCLPointCloudRGB()

Definition at line 750 of file CPointsMap.h.

◆ setFromPCLPointCloudRGB()

template<class POINTCLOUD >
void mrpt::slam::CColouredPointsMap::setFromPCLPointCloudRGB ( const POINTCLOUD &  cloud)
inline

Loads a PCL point cloud (WITH RGB information) into this MRPT class (for clouds without RGB data, see CPointsMap::setFromPCLPointCloud() ).

Usage example:

pcl::PointCloud<pcl::PointXYZRGB> cloud;
See also
CPointsMap::setFromPCLPointCloud()

Definition at line 274 of file CColouredPointsMap.h.

◆ setHeightFilterLevels()

void mrpt::slam::CPointsMap::setHeightFilterLevels ( const double  _z_min,
const double  _z_max 
)
inlineinherited

Set the min/max Z levels for points to be actually inserted in the map (only if enableFilterByHeight() was called before).

Definition at line 694 of file CPointsMap.h.

◆ setPoint() [1/5]

virtual void mrpt::slam::CColouredPointsMap::setPoint ( size_t  index,
float  x,
float  y,
float  z,
float  R,
float  G,
float  B 
)
virtual

Changes a given point from map.

First index is 0.

Exceptions
Throwsstd::exception on index out of bound.

Reimplemented from mrpt::slam::CPointsMap.

Referenced by mrpt::utils::PointCloudAdapter< mrpt::slam::CColouredPointsMap >::setPointXYZ_RGBu8().

◆ setPoint() [2/5]

void mrpt::slam::CColouredPointsMap::setPoint ( size_t  index,
float  x,
float  y,
float  z 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 153 of file CColouredPointsMap.h.

◆ setPoint() [3/5]

void mrpt::slam::CColouredPointsMap::setPoint ( size_t  index,
CPoint2D p 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 159 of file CColouredPointsMap.h.

References setPoint().

Referenced by setPoint().

◆ setPoint() [4/5]

void mrpt::slam::CColouredPointsMap::setPoint ( size_t  index,
CPoint3D p 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 161 of file CColouredPointsMap.h.

References setPoint(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::x(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::y().

Referenced by setPoint().

◆ setPoint() [5/5]

void mrpt::slam::CColouredPointsMap::setPoint ( size_t  index,
float  x,
float  y 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 163 of file CColouredPointsMap.h.

References setPoint().

Referenced by setPoint().

◆ setPointAllFields()

void mrpt::slam::CPointsMap::setPointAllFields ( const size_t  index,
const std::vector< float > &  point_data 
)
inlineinherited

Set all the data fields for one point as a vector: depending on the implementation class this can be [X Y Z] or [X Y Z R G B], etc...

Unlike setPointAllFields(), this method does not check for index out of bounds

See also
setPointAllFields, getPointAllFields, getPointAllFieldsFast

Definition at line 511 of file CPointsMap.h.

References ASSERT_BELOW_, and mrpt::math::size().

◆ setPointAllFieldsFast()

virtual void mrpt::slam::CColouredPointsMap::setPointAllFieldsFast ( const size_t  index,
const std::vector< float > &  point_data 
)
inlinevirtual

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

See also
setPointAllFields, getPointAllFields, getPointAllFieldsFast

Implements mrpt::slam::CPointsMap.

Definition at line 105 of file CColouredPointsMap.h.

◆ setPointColor()

void mrpt::slam::CColouredPointsMap::setPointColor ( size_t  index,
float  R,
float  G,
float  B 
)

Changes just the color of a given point from the map.

First index is 0.

Exceptions
Throwsstd::exception on index out of bound.

◆ setPointColor_fast()

void mrpt::slam::CColouredPointsMap::setPointColor_fast ( size_t  index,
float  R,
float  G,
float  B 
)
inline

Like setPointColor but without checking for out-of-index erors.

Definition at line 182 of file CColouredPointsMap.h.

Referenced by mrpt::utils::PointCloudAdapter< mrpt::slam::CColouredPointsMap >::setPointRGBf().

◆ setPointFast()

virtual void mrpt::slam::CColouredPointsMap::setPointFast ( size_t  index,
float  x,
float  y,
float  z 
)
inlinevirtual

Changes the coordinates of the given point (0-based index), without checking for out-of-bounds and without calling mark_as_modified()

See also
setPoint

Implements mrpt::slam::CPointsMap.

Definition at line 73 of file CColouredPointsMap.h.

Referenced by mrpt::utils::PointCloudAdapter< mrpt::slam::CColouredPointsMap >::setPointXYZ().

◆ setPointWeight()

virtual void mrpt::slam::CPointsMap::setPointWeight ( size_t  index,
unsigned long  w 
)
inlinevirtualinherited

Sets the point weight, which is ignored in all classes but those which actually store that field (Note: No checks are done for out-of-bounds index).

See also
getPointWeight

Reimplemented in mrpt::slam::CWeightedPointsMap.

Definition at line 395 of file CPointsMap.h.

◆ setSize()

virtual void mrpt::slam::CColouredPointsMap::setSize ( size_t  newLength)
virtual

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

See also
reserve, setPoint, setPointFast, setSize

Implements mrpt::slam::CPointsMap.

◆ size()

size_t mrpt::slam::CPointsMap::size ( ) const
inlineinherited

◆ squareDistanceToClosestCorrespondence()

virtual float mrpt::slam::CPointsMap::squareDistanceToClosestCorrespondence ( float  x0,
float  y0 
) const
virtualinherited

Returns the square distance from the 2D point (x0,y0) to the closest correspondence in the map.

Reimplemented from mrpt::slam::CMetricMap.

◆ squareDistanceToClosestCorrespondenceT()

float mrpt::slam::CPointsMap::squareDistanceToClosestCorrespondenceT ( const TPoint2D p0) const
inlineinherited

Definition at line 159 of file CPointsMap.h.

References mrpt::math::TPoint2D::x, and mrpt::math::TPoint2D::y.

◆ writeToStream()

void mrpt::slam::CColouredPointsMap::writeToStream ( mrpt::utils::CStream out,
int *  getVersion 
) const
protectedvirtual

Introduces a pure virtual method responsible for writing to a CStream.

This can not be used directly be users, instead use "stream << object;" for writing it to a stream.

Parameters
outThe output binary stream where object must be dumped.
getVersionIf NULL, the object must be dumped. If not, only the version of the object dump must be returned in this pointer. This enables the versioning of objects dumping and backward compatibility with previously stored data.
Exceptions
std::exceptionOn any error, see CStream::WriteBuffer
See also
CStream

Implements mrpt::utils::CSerializable.

Friends And Related Function Documentation

◆ detail::loadFromRangeImpl

template<class Derived >
friend struct detail::loadFromRangeImpl
friend

Definition at line 132 of file CColouredPointsMap.h.

◆ detail::pointmap_traits

template<class Derived >
friend struct detail::pointmap_traits
friend

Definition at line 133 of file CColouredPointsMap.h.

Member Data Documentation

◆ _init_CColouredPointsMap

mrpt::utils::CLASSINIT mrpt::slam::CColouredPointsMap::_init_CColouredPointsMap
staticprotected

Definition at line 39 of file CColouredPointsMap.h.

◆ classCColouredPointsMap

mrpt::utils::TRuntimeClassId mrpt::slam::CColouredPointsMap::classCColouredPointsMap
static

Definition at line 39 of file CColouredPointsMap.h.

◆ classCMetricMap

const mrpt::utils::TRuntimeClassId mrpt::slam::CMetricMap::classCMetricMap
staticinherited

Definition at line 95 of file CMetricMap.h.

◆ classCObject

const mrpt::utils::TRuntimeClassId mrpt::utils::CObject::classCObject
staticinherited

Definition at line 120 of file CObject.h.

◆ classCPointsMap

const mrpt::utils::TRuntimeClassId mrpt::slam::CPointsMap::classCPointsMap
staticinherited

Definition at line 68 of file CPointsMap.h.

◆ classCSerializable

const mrpt::utils::TRuntimeClassId mrpt::utils::CSerializable::classCSerializable
staticinherited

Definition at line 35 of file CSerializable.h.

◆ classinfo

const mrpt::utils::TRuntimeClassId* mrpt::slam::CColouredPointsMap::classinfo
static

Definition at line 39 of file CColouredPointsMap.h.

◆ COLOR_3DSCENE_B

float mrpt::slam::CPointsMap::COLOR_3DSCENE_B
staticinherited

Definition at line 703 of file CPointsMap.h.

◆ COLOR_3DSCENE_G

float mrpt::slam::CPointsMap::COLOR_3DSCENE_G
staticinherited

Definition at line 702 of file CPointsMap.h.

◆ COLOR_3DSCENE_R

float mrpt::slam::CPointsMap::COLOR_3DSCENE_R
staticinherited

The color [0,1] of points when extracted from getAs3DObject (default=blue)

Definition at line 701 of file CPointsMap.h.

◆ colorScheme

TColourOptions mrpt::slam::CColouredPointsMap::colorScheme

The options employed when inserting laser scans in the map.

Definition at line 253 of file CColouredPointsMap.h.

◆ insertionOptions

TInsertionOptions mrpt::slam::CPointsMap::insertionOptions
inherited

The options used when inserting observations in the map.

Definition at line 190 of file CPointsMap.h.

◆ likelihoodOptions

TLikelihoodOptions mrpt::slam::CPointsMap::likelihoodOptions
inherited

Definition at line 218 of file CPointsMap.h.

◆ m_bb_max_x

float mrpt::slam::CPointsMap::m_bb_max_x
mutableprotectedinherited

Definition at line 828 of file CPointsMap.h.

◆ m_bb_max_y

float mrpt::slam::CPointsMap::m_bb_max_y
mutableprotectedinherited

Definition at line 828 of file CPointsMap.h.

◆ m_bb_max_z

float mrpt::slam::CPointsMap::m_bb_max_z
mutableprotectedinherited

Definition at line 828 of file CPointsMap.h.

◆ m_bb_min_x

float mrpt::slam::CPointsMap::m_bb_min_x
mutableprotectedinherited

Definition at line 828 of file CPointsMap.h.

◆ m_bb_min_y

float mrpt::slam::CPointsMap::m_bb_min_y
mutableprotectedinherited

Definition at line 828 of file CPointsMap.h.

◆ m_bb_min_z

float mrpt::slam::CPointsMap::m_bb_min_z
mutableprotectedinherited

Definition at line 828 of file CPointsMap.h.

◆ m_boundingBoxIsUpdated

bool mrpt::slam::CPointsMap::m_boundingBoxIsUpdated
mutableprotectedinherited

Definition at line 827 of file CPointsMap.h.

◆ m_color_B

std::vector<float> mrpt::slam::CColouredPointsMap::m_color_B
protected

Definition at line 289 of file CColouredPointsMap.h.

◆ m_color_G

std::vector<float> mrpt::slam::CColouredPointsMap::m_color_G
protected

Definition at line 289 of file CColouredPointsMap.h.

◆ m_color_R

std::vector<float> mrpt::slam::CColouredPointsMap::m_color_R
protected

The color data.

Definition at line 289 of file CColouredPointsMap.h.

◆ m_disableSaveAs3DObject

bool mrpt::slam::CMetricMap::m_disableSaveAs3DObject
inherited

When set to true (default=false), calling "getAs3DObject" will have no effects.

Definition at line 357 of file CMetricMap.h.

◆ m_heightfilter_enabled

bool mrpt::slam::CPointsMap::m_heightfilter_enabled
protectedinherited

Whether or not (default=not) filter the input points by height.

See also
m_heightfilter_z_min, m_heightfilter_z_max

Definition at line 888 of file CPointsMap.h.

◆ m_heightfilter_z_max

double mrpt::slam::CPointsMap::m_heightfilter_z_max
protectedinherited

Definition at line 884 of file CPointsMap.h.

◆ m_heightfilter_z_min

double mrpt::slam::CPointsMap::m_heightfilter_z_min
protectedinherited

The minimum and maximum height for a certain laser scan to be inserted into this map.

See also
m_heightfilter_enabled

Definition at line 884 of file CPointsMap.h.

◆ m_largestDistanceFromOrigin

float mrpt::slam::CPointsMap::m_largestDistanceFromOrigin
mutableprotectedinherited

Auxiliary variables used in "getLargestDistanceFromOrigin".

See also
getLargestDistanceFromOrigin

Definition at line 820 of file CPointsMap.h.

◆ m_largestDistanceFromOriginIsUpdated

bool mrpt::slam::CPointsMap::m_largestDistanceFromOriginIsUpdated
mutableprotectedinherited

Auxiliary variables used in "getLargestDistanceFromOrigin".

See also
getLargestDistanceFromOrigin

Definition at line 825 of file CPointsMap.h.

◆ m_scans_sincos_cache

CSinCosLookUpTableFor2DScans mrpt::slam::CPointsMap::m_scans_sincos_cache
protectedinherited

Cache of sin/cos values for the latest 2D scan geometries.

Definition at line 815 of file CPointsMap.h.

◆ x

std::vector<float> mrpt::slam::CPointsMap::x
protectedinherited

Definition at line 813 of file CPointsMap.h.

◆ y

std::vector<float> mrpt::slam::CPointsMap::y
protectedinherited

Definition at line 813 of file CPointsMap.h.

◆ z

std::vector<float> mrpt::slam::CPointsMap::z
protectedinherited

The point coordinates.

Definition at line 813 of file CPointsMap.h.




Page generated by Doxygen 1.8.14 for MRPT 1.1.0 SVN: at lun oct 28 00:54:49 CET 2019 Hosted on:
SourceForge.net Logo