MRPT logo

mrpt::slam::CMultiMetricMap Class Reference

This class stores any customizable set of metric maps. More...

#include <mrpt/slam/CMultiMetricMap.h>

Inheritance diagram for mrpt::slam::CMultiMetricMap:

mrpt::slam::CMetricMap mrpt::utils::CSerializable

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.
void clear ()
 Clear all elements of the 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.
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.
bool insertObservation (const CObservation *obs, const CPose3D *robotPose=NULL)
 Insert the observation information into this map (see options).
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.

Public Attributes

mrpt::slam::CMultiMetricMap::TOptions options
 Some options for this class:.
std::deque< CSimplePointsMapPtr > m_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< CHeightGridMap2DPtr > m_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.

Static Private Attributes

static CLASSINIT _init_CHybridMetricMap
static TRuntimeClassId classCHybridMetricMap


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.

See also:
CMetricMap

Definition at line 68 of file CMultiMetricMap.h.


Member Typedef Documentation

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

Definition at line 90 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

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.

void mrpt::slam::CMultiMetricMap::clear (  )  [virtual]

Clear all elements of the map.

Implements mrpt::slam::CMetricMap.

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.

void mrpt::slam::CMultiMetricMap::deleteAllMaps (  )  [protected]

Deletes all maps and clears the internal lists of maps.

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

Returns a 3D object representing the map.

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

bool mrpt::slam::CMultiMetricMap::insertObservation ( const CObservation obs,
const CPose3D robotPose = NULL 
) [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 81 of file CMultiMetricMap.h.

Definition at line 82 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 177 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 193 of file CMultiMetricMap.h.

std::deque<CGasConcentrationGridMap2DPtr> mrpt::slam::CMultiMetricMap::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).

Definition at line 185 of file CMultiMetricMap.h.

std::deque<COccupancyGridMap2DPtr> mrpt::slam::CMultiMetricMap::m_gridMaps

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

std::deque<CHeightGridMap2DPtr> mrpt::slam::CMultiMetricMap::m_heightMaps

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 189 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 305 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 173 of file CMultiMetricMap.h.

std::deque<CSimplePointsMapPtr> mrpt::slam::CMultiMetricMap::m_pointsMaps

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

Some options for this class:.




Page generated by Doxygen 1.5.7.1 for MRPT 0.6.5 SVN: at Mon Feb 23 13:25:04 EST 2009