Main MRPT website > C++ reference
MRPT logo
Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions

mrpt::slam::CMultiMetricMap Class Reference


Detailed Description

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.

See also:
CMetricMap

Definition at line 72 of file CMultiMetricMap.h.

#include <mrpt/slam/CMultiMetricMap.h>

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

List of all members.

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::CMultiMetricMapoperator= (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 points 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
 See the definition in the base class: In this class calls to this method are passed to the inner points 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 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.
virtual CSimplePointsMapgetAsSimplePointsMap ()

Public Attributes

mrpt::slam::CMultiMetricMap::TOptions options
 Some options for this class:
std::deque< CSimplePointsMapPtrm_pointsMaps
 Some of the internal metric maps (the number of point-maps depends on the the TSetOfMetricMapInitializers passed to the constructor of this class).
CLandmarksMapPtr m_landmarksMap
 One of the internal metric map (will be NULL if not used, what comes from the TSetOfMetricMapInitializers passed to the constructor of this class).
CBeaconMapPtr m_beaconMap
 One of the internal metric map (will be NULL if not used, what comes from the TSetOfMetricMapInitializers passed to the constructor of this class).
std::deque
< COccupancyGridMap2DPtr
m_gridMaps
 Some of the internal metric maps (the number of gridmaps depends on the the TSetOfMetricMapInitializers passed to the constructor of this class).
std::deque
< CGasConcentrationGridMap2DPtr
m_gasGridMaps
 Some of the internal metric maps (the number of gas gridmaps depends on the the TSetOfMetricMapInitializers passed to the constructor of this class).
std::deque< CHeightGridMap2DPtrm_heightMaps
 Some of the internal metric maps (the number of gas gridmaps depends on the the TSetOfMetricMapInitializers passed to the constructor of this class).
CColouredPointsMapPtr m_colourPointsMap
 One of the internal metric map (will be NULL if not used, what comes from the TSetOfMetricMapInitializers passed to the constructor of this class).
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.

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).

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::CObjectduplicate () const
 Returns a copy of the object, indepently of its class.
static mrpt::utils::CObjectCreateObject ()
static CMultiMetricMapPtr Create ()

Member Typedef Documentation

A typedef for the associated smart pointer

Definition at line 75 of file CMultiMetricMap.h.

typedef std::pair<CPoint3D,unsigned int> mrpt::slam::CMultiMetricMap::TPairIdBeacon

Definition at line 95 of file CMultiMetricMap.h.


Constructor & Destructor Documentation

mrpt::slam::CMultiMetricMap::CMultiMetricMap ( const mrpt::slam::TSetOfMetricMapInitializers initializers = NULL,
const TOptions opts = NULL 
)

Constructor.

Parameters:
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 mrpt::slam::CMultiMetricMap::~CMultiMetricMap (  )  [virtual]

Destructor.


Member Function Documentation

static const mrpt::utils::TRuntimeClassId* mrpt::slam::CMultiMetricMap::_GetBaseClass (  )  [static, protected]

Reimplemented from mrpt::slam::CMetricMap.

void mrpt::slam::CMultiMetricMap::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.

bool mrpt::slam::CMultiMetricMap::canComputeObservationLikelihood ( const CObservation obs  )  [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).

Parameters:
obs The observation.
See also:
computeObservationLikelihood

Reimplemented from mrpt::slam::CMetricMap.

bool mrpt::slam::CMultiMetricMap::canComputeObservationLikelihood ( const CObservationPtr obs  )  [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).

Parameters:
obs The observation.
See also:
computeObservationLikelihood

Definition at line 301 of file CMultiMetricMap.h.

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

Referenced by canComputeObservationLikelihood().

float mrpt::slam::CMultiMetricMap::compute3DMatchingRatio ( const CMetricMap otherMap,
const CPose3D otherMapPose,
float  minDistForCorr = 0.10f,
float  minMahaDistForCorr = 2.0f 
) const [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.

Parameters:
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.
Returns:
The matching ratio [0,1]
See also:
computeMatchingWith2D

Implements mrpt::slam::CMetricMap.

void mrpt::slam::CMultiMetricMap::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 [virtual]

See the definition in the base class: In this class calls to this method are passed to the inner points map.

See also:
computeMatching3DWith

Reimplemented from mrpt::slam::CMetricMap.

double mrpt::slam::CMultiMetricMap::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.

Parameters:
takenFrom The robot's pose the observation is supposed to be taken from.
obs The observation.
Returns:
This method returns a likelihood in the range [0,1].
See also:
likelihoodMapSelection, Used in particle filter algorithms, see: CMultiMetricMapPDF::update

Implements mrpt::slam::CMetricMap.

static CMultiMetricMapPtr mrpt::slam::CMultiMetricMap::Create (  )  [static]
static mrpt::utils::CObject* mrpt::slam::CMultiMetricMap::CreateObject (  )  [static]
void mrpt::slam::CMultiMetricMap::deleteAllMaps (  )  [protected]

Deletes all maps and clears the internal lists of maps.

virtual mrpt::utils::CObject* mrpt::slam::CMultiMetricMap::duplicate (  )  const [virtual]

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

Implements mrpt::utils::CObject.

void mrpt::slam::CMultiMetricMap::getAs3DObject ( mrpt::opengl::CSetOfObjectsPtr outObj  )  const [virtual]

Returns a 3D object representing the map.

Implements mrpt::slam::CMetricMap.

virtual const CSimplePointsMap* mrpt::slam::CMultiMetricMap::getAsSimplePointsMap (  )  const [virtual]

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.

virtual CSimplePointsMap* mrpt::slam::CMultiMetricMap::getAsSimplePointsMap (  )  [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 points map while falling into yet static cells of gridmap.

Parameters:
points The set of points to check.
takenFrom The pose for the reference system of points, in global coordinates of this hybrid map.
virtual const mrpt::utils::TRuntimeClassId* mrpt::slam::CMultiMetricMap::GetRuntimeClass (  )  const [virtual]

Returns information about the class of an object in runtime.

Reimplemented from mrpt::slam::CMetricMap.

virtual void mrpt::slam::CMultiMetricMap::internal_clear (  )  [protected, virtual]

Clear all elements of the map.

Implements mrpt::slam::CMetricMap.

virtual bool mrpt::slam::CMultiMetricMap::internal_insertObservation ( const CObservation obs,
const CPose3D robotPose = NULL 
) [protected, virtual]

Insert the observation information into this map (see options).

Parameters:
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)
See also:
CObservation::insertObservationInto

Implements mrpt::slam::CMetricMap.

bool mrpt::slam::CMultiMetricMap::isEmpty (  )  const [virtual]

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

Implements mrpt::slam::CMetricMap.

mrpt::slam::CMultiMetricMap& mrpt::slam::CMultiMetricMap::operator= ( const mrpt::slam::CMultiMetricMap other  ) 

Copy operator from "other" object.

void mrpt::slam::CMultiMetricMap::saveMetricMapRepresentationToFile ( const std::string &  filNamePrefix  )  const [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!).


Member Data Documentation

Definition at line 75 of file CMultiMetricMap.h.

Definition at line 75 of file CMultiMetricMap.h.

Definition at line 75 of file CMultiMetricMap.h.

One of the internal metric map (will be NULL if not used, what comes from the TSetOfMetricMapInitializers passed to the constructor of this class).

Definition at line 182 of file CMultiMetricMap.h.

One of the internal metric map (will be NULL if not used, what comes from the TSetOfMetricMapInitializers passed to the constructor of this class).

Definition at line 198 of file CMultiMetricMap.h.

Some of the internal metric maps (the number of gas gridmaps depends on the the TSetOfMetricMapInitializers passed to the constructor of this class).

Definition at line 190 of file CMultiMetricMap.h.

Some of the internal metric maps (the number of gridmaps depends on the the TSetOfMetricMapInitializers passed to the constructor of this class).

Definition at line 186 of file CMultiMetricMap.h.

Some of the internal metric maps (the number of gas gridmaps depends on the the TSetOfMetricMapInitializers passed to the constructor of this class).

Definition at line 194 of file CMultiMetricMap.h.

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 311 of file CMultiMetricMap.h.

One of the internal metric map (will be NULL if not used, what comes from the TSetOfMetricMapInitializers passed to the constructor of this class).

Definition at line 178 of file CMultiMetricMap.h.

Some of the internal metric maps (the number of point-maps depends on the the TSetOfMetricMapInitializers passed to the constructor of this class).

Definition at line 174 of file CMultiMetricMap.h.

Some options for this class:




Page generated by Doxygen 1.7.1 for MRPT 0.9.4 SVN: at Mon Jan 10 23:33:19 UTC 2011