Main MRPT website > C++ reference for MRPT 1.5.3
List of all members | Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions
mrpt::maps::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 as smart pointers with CMultiMetricMap::getMapByIndex() or via iterators. The utility of this container is to operate on several maps simultaneously: update them by inserting observations, evaluate the likelihood of one observation by fusing (multiplying) the likelihoods over the different maps, etc.

These kinds of metric maps can be kept inside (list may be incomplete, refer to classes derived from mrpt::maps::CMetricMap):

See CMultiMetricMap::setListOfMaps() for the method for initializing this class programatically. See also TSetOfMetricMapInitializers::loadFromConfigFile for a template of ".ini"-like configuration file that can be used to define which maps to create and all their parameters. Alternatively, the list of maps is public so it can be directly manipulated/accessed in CMultiMetricMap::maps

Configuring the list of maps: Alternatives

Method #1: Using map definition structures

Method #2: Using a configuration file See TSetOfMetricMapInitializers::loadFromConfigFile() for details on expected file format.

mrpt::utils::CConfigFile cfgFile("file.cfg");
map_inits.loadFromConfigFile(cfgFile, "MapDefinition");
theMap.setListOfMaps(map_inits);

Method #3: Manual manipulation

{
mrpt::maps::CSimplePointsMapPtr ptMap = mrpt::maps::CSimplePointsMap::Create();
theMap.maps.push_back(ptMap);
}
Note
[New in MRPT 1.3.0]: likelihoodMapSelection, which selected the map to be used when computing the likelihood of an observation, has been removed. Use the enableObservationLikelihood property of each individual map declaration.
[New in MRPT 1.3.0]: enableInsertion_{pointsMap,...} have been also removed. Use the enableObservationInsertion property of each map declaration.
[New in MRPT 1.3.0]: Plain list of maps is exposed in maps member. Proxies named m_pointsMaps,m_gridMaps, etc. are provided for backwards-compatibility and for their utility.
This class belongs to [mrpt-slam] instead of [mrpt-maps] due to the dependency on map classes in mrpt-vision.
See also
CMetricMap

Definition at line 123 of file maps/CMultiMetricMap.h.

#include <mrpt/maps/CMultiMetricMap.h>

Inheritance diagram for mrpt::maps::CMultiMetricMap:
Inheritance graph

Classes

struct  ProxyFilterContainerByClass
 Takes a const ref of a STL non-associative container of smart pointers at construction and exposes an interface mildly similar to that of another STL container containing only those elements in the original container that can be dynamic_casted to SELECTED_CLASS_PTR More...
 
struct  ProxySelectorContainerByClass
 A proxy like ProxyFilterContainerByClass, but it directly appears as if it was a single smart pointer (empty if no matching object is found in the container) More...
 

Public Member Functions

void * operator new (size_t size)
 
void * operator new[] (size_t size)
 
void operator delete (void *ptr) throw ()
 
void operator delete[] (void *ptr) throw ()
 
void operator delete (void *memory, void *ptr) throw ()
 
void * operator new (size_t size, const std::nothrow_t &) throw ()
 
void operator delete (void *ptr, const std::nothrow_t &) throw ()
 
 CMultiMetricMap (const mrpt::maps::TSetOfMetricMapInitializers *initializers=NULL)
 Constructor. More...
 
 CMultiMetricMap (const CMultiMetricMap &o)
 
CMultiMetricMapoperator= (const CMultiMetricMap &o)
 
void setListOfMaps (const mrpt::maps::TSetOfMetricMapInitializers *initializers)
 Sets the list of internal map according to the passed list of map initializers (Current maps' content will be deleted!) More...
 
void setListOfMaps (const mrpt::maps::TSetOfMetricMapInitializers &initializers)
 
bool isEmpty () const MRPT_OVERRIDE
 Returns true if all maps returns true to their isEmpty() method, which is map-dependent. Read the docs of each map class. More...
 
virtual void determineMatching2D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose2D &otherMapPose, mrpt::utils::TMatchingPairList &correspondences, const mrpt::maps::TMatchingParams &params, mrpt::maps::TMatchingExtraResults &extraResults) const MRPT_OVERRIDE
 Computes the matching between this and another 2D point map, which includes finding: More...
 
float compute3DMatchingRatio (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, const TMatchingRatioParams &params) const MRPT_OVERRIDE
 See the definition in the base class: Calls in this class become a call to every single map in this set. More...
 
void saveMetricMapRepresentationToFile (const std::string &filNamePrefix) const MRPT_OVERRIDE
 The implementation in this class just calls all the corresponding method of the contained metric maps. More...
 
void auxParticleFilterCleanUp () MRPT_OVERRIDE
 This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation". More...
 
void getAs3DObject (mrpt::opengl::CSetOfObjectsPtr &outObj) const MRPT_OVERRIDE
 Returns a 3D object representing the map. More...
 
virtual const mrpt::maps::CSimplePointsMapgetAsSimplePointsMap () const MRPT_OVERRIDE
 If the map is a simple point map or it's a multi-metric map that contains EXACTLY one simple point map, return it. More...
 
virtual mrpt::maps::CSimplePointsMapgetAsSimplePointsMap () MRPT_OVERRIDE
 
void clear ()
 Erase all the contents of the map. More...
 
void loadFromProbabilisticPosesAndObservations (const mrpt::maps::CSimpleMap &Map)
 Load the map contents from a CSimpleMap object, erasing all previous content of the map. More...
 
void loadFromSimpleMap (const mrpt::maps::CSimpleMap &Map)
 Load the map contents from a CSimpleMap object, erasing all previous content of the map. More...
 
bool insertObservation (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL)
 Insert the observation information into this map. More...
 
bool insertObservationPtr (const mrpt::obs::CObservationPtr &obs, const mrpt::poses::CPose3D *robotPose=NULL)
 A wrapper for smart pointers, just calls the non-smart pointer version. More...
 
double computeObservationLikelihood (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom)
 Computes the log-likelihood of a given observation given an arbitrary robot 3D pose. More...
 
double computeObservationLikelihood (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose2D &takenFrom)
 
virtual bool canComputeObservationLikelihood (const mrpt::obs::CObservation *obs) const
 Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. More...
 
bool canComputeObservationLikelihood (const mrpt::obs::CObservationPtr &obs) const
 
double computeObservationsLikelihood (const mrpt::obs::CSensoryFrame &sf, const mrpt::poses::CPose2D &takenFrom)
 Returns the sum of the log-likelihoods of each individual observation within a mrpt::obs::CSensoryFrame. More...
 
bool canComputeObservationsLikelihood (const mrpt::obs::CSensoryFrame &sf) const
 Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. More...
 
virtual void determineMatching3D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, mrpt::utils::TMatchingPairList &correspondences, const TMatchingParams &params, TMatchingExtraResults &extraResults) const
 Computes the matchings between this and another 3D points map - method used in 3D-ICP. More...
 
virtual float squareDistanceToClosestCorrespondence (float x0, float y0) const
 Returns the square distance from the 2D point (x0,y0) to the closest correspondence in the map. More...
 
virtual mxArraywriteToMatlab () const
 Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class. 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...
 
CObject * clone () const
 Cloning interface for smart pointers. More...
 

Static Public Member Functions

static void * operator new (size_t size, void *ptr)
 

Public Attributes

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. More...
 
TMapGenericParams genericMapParams
 Common params to all maps. More...
 

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 (with clear_unique(), so user copies remain alive) More...
 
void internal_clear () MRPT_OVERRIDE
 Clear all elements of the map. More...
 
bool internal_insertObservation (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL) MRPT_OVERRIDE
 Internal method called by insertObservation() More...
 
bool internal_canComputeObservationLikelihood (const mrpt::obs::CObservation *obs) const MRPT_OVERRIDE
 Returns true if any of the inner maps is able to compute a sensible likelihood function for this observation. More...
 
double internal_computeObservationLikelihood (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) MRPT_OVERRIDE
 Internal method called by computeObservationLikelihood() 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...
 

RTTI stuff

typedef CMultiMetricMapPtr SmartPtr
 
static mrpt::utils::CLASSINIT _init_CMultiMetricMap
 
static mrpt::utils::TRuntimeClassId classCMultiMetricMap
 
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 CMultiMetricMapPtr Create ()
 

Access to internal list of maps: direct list, iterators, utility methods and proxies

typedef std::deque< mrpt::utils::poly_ptr_ptr< mrpt::maps::CMetricMapPtr > > TListMaps
 
typedef TListMaps::iterator iterator
 
typedef TListMaps::const_iterator const_iterator
 
TListMaps maps
 The list of MRPT metric maps in this object. More...
 
ProxyFilterContainerByClass< mrpt::maps::CSimplePointsMapPtr, TListMapsm_pointsMaps
 STL-like proxy to access this kind of maps in maps. More...
 
ProxyFilterContainerByClass< mrpt::maps::COccupancyGridMap2DPtr, TListMapsm_gridMaps
 STL-like proxy to access this kind of maps in maps. More...
 
ProxyFilterContainerByClass< mrpt::maps::COctoMapPtr, TListMapsm_octoMaps
 STL-like proxy to access this kind of maps in maps. More...
 
ProxyFilterContainerByClass< mrpt::maps::CColouredOctoMapPtr, TListMapsm_colourOctoMaps
 STL-like proxy to access this kind of maps in maps. More...
 
ProxyFilterContainerByClass< mrpt::maps::CGasConcentrationGridMap2DPtr, TListMapsm_gasGridMaps
 STL-like proxy to access this kind of maps in maps. More...
 
ProxyFilterContainerByClass< mrpt::maps::CWirelessPowerGridMap2DPtr, TListMapsm_wifiGridMaps
 STL-like proxy to access this kind of maps in maps. More...
 
ProxyFilterContainerByClass< mrpt::maps::CHeightGridMap2DPtr, TListMapsm_heightMaps
 STL-like proxy to access this kind of maps in maps. More...
 
ProxyFilterContainerByClass< mrpt::maps::CHeightGridMap2D_MRFPtr, TListMapsm_heightMRFMaps
 STL-like proxy to access this kind of maps in maps. More...
 
ProxyFilterContainerByClass< mrpt::maps::CReflectivityGridMap2DPtr, TListMapsm_reflectivityMaps
 STL-like proxy to access this kind of maps in maps. More...
 
ProxySelectorContainerByClass< mrpt::maps::CColouredPointsMapPtr, TListMapsm_colourPointsMap
 Proxy that looks like a smart pointer to the first matching object in maps. More...
 
ProxySelectorContainerByClass< mrpt::maps::CWeightedPointsMapPtr, TListMapsm_weightedPointsMap
 Proxy that looks like a smart pointer to the first matching object in maps. More...
 
ProxySelectorContainerByClass< mrpt::maps::CLandmarksMapPtr, TListMapsm_landmarksMap
 Proxy that looks like a smart pointer to the first matching object in maps. More...
 
ProxySelectorContainerByClass< mrpt::maps::CBeaconMapPtr, TListMapsm_beaconMap
 Proxy that looks like a smart pointer to the first matching object in maps. More...
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
mrpt::maps::CMetricMapPtr getMapByIndex (size_t idx) const
 Gets the i-th map. More...
 
template<typename T >
T::SmartPtr getMapByClass (const size_t &ith=0) const
 Returns the i'th observation of a given class (or of a descendant class), or NULL if there is no such observation in the array. More...
 

Member Typedef Documentation

◆ const_iterator

typedef TListMaps::const_iterator mrpt::maps::CMultiMetricMap::const_iterator

Definition at line 151 of file maps/CMultiMetricMap.h.

◆ iterator

typedef TListMaps::iterator mrpt::maps::CMultiMetricMap::iterator

Definition at line 150 of file maps/CMultiMetricMap.h.

◆ SmartPtr

typedef CMultiMetricMapPtr mrpt::maps::CMultiMetricMap::SmartPtr

A typedef for the associated smart pointer

Definition at line 126 of file maps/CMultiMetricMap.h.

◆ TListMaps

typedef std::deque< mrpt::utils::poly_ptr_ptr<mrpt::maps::CMetricMapPtr> > mrpt::maps::CMultiMetricMap::TListMaps

Definition at line 143 of file maps/CMultiMetricMap.h.

Constructor & Destructor Documentation

◆ CMultiMetricMap() [1/2]

mrpt::maps::CMultiMetricMap::CMultiMetricMap ( const mrpt::maps::TSetOfMetricMapInitializers initializers = NULL)

Constructor.

Parameters
initializersOne internal map will be created for each entry in this "TSetOfMetricMapInitializers" struct. If initializers is NULL, no internal map will be created.

◆ CMultiMetricMap() [2/2]

mrpt::maps::CMultiMetricMap::CMultiMetricMap ( const CMultiMetricMap o)

Member Function Documentation

◆ _GetBaseClass()

static const mrpt::utils::TRuntimeClassId* mrpt::maps::CMultiMetricMap::_GetBaseClass ( )
staticprotected

◆ auxParticleFilterCleanUp()

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

Reimplemented from mrpt::maps::CMetricMap.

◆ begin() [1/2]

iterator mrpt::maps::CMultiMetricMap::begin ( )
inline

Definition at line 152 of file maps/CMultiMetricMap.h.

◆ begin() [2/2]

const_iterator mrpt::maps::CMultiMetricMap::begin ( ) const
inline

Definition at line 153 of file maps/CMultiMetricMap.h.

◆ canComputeObservationLikelihood() [1/2]

virtual bool mrpt::maps::CMetricMap::canComputeObservationLikelihood ( const mrpt::obs::CObservation obs) const
virtualinherited

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). See: Maps and observations compatibility matrix

Parameters
obsThe observation.
See also
computeObservationLikelihood, genericMapParams.enableObservationLikelihood

◆ canComputeObservationLikelihood() [2/2]

bool mrpt::maps::CMetricMap::canComputeObservationLikelihood ( const mrpt::obs::CObservationPtr &  obs) const
inherited

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

◆ canComputeObservationsLikelihood()

bool mrpt::maps::CMetricMap::canComputeObservationsLikelihood ( const mrpt::obs::CSensoryFrame sf) const
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). See: Maps and observations compatibility matrix

Parameters
sfThe observations.
See also
canComputeObservationLikelihood

◆ clear()

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

◆ clone()

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

Cloning interface for smart pointers.

Definition at line 143 of file CObject.h.

◆ compute3DMatchingRatio()

float mrpt::maps::CMultiMetricMap::compute3DMatchingRatio ( const mrpt::maps::CMetricMap otherMap,
const mrpt::poses::CPose3D otherMapPose,
const TMatchingRatioParams params 
) const
virtual

See the definition in the base class: Calls in this class become a call to every single map in this set.

Reimplemented from mrpt::maps::CMetricMap.

◆ computeObservationLikelihood() [1/2]

double mrpt::maps::CMetricMap::computeObservationLikelihood ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose3D takenFrom 
)
inherited

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

See: Maps and observations compatibility matrix

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

◆ computeObservationLikelihood() [2/2]

double mrpt::maps::CMetricMap::computeObservationLikelihood ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose2D takenFrom 
)
inherited

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

◆ computeObservationsLikelihood()

double mrpt::maps::CMetricMap::computeObservationsLikelihood ( const mrpt::obs::CSensoryFrame sf,
const mrpt::poses::CPose2D takenFrom 
)
inherited

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

See: Maps and observations compatibility matrix

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

◆ Create()

static CMultiMetricMapPtr mrpt::maps::CMultiMetricMap::Create ( )
static

◆ CreateObject()

static mrpt::utils::CObject* mrpt::maps::CMultiMetricMap::CreateObject ( )
static

◆ deleteAllMaps()

void mrpt::maps::CMultiMetricMap::deleteAllMaps ( )
protected

Deletes all maps and clears the internal lists of maps (with clear_unique(), so user copies remain alive)

◆ determineMatching2D()

virtual void mrpt::maps::CMultiMetricMap::determineMatching2D ( const mrpt::maps::CMetricMap otherMap,
const mrpt::poses::CPose2D otherMapPose,
mrpt::utils::TMatchingPairList correspondences,
const mrpt::maps::TMatchingParams params,
mrpt::maps::TMatchingExtraResults extraResults 
) const
virtual

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::maps::CMetricMap.

◆ determineMatching3D()

virtual void mrpt::maps::CMetricMap::determineMatching3D ( const mrpt::maps::CMetricMap otherMap,
const mrpt::poses::CPose3D otherMapPose,
mrpt::utils::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 in mrpt::maps::CPointsMap.

◆ duplicate()

virtual mrpt::utils::CObject* mrpt::maps::CMultiMetricMap::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 140 of file CObject.h.

◆ end() [1/2]

iterator mrpt::maps::CMultiMetricMap::end ( )
inline

Definition at line 154 of file maps/CMultiMetricMap.h.

◆ end() [2/2]

const_iterator mrpt::maps::CMultiMetricMap::end ( ) const
inline

Definition at line 155 of file maps/CMultiMetricMap.h.

◆ getAs3DObject()

void mrpt::maps::CMultiMetricMap::getAs3DObject ( mrpt::opengl::CSetOfObjectsPtr &  outObj) const
virtual

Returns a 3D object representing the map.

Implements mrpt::maps::CMetricMap.

◆ getAsSimplePointsMap() [1/2]

virtual const mrpt::maps::CSimplePointsMap* mrpt::maps::CMultiMetricMap::getAsSimplePointsMap ( ) const
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::maps::CMetricMap.

◆ getAsSimplePointsMap() [2/2]

virtual mrpt::maps::CSimplePointsMap* mrpt::maps::CMultiMetricMap::getAsSimplePointsMap ( )
virtual

Reimplemented from mrpt::maps::CMetricMap.

◆ getMapByClass()

template<typename T >
T::SmartPtr mrpt::maps::CMultiMetricMap::getMapByClass ( const size_t &  ith = 0) const
inline

Returns the i'th observation of a given class (or of a descendant class), or NULL if there is no such observation in the array.

Example:

CObservationImagePtr obs = m_SF->getObservationByClass<CObservationImage>();

By default (ith=0), the first observation is returned.

Definition at line 168 of file maps/CMultiMetricMap.h.

References begin(), and end().

◆ getMapByIndex()

mrpt::maps::CMetricMapPtr mrpt::maps::CMultiMetricMap::getMapByIndex ( size_t  idx) const

Gets the i-th map.

Exceptions
std::runtime_errorOn out-of-bounds

◆ GetRuntimeClass()

virtual const mrpt::utils::TRuntimeClassId* mrpt::maps::CMultiMetricMap::GetRuntimeClass ( ) const
virtual

Returns information about the class of an object in runtime.

Reimplemented from mrpt::maps::CMetricMap.

◆ 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 52 of file CObservable.h.

◆ insertObservation()

bool mrpt::maps::CMetricMap::insertObservation ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose3D robotPose = NULL 
)
inherited

Insert the observation information into this map.

This method must be implemented in derived classes. See: Maps and observations compatibility matrix

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

Referenced by mrpt::graphslam::deciders::CRangeScanOps< GRAPH_T >::getICPEdge(), and mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::updateMapVisualization().

◆ insertObservationPtr()

bool mrpt::maps::CMetricMap::insertObservationPtr ( const mrpt::obs::CObservationPtr &  obs,
const mrpt::poses::CPose3D robotPose = NULL 
)
inherited

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

See: Maps and observations compatibility matrix

◆ internal_canComputeObservationLikelihood()

bool mrpt::maps::CMultiMetricMap::internal_canComputeObservationLikelihood ( const mrpt::obs::CObservation obs) const
protectedvirtual

Returns true if any of the inner maps is able to compute a sensible likelihood function for this observation.

Parameters
obsThe observation.
See also
computeObservationLikelihood

Reimplemented from mrpt::maps::CMetricMap.

◆ internal_clear()

void mrpt::maps::CMultiMetricMap::internal_clear ( )
protectedvirtual

Clear all elements of the map.

Implements mrpt::maps::CMetricMap.

◆ internal_computeObservationLikelihood()

double mrpt::maps::CMultiMetricMap::internal_computeObservationLikelihood ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose3D takenFrom 
)
protectedvirtual

Internal method called by computeObservationLikelihood()

Implements mrpt::maps::CMetricMap.

◆ internal_insertObservation()

bool mrpt::maps::CMultiMetricMap::internal_insertObservation ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose3D robotPose = NULL 
)
protectedvirtual

Internal method called by insertObservation()

Implements mrpt::maps::CMetricMap.

◆ isEmpty()

bool mrpt::maps::CMultiMetricMap::isEmpty ( ) const
virtual

Returns true if all maps returns true to their isEmpty() method, which is map-dependent. Read the docs of each map class.

Implements mrpt::maps::CMetricMap.

◆ loadFromProbabilisticPosesAndObservations()

void mrpt::maps::CMetricMap::loadFromProbabilisticPosesAndObservations ( const mrpt::maps::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...

◆ loadFromSimpleMap()

void mrpt::maps::CMetricMap::loadFromSimpleMap ( const mrpt::maps::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 105 of file maps/CMetricMap.h.

◆ operator delete() [1/3]

void mrpt::maps::CMultiMetricMap::operator delete ( void *  ptr)
throw (
)
inline

Definition at line 126 of file maps/CMultiMetricMap.h.

◆ operator delete() [2/3]

void mrpt::maps::CMultiMetricMap::operator delete ( void *  memory,
void *  ptr 
)
throw (
)
inline

Definition at line 126 of file maps/CMultiMetricMap.h.

◆ operator delete() [3/3]

void mrpt::maps::CMultiMetricMap::operator delete ( void *  ptr,
const std::nothrow_t &   
)
throw (
)
inline

Definition at line 126 of file maps/CMultiMetricMap.h.

◆ operator delete[]()

void mrpt::maps::CMultiMetricMap::operator delete[] ( void *  ptr)
throw (
)
inline

Definition at line 126 of file maps/CMultiMetricMap.h.

◆ operator new() [1/3]

void* mrpt::maps::CMultiMetricMap::operator new ( size_t  size,
const std::nothrow_t &   
)
throw (
)
inline

Definition at line 126 of file maps/CMultiMetricMap.h.

◆ operator new() [2/3]

void* mrpt::maps::CMultiMetricMap::operator new ( size_t  size)
inline

Definition at line 126 of file maps/CMultiMetricMap.h.

◆ operator new() [3/3]

static void* mrpt::maps::CMultiMetricMap::operator new ( size_t  size,
void *  ptr 
)
inlinestatic

Definition at line 126 of file maps/CMultiMetricMap.h.

◆ operator new[]()

void* mrpt::maps::CMultiMetricMap::operator new[] ( size_t  size)
inline

Definition at line 126 of file maps/CMultiMetricMap.h.

◆ operator=()

CMultiMetricMap& mrpt::maps::CMultiMetricMap::operator= ( const CMultiMetricMap o)

◆ 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::maps::CMultiMetricMap::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.

◆ saveMetricMapRepresentationToFile()

void mrpt::maps::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::maps::CMetricMap.

◆ setListOfMaps() [1/2]

void mrpt::maps::CMultiMetricMap::setListOfMaps ( const mrpt::maps::TSetOfMetricMapInitializers initializers)

Sets the list of internal map according to the passed list of map initializers (Current maps' content will be deleted!)

◆ setListOfMaps() [2/2]

void mrpt::maps::CMultiMetricMap::setListOfMaps ( const mrpt::maps::TSetOfMetricMapInitializers initializers)
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 294 of file maps/CMultiMetricMap.h.

References MRPT_OVERRIDE, and setListOfMaps().

Referenced by setListOfMaps().

◆ squareDistanceToClosestCorrespondence()

virtual float mrpt::maps::CMetricMap::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 in mrpt::maps::CPointsMap.

◆ writeToMatlab()

virtual mxArray* mrpt::utils::CSerializable::writeToMatlab ( ) const
inlinevirtualinherited

Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class.

Returns
A new mxArray (caller is responsible of memory freeing) or NULL is class does not support conversion to MATLAB.

Definition at line 79 of file CSerializable.h.

References BASE_IMPEXP, DEFINE_MRPT_OBJECT_POST, mrpt::utils::ObjectToOctetVector(), mrpt::utils::ObjectToRawString(), mrpt::utils::ObjectToString(), mrpt::utils::OctetVectorToObject(), mrpt::utils::RawStringToObject(), and mrpt::utils::StringToObject().

◆ writeToStream()

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

Member Data Documentation

◆ _init_CMultiMetricMap

mrpt::utils::CLASSINIT mrpt::maps::CMultiMetricMap::_init_CMultiMetricMap
staticprotected

Definition at line 126 of file maps/CMultiMetricMap.h.

◆ classCMetricMap

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

Definition at line 57 of file maps/CMetricMap.h.

◆ classCMultiMetricMap

mrpt::utils::TRuntimeClassId mrpt::maps::CMultiMetricMap::classCMultiMetricMap
static

Definition at line 126 of file maps/CMultiMetricMap.h.

◆ classCObject

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

Definition at line 128 of file CObject.h.

◆ classCSerializable

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

Definition at line 42 of file CSerializable.h.

◆ classinfo

const mrpt::utils::TRuntimeClassId* mrpt::maps::CMultiMetricMap::classinfo
static

Definition at line 126 of file maps/CMultiMetricMap.h.

◆ genericMapParams

TMapGenericParams mrpt::maps::CMetricMap::genericMapParams
inherited

Common params to all maps.

Definition at line 227 of file maps/CMetricMap.h.

◆ m_beaconMap

ProxySelectorContainerByClass<mrpt::maps::CBeaconMapPtr,TListMaps> mrpt::maps::CMultiMetricMap::m_beaconMap

Proxy that looks like a smart pointer to the first matching object in maps.

Definition at line 273 of file maps/CMultiMetricMap.h.

◆ m_colourOctoMaps

ProxyFilterContainerByClass<mrpt::maps::CColouredOctoMapPtr,TListMaps> mrpt::maps::CMultiMetricMap::m_colourOctoMaps

STL-like proxy to access this kind of maps in maps.

Definition at line 264 of file maps/CMultiMetricMap.h.

◆ m_colourPointsMap

ProxySelectorContainerByClass<mrpt::maps::CColouredPointsMapPtr,TListMaps> mrpt::maps::CMultiMetricMap::m_colourPointsMap

Proxy that looks like a smart pointer to the first matching object in maps.

Definition at line 270 of file maps/CMultiMetricMap.h.

◆ m_gasGridMaps

ProxyFilterContainerByClass<mrpt::maps::CGasConcentrationGridMap2DPtr,TListMaps> mrpt::maps::CMultiMetricMap::m_gasGridMaps

STL-like proxy to access this kind of maps in maps.

Definition at line 265 of file maps/CMultiMetricMap.h.

◆ m_gridMaps

ProxyFilterContainerByClass<mrpt::maps::COccupancyGridMap2DPtr,TListMaps> mrpt::maps::CMultiMetricMap::m_gridMaps

STL-like proxy to access this kind of maps in maps.

Definition at line 262 of file maps/CMultiMetricMap.h.

◆ m_heightMaps

ProxyFilterContainerByClass<mrpt::maps::CHeightGridMap2DPtr,TListMaps> mrpt::maps::CMultiMetricMap::m_heightMaps

STL-like proxy to access this kind of maps in maps.

Definition at line 267 of file maps/CMultiMetricMap.h.

◆ m_heightMRFMaps

ProxyFilterContainerByClass<mrpt::maps::CHeightGridMap2D_MRFPtr,TListMaps> mrpt::maps::CMultiMetricMap::m_heightMRFMaps

STL-like proxy to access this kind of maps in maps.

Definition at line 268 of file maps/CMultiMetricMap.h.

◆ m_ID

unsigned int mrpt::maps::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 329 of file maps/CMultiMetricMap.h.

◆ m_landmarksMap

ProxySelectorContainerByClass<mrpt::maps::CLandmarksMapPtr,TListMaps> mrpt::maps::CMultiMetricMap::m_landmarksMap

Proxy that looks like a smart pointer to the first matching object in maps.

Definition at line 272 of file maps/CMultiMetricMap.h.

◆ m_octoMaps

ProxyFilterContainerByClass<mrpt::maps::COctoMapPtr,TListMaps> mrpt::maps::CMultiMetricMap::m_octoMaps

STL-like proxy to access this kind of maps in maps.

Definition at line 263 of file maps/CMultiMetricMap.h.

◆ m_pointsMaps

ProxyFilterContainerByClass<mrpt::maps::CSimplePointsMapPtr,TListMaps> mrpt::maps::CMultiMetricMap::m_pointsMaps

STL-like proxy to access this kind of maps in maps.

Definition at line 261 of file maps/CMultiMetricMap.h.

◆ m_reflectivityMaps

ProxyFilterContainerByClass<mrpt::maps::CReflectivityGridMap2DPtr,TListMaps> mrpt::maps::CMultiMetricMap::m_reflectivityMaps

STL-like proxy to access this kind of maps in maps.

Definition at line 269 of file maps/CMultiMetricMap.h.

◆ m_weightedPointsMap

ProxySelectorContainerByClass<mrpt::maps::CWeightedPointsMapPtr,TListMaps> mrpt::maps::CMultiMetricMap::m_weightedPointsMap

Proxy that looks like a smart pointer to the first matching object in maps.

Definition at line 271 of file maps/CMultiMetricMap.h.

◆ m_wifiGridMaps

ProxyFilterContainerByClass<mrpt::maps::CWirelessPowerGridMap2DPtr,TListMaps> mrpt::maps::CMultiMetricMap::m_wifiGridMaps

STL-like proxy to access this kind of maps in maps.

Definition at line 266 of file maps/CMultiMetricMap.h.

◆ maps

TListMaps mrpt::maps::CMultiMetricMap::maps

The list of MRPT metric maps in this object.

Use dynamic_cast or smart pointer-based downcast to access maps by their actual type. You can directly manipulate this list. Helper methods to initialize it are described in the docs of CMultiMetricMap

Definition at line 148 of file maps/CMultiMetricMap.h.




Page generated by Doxygen 1.8.13 for MRPT 1.5.3 at Tue Aug 22 01:03:35 UTC 2017