#include <mrpt/slam/CSimplePointsMap.h>
Public Member Functions | |
virtual | ~CSimplePointsMap () |
Destructor. | |
CSimplePointsMap () | |
Default constructor. | |
void | copyFrom (const CPointsMap &obj) |
Copy operator. | |
void | loadFromRangeScan (const CObservation2DRangeScan &rangeScan, const CPose3D *robotPose=NULL) |
Transform the range scan into a set of cartessian coordinated points. | |
bool | load2D_from_text_file (std::string file) |
Load from a text file. | |
bool | load3D_from_text_file (std::string file) |
Load from a text file. | |
void | clear () |
Clear the map, erasing all the points. | |
void | fuseWith (CPointsMap *otherMap, 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. | |
void | insertAnotherMap (CPointsMap *otherMap, CPose2D otherPose) |
Insert the contents of another map into this one, without fusing close points. | |
void | setPoint (const size_t &index, CPoint2D &p) |
Changes a given point from map, as a 2D point. | |
void | setPoint (const size_t &index, CPoint3D &p) |
Changes a given point from map, as a 3D point. | |
void | setPoint (const size_t &index, float x, float y) |
Changes a given point from map. | |
void | setPoint (const size_t &index, float x, float y, float z) |
Changes a given point from map. | |
void | insertPoint (float x, float y, float z=0) |
Provides a way to insert individual points into the map:. | |
void | insertPoint (CPoint3D p) |
Provides a way to insert individual points into the map:. | |
void | applyDeletionMask (std::vector< bool > &mask) |
Remove from the map the points marked in a bool's array as "true". | |
bool | insertObservation (const CObservation *obs, const CPose3D *robotPose=NULL) |
Insert the observation information into this map. | |
double | computeObservationLikelihood (const CObservation *obs, const CPose3D &takenFrom) |
Computes the likelihood that a given observation was taken from a given pose in the world being modeled with this map. | |
void | auxParticleFilterCleanUp () |
This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation". | |
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. |
This class stores the coordinates (x,y,z) and a "weight", or counter of how many times that point has been seen, used only if points fusion is enabled in the options structure.
Definition at line 47 of file CSimplePointsMap.h.
virtual mrpt::slam::CSimplePointsMap::~CSimplePointsMap | ( | ) | [virtual] |
Destructor.
mrpt::slam::CSimplePointsMap::CSimplePointsMap | ( | ) |
Default constructor.
void mrpt::slam::CSimplePointsMap::applyDeletionMask | ( | std::vector< bool > & | mask | ) | [virtual] |
Remove from the map the points marked in a bool's array as "true".
std::exception | If mask size is not equal to points count. |
Implements mrpt::slam::CPointsMap.
void mrpt::slam::CSimplePointsMap::auxParticleFilterCleanUp | ( | ) | [virtual] |
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.
Implements mrpt::slam::CMetricMap.
void mrpt::slam::CSimplePointsMap::clear | ( | ) | [virtual] |
double mrpt::slam::CSimplePointsMap::computeObservationLikelihood | ( | const CObservation * | obs, | |
const CPose3D & | takenFrom | |||
) | [virtual] |
Computes the likelihood that a given observation was taken from a given pose in the world being modeled with this map.
The implementation in this class checks if the points map has an associated gridmap, i.e. I am into a CHibridMetricMap. If this is so, it always return 1.0 therefore the gridmap can return a more appropiate value. If this map is a standalone metric map, it returns the points-matching ratio as the likelihood, using 1.5 times the parameter "minDistBetweenLaserPoints" (from "CPointsMap::insertionOptions") as the matching distance threshold.
takenFrom | The robot's pose the observation is supposed to be taken from. | |
obs | The observation. |
Implements mrpt::slam::CMetricMap.
void mrpt::slam::CSimplePointsMap::copyFrom | ( | const CPointsMap & | obj | ) | [virtual] |
void mrpt::slam::CSimplePointsMap::fuseWith | ( | CPointsMap * | otherMap, | |
float | minDistForFuse = 0.02f , |
|||
std::vector< bool > * | notFusedPoints = NULL | |||
) | [virtual] |
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.
otherMap | The other map whose points are to be inserted into this one. | |
minDistForFuse | Minimum distance (in meters) between two points, each one in a map, to be considered the same one and be fused rather than added. | |
notFusedPoints | If 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. |
Implements mrpt::slam::CPointsMap.
void mrpt::slam::CSimplePointsMap::insertAnotherMap | ( | CPointsMap * | otherMap, | |
CPose2D | otherPose | |||
) |
Insert the contents of another map into this one, without fusing close points.
otherMap | The other map whose points are to be inserted into this one. | |
otherPose | The pose of the other map in the coordinates of THIS map |
bool mrpt::slam::CSimplePointsMap::insertObservation | ( | const CObservation * | obs, | |
const CPose3D * | robotPose = NULL | |||
) | [virtual] |
Insert the observation information into this map.
This method must be implemented in derived classes.
obs | The observation | |
robotPose | The 3D pose of the robot mobile base in the map reference system, or NULL (default) if you want to use CPose2D(0,0,deg) |
Implements mrpt::slam::CMetricMap.
void mrpt::slam::CSimplePointsMap::insertPoint | ( | CPoint3D | p | ) | [virtual] |
void mrpt::slam::CSimplePointsMap::insertPoint | ( | float | x, | |
float | y, | |||
float | z = 0 | |||
) | [virtual] |
bool mrpt::slam::CSimplePointsMap::load2D_from_text_file | ( | std::string | file | ) | [virtual] |
Load from a text file.
In each line there are a point coordinates. Returns false if any error occured, true elsewere.
Implements mrpt::slam::CPointsMap.
bool mrpt::slam::CSimplePointsMap::load3D_from_text_file | ( | std::string | file | ) | [virtual] |
Load from a text file.
In each line there are a point coordinates. Returns false if any error occured, true elsewere.
Implements mrpt::slam::CPointsMap.
void mrpt::slam::CSimplePointsMap::loadFromRangeScan | ( | const CObservation2DRangeScan & | rangeScan, | |
const CPose3D * | robotPose = NULL | |||
) | [virtual] |
Transform the range scan into a set of cartessian coordinated points.
The options in "insertionOptions" are considered in this method.
rangeScan | The scan to be inserted into this map | |
robotPose | The robot 3D pose, default to (0,0,0|0deg,0deg,0deg). It is used to compute the sensor pose relative to the robot actual pose. Recall sensor pose is embeded in the observation class. |
Implements mrpt::slam::CPointsMap.
void mrpt::slam::CSimplePointsMap::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.
void mrpt::slam::CSimplePointsMap::setPoint | ( | const size_t & | index, | |
float | x, | |||
float | y, | |||
float | z | |||
) | [virtual] |
Changes a given point from map.
First index is 0.
Throws | std::exception on index out of bound. |
Implements mrpt::slam::CPointsMap.
void mrpt::slam::CSimplePointsMap::setPoint | ( | const size_t & | index, | |
float | x, | |||
float | y | |||
) | [virtual] |
Changes a given point from map.
First index is 0.
Throws | std::exception on index out of bound. |
Implements mrpt::slam::CPointsMap.
void mrpt::slam::CSimplePointsMap::setPoint | ( | const size_t & | index, | |
CPoint3D & | p | |||
) | [virtual] |
Changes a given point from map, as a 3D point.
First index is 0.
Throws | std::exception on index out of bound. |
Implements mrpt::slam::CPointsMap.
void mrpt::slam::CSimplePointsMap::setPoint | ( | const size_t & | index, | |
CPoint2D & | p | |||
) | [virtual] |
Changes a given point from map, as a 2D point.
First index is 0.
Throws | std::exception on index out of bound. |
Implements mrpt::slam::CPointsMap.
Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN: at Sun Aug 9 21:47:23 CEST 2009 |