This class stores any customizable set of metric maps.
The internal metric maps can be accessed directly by the user. If some kind of map is not desired, it can be just ignored, but if this fact is specified in the "CMultiMetricMap::mapsUsage" member some methods (as the observation insertion) will be more efficient since it will be invoked on desired maps only.
Currently these metric maps are supported for being kept internally::
See CMultiMetricMap::setListOfMaps() for the method for initializing this class, and also see TSetOfMetricMapInitializers::loadFromConfigFile for a template of ".ini"-like configuration file that can be used to define what maps to create and all their parameters.
Definition at line 79 of file CMultiMetricMap.h.
#include <mrpt/slam/CMultiMetricMap.h>

Classes | |
| struct | TOptions |
| Some options for this class: More... | |
Public Types | |
| typedef std::pair< CPoint3D, unsigned int > | TPairIdBeacon |
Public Member Functions | |
| bool | isEmpty () const |
| Returns true if the map is empty/no observation has been inserted. | |
| CMultiMetricMap (const mrpt::slam::TSetOfMetricMapInitializers *initializers=NULL, const TOptions *opts=NULL) | |
| Constructor. | |
| void | setListOfMaps (const mrpt::slam::TSetOfMetricMapInitializers *initializers) |
| Sets the list of internal map according to the passed list of map initializers (Current maps' content will be deleted!) | |
| CMultiMetricMap (const mrpt::slam::CMultiMetricMap &other) | |
| Copy constructor. | |
| mrpt::slam::CMultiMetricMap & | operator= (const mrpt::slam::CMultiMetricMap &other) |
| Copy operator from "other" object. | |
| virtual | ~CMultiMetricMap () |
| Destructor. | |
| 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. | |
| float | getNewStaticPointsRatio (CPointsMap *points, CPose2D &takenFrom) |
| Returns the ratio of points in a map which are new to the point map while falling into yet static cells of gridmap. | |
| void | computeMatchingWith2D (const CMetricMap *otherMap, const CPose2D &otherMapPose, float maxDistForCorrespondence, float maxAngularDistForCorrespondence, const CPose2D &angularDistPivotPoint, TMatchingPairList &correspondences, float &correspondencesRatio, float *sumSqrDist=NULL, bool onlyKeepTheClosest=false, bool onlyUniqueRobust=false, const size_t decimation_other_map_points=1, const size_t offset_other_map_points=0) const |
| See the definition in the base class: In this class calls to this method are passed to the inner point map. | |
| float | compute3DMatchingRatio (const CMetricMap *otherMap, const CPose3D &otherMapPose, float minDistForCorr=0.10f, float minMahaDistForCorr=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. | |
| void | saveMetricMapRepresentationToFile (const std::string &filNamePrefix) const |
| The implementation in this class just calls all the corresponding method of the contained metric maps. | |
| void | auxParticleFilterCleanUp () |
| This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation". | |
| void | getAs3DObject (mrpt::opengl::CSetOfObjectsPtr &outObj) const |
| Returns a 3D object representing the map. | |
| bool | canComputeObservationLikelihood (const CObservation *obs) |
| Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. | |
| bool | canComputeObservationLikelihood (const CObservationPtr &obs) |
| Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. | |
| virtual const CSimplePointsMap * | getAsSimplePointsMap () const |
| If the map is a simple point map or it's a multi-metric map that contains EXACTLY one simple point map, return it. | |
| virtual CSimplePointsMap * | getAsSimplePointsMap () |
| void | clear () |
| Erase all the contents of the map. | |
| void | loadFromProbabilisticPosesAndObservations (const CSimpleMap &Map) |
| Load the map contents from a CSimpleMap object, erasing all previous content of the map. | |
| void | loadFromSimpleMap (const CSimpleMap &Map) |
| Load the map contents from a CSimpleMap object, erasing all previous content of the map. | |
| bool | insertObservation (const CObservation *obs, const CPose3D *robotPose=NULL) |
| Insert the observation information into this map. | |
| bool | insertObservationPtr (const CObservationPtr &obs, const CPose3D *robotPose=NULL) |
| A wrapper for smart pointers, just calls the non-smart pointer version. | |
| double | computeObservationLikelihood (const CObservation *obs, const CPose2D &takenFrom) |
| Computes the log-likelihood of a given observation given an arbitrary robot 2D pose. | |
| double | computeObservationsLikelihood (const CSensoryFrame &sf, const CPose2D &takenFrom) |
| Returns the sum of the log-likelihoods of each individual observation within a mrpt::slam::CSensoryFrame. | |
| bool | canComputeObservationsLikelihood (const CSensoryFrame &sf) |
| Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. | |
| virtual 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 |
| Computes the matchings between this and another 3D points map - method used in 3D-ICP. | |
| virtual float | squareDistanceToClosestCorrespondence (const float &x0, const float &y0) const |
| Returns the square distance from the 2D point (x0,y0) to the closest correspondence in the map. | |
| 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). | |
| CObject * | clone () const |
| Cloning interface for smart pointers. | |
Public Attributes | |
| mrpt::slam::CMultiMetricMap::TOptions | options |
| unsigned int | m_ID |
| An auxiliary variable that can be used freely by the users (this will be copied to other maps using the copy constructor, copy operator, streaming,etc) The default value is 0. | |
| bool | m_disableSaveAs3DObject |
| When set to true (default=false), calling "getAs3DObject" will have no effects. | |
Internal lists of maps | |
| std::deque< CSimplePointsMapPtr > | m_pointsMaps |
| std::deque < COccupancyGridMap2DPtr > | m_gridMaps |
| std::deque < CGasConcentrationGridMap2DPtr > | m_gasGridMaps |
| std::deque < CWirelessPowerGridMap2DPtr > | m_wifiGridMaps |
| std::deque< CHeightGridMap2DPtr > | m_heightMaps |
| std::deque < CReflectivityGridMap2DPtr > | m_reflectivityMaps |
| CColouredPointsMapPtr | m_colourPointsMap |
| CWeightedPointsMapPtr | m_weightedPointsMap |
| CLandmarksMapPtr | m_landmarksMap |
| CBeaconMapPtr | m_beaconMap |
Static Public Attributes | |
| static const mrpt::utils::TRuntimeClassId | classCObject |
RTTI stuff | |
| static const mrpt::utils::TRuntimeClassId | classCMetricMap |
RTTI stuff | |
| static const mrpt::utils::TRuntimeClassId | classCSerializable |
Protected Member Functions | |
| void | deleteAllMaps () |
| Deletes all maps and clears the internal lists of maps. | |
| virtual void | internal_clear () |
| Clear all elements of the map. | |
| virtual bool | internal_insertObservation (const CObservation *obs, const CPose3D *robotPose=NULL) |
| Insert the observation information into this map (see options) | |
| 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. | |
| 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. | |
CSerializable virtual methods | |
| void | writeToStream (mrpt::utils::CStream &out, int *getVersion) const |
| Introduces a pure virtual method responsible for writing to a CStream. | |
| 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. | |
RTTI stuff | |
| typedef CMultiMetricMapPtr | SmartPtr |
| static mrpt::utils::CLASSINIT | _init_CMultiMetricMap |
| static mrpt::utils::TRuntimeClassId | classCMultiMetricMap |
| static const mrpt::utils::TRuntimeClassId * | classinfo |
| static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
| virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const |
| Returns information about the class of an object in runtime. | |
| virtual mrpt::utils::CObject * | duplicate () const |
| Returns a copy of the object, indepently of its class. | |
| static mrpt::utils::CObject * | CreateObject () |
| static CMultiMetricMapPtr | Create () |
A typedef for the associated smart pointer
Definition at line 82 of file CMultiMetricMap.h.
| typedef std::pair<CPoint3D,unsigned int> mrpt::slam::CMultiMetricMap::TPairIdBeacon |
Definition at line 102 of file CMultiMetricMap.h.
| mrpt::slam::CMultiMetricMap::CMultiMetricMap | ( | const mrpt::slam::TSetOfMetricMapInitializers * | initializers = NULL, |
| const TOptions * | opts = NULL |
||
| ) |
Constructor.
| initializers | One internal map will be created for each entry in this "TSetOfMetricMapInitializers" struct, and each map will be initialized with the corresponding options. |
| opts | If provided (not NULL), the member "options" will be initialized with those values. If initializers is NULL, no internal map will be created. |
| mrpt::slam::CMultiMetricMap::CMultiMetricMap | ( | const mrpt::slam::CMultiMetricMap & | other | ) |
Copy constructor.
|
virtual |
Destructor.
|
staticprotected |
|
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.
Reimplemented from mrpt::slam::CMetricMap.
|
virtual |
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).
| obs | The observation. |
Reimplemented from mrpt::slam::CMetricMap.
|
inline |
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).
| obs | The observation. |
Definition at line 290 of file CMultiMetricMap.h.
References canComputeObservationLikelihood(), and mrpt::slam::CObservationPtr::pointer().
Referenced by canComputeObservationLikelihood().
|
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).
| sf | The observations. |
|
inherited |
Erase all the contents of the map.
Referenced by mrpt::slam::CReflectivityGridMap2D::clear(), mrpt::slam::CHeightGridMap2D::clear(), and mrpt::slam::CRandomFieldGridMap2D::clear().
|
inlineinherited |
|
virtual |
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.
| otherMap | [IN] The other map to compute the matching with. |
| otherMapPose | [IN] The 6D pose of the other map as seen from "this". |
| minDistForCorr | [IN] The minimum distance between 2 non-probabilistic map elements for counting them as a correspondence. |
| minMahaDistForCorr | [IN] The minimum Mahalanobis distance between 2 probabilistic map elements for counting them as a correspondence. |
Implements mrpt::slam::CMetricMap.
|
virtual |
See the definition in the base class: In this class calls to this method are passed to the inner point map.
Reimplemented from mrpt::slam::CMetricMap.
|
inlinevirtualinherited |
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 the ICP algorithm.
| 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. |
| maxAngularDistForCorrespondence | [IN] In radians: The aim is to allow larger distances to more distant correspondences. |
| angularDistPivotPoint | [IN] The point used to calculate distances from in both maps. |
| correspondences | [OUT] The detected matchings pairs. |
| correspondencesRatio | [OUT] The ratio [0,1] of points in otherMap with at least one correspondence. |
| sumSqrDist | [OUT] The sum of all matched points squared distances.If undesired, set to NULL, as default. |
| onlyKeepTheClosest | [IN] If set to true, only the closest correspondence will be returned. If false (default) all are returned. |
Reimplemented in mrpt::slam::CPointsMap.
Definition at line 272 of file CMetricMap.h.
References MRPT_END, MRPT_START, and THROW_EXCEPTION.
|
inlineinherited |
Computes the log-likelihood of a given observation given an arbitrary robot 2D pose.
| takenFrom | The robot's pose the observation is supposed to be taken from. |
| obs | The observation. |
Definition at line 175 of file CMetricMap.h.
|
virtual |
Computes the likelihood that a given observation was taken from a given pose in the world being modeled with this map.
| takenFrom | The robot's pose the observation is supposed to be taken from. |
| obs | The observation. |
Implements mrpt::slam::CMetricMap.
|
inherited |
Returns the sum of the log-likelihoods of each individual observation within a mrpt::slam::CSensoryFrame.
| takenFrom | The robot's pose the observation is supposed to be taken from. |
| sf | The set of observations in a CSensoryFrame. |
|
static |
|
static |
|
protected |
Deletes all maps and clears the internal lists of maps.
|
virtual |
Returns a copy of the object, indepently of its class.
Implements mrpt::utils::CObject.
|
inlineinherited |
|
virtual |
Returns a 3D object representing the map.
Implements mrpt::slam::CMetricMap.
|
virtual |
If the map is a simple point map or it's a multi-metric map that contains EXACTLY one simple point map, return it.
Otherwise, return NULL
Reimplemented from mrpt::slam::CMetricMap.
|
virtual |
Reimplemented from mrpt::slam::CMetricMap.
| float mrpt::slam::CMultiMetricMap::getNewStaticPointsRatio | ( | CPointsMap * | points, |
| CPose2D & | takenFrom | ||
| ) |
Returns the ratio of points in a map which are new to the point map while falling into yet static cells of gridmap.
| points | The set of points to check. |
| takenFrom | The pose for the reference system of points, in global coordinates of this hybrid map. |
|
virtual |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::slam::CMetricMap.
|
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 69 of file CObservable.h.
|
inlineinherited |
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 the origin. |
Definition at line 133 of file CMetricMap.h.
|
inlineinherited |
A wrapper for smart pointers, just calls the non-smart pointer version.
Definition at line 147 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.
|
protectedvirtual |
Clear all elements of the map.
Implements mrpt::slam::CMetricMap.
|
protectedvirtual |
Insert the observation information into this map (see options)
| 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.
|
virtual |
Returns true if the map is empty/no observation has been inserted.
Implements mrpt::slam::CMetricMap.
|
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.
| std::exception | Some internal steps in invoked methods can raise exceptions on invalid parameters, etc... |
|
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.
| std::exception | Some internal steps in invoked methods can raise exceptions on invalid parameters, etc... |
Definition at line 124 of file CMetricMap.h.
| mrpt::slam::CMultiMetricMap& mrpt::slam::CMultiMetricMap::operator= | ( | const mrpt::slam::CMultiMetricMap & | other | ) |
Copy operator from "other" object.
|
protectedinherited |
Called when you want this object to emit an event to all the observers currently subscribed to this object.
|
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.
| in | The input binary stream where the object data must read from. |
| version | The version of the object stored in the stream: use this version number in your code to know how to read the incoming data. |
| std::exception | On any error, see CStream::ReadBuffer |
Implements mrpt::utils::CSerializable.
|
virtual |
The implementation in this class just calls all the corresponding method of the contained metric maps.
Implements mrpt::slam::CMetricMap.
| void mrpt::slam::CMultiMetricMap::setListOfMaps | ( | const mrpt::slam::TSetOfMetricMapInitializers * | initializers | ) |
Sets the list of internal map according to the passed list of map initializers (Current maps' content will be deleted!)
|
inlinevirtualinherited |
Returns the square distance from the 2D point (x0,y0) to the closest correspondence in the map.
Definition at line 333 of file CMetricMap.h.
References MRPT_END, MRPT_START, and THROW_EXCEPTION.
|
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.
| out | The output binary stream where object must be dumped. |
| getVersion | If 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. |
| std::exception | On any error, see CStream::WriteBuffer |
Implements mrpt::utils::CSerializable.
|
staticprotected |
Definition at line 82 of file CMultiMetricMap.h.
|
staticinherited |
Definition at line 81 of file CMetricMap.h.
|
static |
Definition at line 82 of file CMultiMetricMap.h.
|
staticinherited |
|
staticinherited |
Definition at line 56 of file CSerializable.h.
|
static |
Definition at line 82 of file CMultiMetricMap.h.
| CBeaconMapPtr mrpt::slam::CMultiMetricMap::m_beaconMap |
Definition at line 183 of file CMultiMetricMap.h.
| CColouredPointsMapPtr mrpt::slam::CMultiMetricMap::m_colourPointsMap |
Definition at line 180 of file CMultiMetricMap.h.
|
inherited |
When set to true (default=false), calling "getAs3DObject" will have no effects.
Definition at line 321 of file CMetricMap.h.
| std::deque<CGasConcentrationGridMap2DPtr> mrpt::slam::CMultiMetricMap::m_gasGridMaps |
Definition at line 176 of file CMultiMetricMap.h.
| std::deque<COccupancyGridMap2DPtr> mrpt::slam::CMultiMetricMap::m_gridMaps |
Definition at line 175 of file CMultiMetricMap.h.
| std::deque<CHeightGridMap2DPtr> mrpt::slam::CMultiMetricMap::m_heightMaps |
Definition at line 178 of file CMultiMetricMap.h.
| unsigned int mrpt::slam::CMultiMetricMap::m_ID |
An auxiliary variable that can be used freely by the users (this will be copied to other maps using the copy constructor, copy operator, streaming,etc) The default value is 0.
Definition at line 300 of file CMultiMetricMap.h.
| CLandmarksMapPtr mrpt::slam::CMultiMetricMap::m_landmarksMap |
Definition at line 182 of file CMultiMetricMap.h.
| std::deque<CSimplePointsMapPtr> mrpt::slam::CMultiMetricMap::m_pointsMaps |
Definition at line 174 of file CMultiMetricMap.h.
| std::deque<CReflectivityGridMap2DPtr> mrpt::slam::CMultiMetricMap::m_reflectivityMaps |
Definition at line 179 of file CMultiMetricMap.h.
| CWeightedPointsMapPtr mrpt::slam::CMultiMetricMap::m_weightedPointsMap |
Definition at line 181 of file CMultiMetricMap.h.
| std::deque<CWirelessPowerGridMap2DPtr> mrpt::slam::CMultiMetricMap::m_wifiGridMaps |
Definition at line 177 of file CMultiMetricMap.h.
| mrpt::slam::CMultiMetricMap::TOptions mrpt::slam::CMultiMetricMap::options |
| Page generated by Doxygen 1.8.3 for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013 |