Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Classes | Public Member Functions | Static Public Member Functions | 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::make_aligned_shared<mrpt::maps::CSimplePointsMap>();
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 141 of file 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

voidoperator new (size_t size)
 
voidoperator new[] (size_t size)
 
void operator delete (void *ptr) noexcept
 
void operator delete[] (void *ptr) noexcept
 
void operator delete (void *memory, void *ptr) noexcept
 
voidoperator new (size_t size, const std::nothrow_t &) noexcept
 
void operator delete (void *ptr, const std::nothrow_t &) noexcept
 
 CMultiMetricMap (const mrpt::maps::TSetOfMetricMapInitializers *initializers=nullptr)
 Constructor. More...
 
 CMultiMetricMap (const CMultiMetricMap &o)
 
CMultiMetricMapoperator= (const CMultiMetricMap &o)
 
 CMultiMetricMap (CMultiMetricMap &&o)
 
CMultiMetricMapoperator= (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 override
 Returns true if all maps returns true to their isEmpty() method, which is map-dependent. 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 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 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 override
 The implementation in this class just calls all the corresponding method of the contained metric maps. More...
 
void auxParticleFilterCleanUp () 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::CSetOfObjects::Ptr &outObj) const override
 Returns a 3D object representing the map. More...
 
virtual const
mrpt::maps::CSimplePointsMap
getAsSimplePointsMap () const 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::CSimplePointsMap
getAsSimplePointsMap () 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)
 ! 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::CObservation::Ptr &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::CObservation::Ptr &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...
 
RTTI classes and functions
mrpt::utils::CObject::Ptr 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...
 

Static Public Member Functions

static voidoperator 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...
 

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 () override
 Clear all elements of the map. More...
 
bool internal_insertObservation (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=nullptr) override
 Internal method called by insertObservation() More...
 
bool internal_canComputeObservationLikelihood (const mrpt::obs::CObservation *obs) const 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) 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 override
 Introduces a pure virtual method responsible for writing to a CStream. More...
 
void readFromStream (mrpt::utils::CStream &in, int version) override
 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

using Ptr = std::shared_ptr< CMultiMetricMap >
 
using ConstPtr = std::shared_ptr< const CMultiMetricMap >
 
static mrpt::utils::CLASSINIT _init_CMultiMetricMap
 
static const
mrpt::utils::TRuntimeClassId 
runtimeClassId
 
static constexpr const char * className = "CMultiMetricMap"
 
static const
mrpt::utils::TRuntimeClassId
classinfo
 
static const
mrpt::utils::TRuntimeClassId
_GetBaseClass ()
 
static const
mrpt::utils::TRuntimeClassId
GetRuntimeClassIdStatic ()
 
static mrpt::utils::CObjectCreateObject ()
 
template<typename... Args>
static Ptr Create (Args &&...args)
 
virtual const
mrpt::utils::TRuntimeClassId
GetRuntimeClass () const override
 Returns information about the class of an object in runtime. More...
 
virtual mrpt::utils::CObjectclone () const override
 Returns a deep copy (clone) of the object, indepently of its class. More...
 

Access to internal list of maps: direct list, iterators, utility

methods and proxies

typedef std::deque
< mrpt::utils::poly_ptr_ptr
< mrpt::maps::CMetricMap::Ptr > > 
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::CSimplePointsMap::Ptr,
TListMaps
m_pointsMaps
 STL-like proxy to access this kind of maps in maps. More...
 
ProxyFilterContainerByClass
< mrpt::maps::COccupancyGridMap2D::Ptr,
TListMaps
m_gridMaps
 STL-like proxy to access this kind of maps in maps. More...
 
ProxyFilterContainerByClass
< mrpt::maps::COctoMap::Ptr,
TListMaps
m_octoMaps
 STL-like proxy to access this kind of maps in maps. More...
 
ProxyFilterContainerByClass
< mrpt::maps::CColouredOctoMap::Ptr,
TListMaps
m_colourOctoMaps
 STL-like proxy to access this kind of maps in maps. More...
 
ProxyFilterContainerByClass
< mrpt::maps::CGasConcentrationGridMap2D::Ptr,
TListMaps
m_gasGridMaps
 STL-like proxy to access this kind of maps in maps. More...
 
ProxyFilterContainerByClass
< mrpt::maps::CWirelessPowerGridMap2D::Ptr,
TListMaps
m_wifiGridMaps
 STL-like proxy to access this kind of maps in maps. More...
 
ProxyFilterContainerByClass
< mrpt::maps::CHeightGridMap2D::Ptr,
TListMaps
m_heightMaps
 STL-like proxy to access this kind of maps in maps. More...
 
ProxyFilterContainerByClass
< mrpt::maps::CHeightGridMap2D_MRF::Ptr,
TListMaps
m_heightMRFMaps
 STL-like proxy to access this kind of maps in maps. More...
 
ProxyFilterContainerByClass
< mrpt::maps::CReflectivityGridMap2D::Ptr,
TListMaps
m_reflectivityMaps
 STL-like proxy to access this kind of maps in maps. More...
 
ProxySelectorContainerByClass
< mrpt::maps::CColouredPointsMap::Ptr,
TListMaps
m_colourPointsMap
 Proxy that looks like a smart pointer to the first matching object in maps. More...
 
ProxySelectorContainerByClass
< mrpt::maps::CWeightedPointsMap::Ptr,
TListMaps
m_weightedPointsMap
 Proxy that looks like a smart pointer to the first matching object in maps. More...
 
ProxySelectorContainerByClass
< mrpt::maps::CLandmarksMap::Ptr,
TListMaps
m_landmarksMap
 Proxy that looks like a smart pointer to the first matching object in maps. More...
 
ProxySelectorContainerByClass
< mrpt::maps::CBeaconMap::Ptr,
TListMaps
m_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::CMetricMap::Ptr getMapByIndex (size_t idx) const
 Gets the i-th map

Exceptions
std::runtime_errorOn out-of-bounds.
More...
 
template<typename T >
T::Ptr getMapByClass (const size_t &ith=0) const
 Returns the i'th observation of a given class (or of a descendant class), or nullptr if there is no such observation in the array. More...
 

Member Typedef Documentation

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

Definition at line 181 of file CMultiMetricMap.h.

using mrpt::maps::CMultiMetricMap::ConstPtr = std::shared_ptr<const CMultiMetricMap >

Definition at line 143 of file CMultiMetricMap.h.

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

Definition at line 180 of file CMultiMetricMap.h.

A typedef for the associated smart pointer

Definition at line 143 of file CMultiMetricMap.h.

Definition at line 171 of file CMultiMetricMap.h.

Constructor & Destructor Documentation

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

Constructor.

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

Definition at line 183 of file CMultiMetricMap.cpp.

References MRPT_END, MRPT_START, and setListOfMaps().

Here is the call graph for this function:

CMultiMetricMap::CMultiMetricMap ( const CMultiMetricMap o)

Definition at line 192 of file CMultiMetricMap.cpp.

CMultiMetricMap::CMultiMetricMap ( CMultiMetricMap &&  o)

Definition at line 204 of file CMultiMetricMap.cpp.

Member Function Documentation

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

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.

Definition at line 450 of file CMultiMetricMap.cpp.

References MRPT_END, MRPT_START, and MapExecutor::run().

Here is the call graph for this function:

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

Definition at line 182 of file CMultiMetricMap.h.

Referenced by getMapByClass().

Here is the caller graph for this function:

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

Definition at line 183 of file CMultiMetricMap.h.

References maps.

bool 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

Definition at line 180 of file CMetricMap.cpp.

bool CMetricMap::canComputeObservationLikelihood ( const mrpt::obs::CObservation::Ptr 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.

Definition at line 121 of file CMetricMap.cpp.

bool 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

Definition at line 86 of file CMetricMap.cpp.

References mrpt::obs::CSensoryFrame::begin(), and mrpt::obs::CSensoryFrame::end().

Here is the call graph for this function:

void CMetricMap::clear ( )
inherited
virtual mrpt::utils::CObject* mrpt::maps::CMultiMetricMap::clone ( ) const
overridevirtual

Returns a deep copy (clone) of the object, indepently of its class.

Implements mrpt::utils::CObject.

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

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.

Definition at line 422 of file CMultiMetricMap.cpp.

References ASSERT_, mrpt::maps::CMetricMap::compute3DMatchingRatio(), maps, MRPT_END, and MRPT_START.

Referenced by mrpt::slam::CIncrementalMapPartitioner::addMapFrame().

Here is the call graph for this function:

Here is the caller graph for this function:

double 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

Definition at line 189 of file CMetricMap.cpp.

Referenced by mrpt::maps::CMultiMetricMapPDF::PF_SLAM_computeObservationLikelihoodForParticle().

Here is the caller graph for this function:

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

Definition at line 77 of file CMetricMap.cpp.

double 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

Definition at line 67 of file CMetricMap.cpp.

References mrpt::obs::CSensoryFrame::begin(), and mrpt::obs::CSensoryFrame::end().

Referenced by mrpt::hmtslam::CLSLAM_RBPF_2DLASER::auxiliarComputeObservationLikelihood().

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename... Args>
static Ptr mrpt::maps::CMultiMetricMap::Create ( Args &&...  args)
inlinestatic

Definition at line 143 of file CMultiMetricMap.h.

static mrpt::utils::CObject* mrpt::maps::CMultiMetricMap::CreateObject ( )
static
void CMultiMetricMap::deleteAllMaps ( )
protected

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

Definition at line 263 of file CMultiMetricMap.cpp.

References m_ID, maps, and MapExecutor::run().

Referenced by setListOfMaps().

Here is the call graph for this function:

Here is the caller graph for this function:

void 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
overridevirtual

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.

Definition at line 364 of file CMultiMetricMap.cpp.

References ASSERTMSG_, m_pointsMaps, MRPT_END, and MRPT_START.

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

Definition at line 142 of file CMetricMap.cpp.

References MRPT_END, MRPT_START, MRPT_UNUSED_PARAM, and THROW_EXCEPTION.

Referenced by mrpt::slam::CICP::ICP3D_Method_Classic().

Here is the caller graph for this function:

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

Definition at line 184 of file CMultiMetricMap.h.

References maps.

Referenced by getMapByClass().

Here is the caller graph for this function:

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

Definition at line 185 of file CMultiMetricMap.h.

References maps.

void CMultiMetricMap::getAs3DObject ( mrpt::opengl::CSetOfObjects::Ptr outObj) const
overridevirtual

Returns a 3D object representing the map.

Implements mrpt::maps::CMetricMap.

Definition at line 412 of file CMultiMetricMap.cpp.

References MRPT_END, MRPT_START, and MapExecutor::run().

Referenced by mrpt::hmtslam::CHierarchicalMapMHPartition::getAs3DScene().

Here is the call graph for this function:

Here is the caller graph for this function:

const CSimplePointsMap * CMultiMetricMap::getAsSimplePointsMap ( ) const
overridevirtual

If the map is a simple point map or it's a multi-metric map that contains EXACTLY one simple point map, return it.

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

Definition at line 462 of file CMultiMetricMap.cpp.

References ASSERT_, m_pointsMaps, MRPT_END, and MRPT_START.

CSimplePointsMap * CMultiMetricMap::getAsSimplePointsMap ( )
overridevirtual

Reimplemented from mrpt::maps::CMetricMap.

Definition at line 472 of file CMultiMetricMap.cpp.

References ASSERT_, m_pointsMaps, MRPT_END, and MRPT_START.

template<typename T >
T::Ptr 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 nullptr if there is no such observation in the array.

Example:

CObservationImage::Ptr obs =
m_SF->getObservationByClass<CObservationImage>();

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

Definition at line 199 of file CMultiMetricMap.h.

References begin(), and end().

Here is the call graph for this function:

mrpt::maps::CMetricMap::Ptr CMultiMetricMap::getMapByIndex ( size_t  idx) const

Gets the i-th map

Exceptions
std::runtime_errorOn out-of-bounds.

Definition at line 484 of file CMultiMetricMap.cpp.

References ASSERT_BELOW_, and maps.

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

Returns information about the class of an object in runtime.

Reimplemented from mrpt::maps::CMetricMap.

static const mrpt::utils::TRuntimeClassId& mrpt::maps::CMultiMetricMap::GetRuntimeClassIdStatic ( )
static
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 57 of file CObservable.h.

References mrpt::utils::CObservable::m_subscribers.

Referenced by mrpt::gui::CWindowDialog::OnMouseDown(), mrpt::gui::CWindowDialog::OnMouseMove(), mrpt::gui::CWindowDialog::OnResize(), and mrpt::opengl::COpenGLViewport::render().

Here is the caller graph for this function:

bool 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

Definition at line 95 of file CMetricMap.cpp.

Referenced by ICPTests::align2scans(), mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_likelihoodField_Thrun(), mrpt::graphslam::deciders::CRangeScanOps< GRAPH_T >::getICPEdge(), TEST(), and mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::updateMapVisualization().

Here is the caller graph for this function:

bool CMetricMap::insertObservationPtr ( const mrpt::obs::CObservation::Ptr 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

Definition at line 109 of file CMetricMap.cpp.

References MRPT_END, MRPT_START, and THROW_EXCEPTION.

Referenced by mrpt::slam::CMetricMapBuilderICP::processObservation().

Here is the caller graph for this function:

bool CMultiMetricMap::internal_canComputeObservationLikelihood ( const mrpt::obs::CObservation obs) const
overrideprotectedvirtual

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.

Definition at line 337 of file CMultiMetricMap.cpp.

References MapExecutor::run().

Here is the call graph for this function:

void CMultiMetricMap::internal_clear ( )
overrideprotectedvirtual

Clear all elements of the map.

Implements mrpt::maps::CMetricMap.

Definition at line 255 of file CMultiMetricMap.cpp.

References MapExecutor::run().

Here is the call graph for this function:

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

Internal method called by computeObservationLikelihood()

Implements mrpt::maps::CMetricMap.

Definition at line 324 of file CMultiMetricMap.cpp.

References MRPT_CHECK_NORMAL_NUMBER, and MapExecutor::run().

Here is the call graph for this function:

bool CMultiMetricMap::internal_insertObservation ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose3D robotPose = nullptr 
)
overrideprotectedvirtual

Internal method called by insertObservation()

Implements mrpt::maps::CMetricMap.

Definition at line 352 of file CMultiMetricMap.cpp.

References MapExecutor::run().

Here is the call graph for this function:

bool CMultiMetricMap::isEmpty ( ) const
overridevirtual

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.

Definition at line 381 of file CMultiMetricMap.cpp.

References MapExecutor::run().

Here is the call graph for this function:

void 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 done invoking insertObservation() for each observation at the mean 3D robot pose of each pose-observations pair 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 37 of file CMetricMap.cpp.

References ASSERTMSG_, mrpt::utils::clear(), mrpt::maps::CSimpleMap::get(), and mrpt::maps::CSimpleMap::size().

Referenced by mrpt::maps::CMetricMap::loadFromSimpleMap(), and run_test_pf_localization().

Here is the call graph for this function:

Here is the caller graph for this function:

void mrpt::maps::CMetricMap::loadFromSimpleMap ( const mrpt::maps::CSimpleMap Map)
inlineinherited

!

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 109 of file CMetricMap.h.

References mrpt::maps::CMetricMap::loadFromProbabilisticPosesAndObservations().

Referenced by mrpt::maps::CRandomFieldGridMap2D::internal_clear().

Here is the call graph for this function:

Here is the caller graph for this function:

void mrpt::maps::CMultiMetricMap::operator delete ( void ptr)
inlinenoexcept

Definition at line 143 of file CMultiMetricMap.h.

void mrpt::maps::CMultiMetricMap::operator delete ( void memory,
void ptr 
)
inlinenoexcept

Definition at line 143 of file CMultiMetricMap.h.

void mrpt::maps::CMultiMetricMap::operator delete ( void ptr,
const std::nothrow_t &   
)
inlinenoexcept

Definition at line 143 of file CMultiMetricMap.h.

void mrpt::maps::CMultiMetricMap::operator delete[] ( void ptr)
inlinenoexcept

Definition at line 143 of file CMultiMetricMap.h.

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

Definition at line 143 of file CMultiMetricMap.h.

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

Definition at line 143 of file CMultiMetricMap.h.

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

Definition at line 143 of file CMultiMetricMap.h.

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

Definition at line 143 of file CMultiMetricMap.h.

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

Definition at line 197 of file CMultiMetricMap.cpp.

References m_ID, and maps.

CMultiMetricMap & CMultiMetricMap::operator= ( CMultiMetricMap &&  o)

Definition at line 209 of file CMultiMetricMap.cpp.

References m_ID, and maps.

void CObservable::publishEvent ( const mrptEvent e) const
protectedinherited
void CMultiMetricMap::readFromStream ( mrpt::utils::CStream in,
int  version 
)
overrideprotectedvirtual

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.

Definition at line 296 of file CMultiMetricMap.cpp.

References m_ID, maps, and MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION.

void CMultiMetricMap::saveMetricMapRepresentationToFile ( const std::string filNamePrefix) const
overridevirtual

The implementation in this class just calls all the corresponding method of the contained metric maps.

Implements mrpt::maps::CMetricMap.

Definition at line 389 of file CMultiMetricMap.cpp.

References ASSERT_, mrpt::utils::TRuntimeClassId::className, mrpt::format(), mrpt::maps::CMetricMap::GetRuntimeClass(), maps, MRPT_END, MRPT_START, and mrpt::maps::CMetricMap::saveMetricMapRepresentationToFile().

Here is the call graph for this function:

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

References setListOfMaps().

Here is the call graph for this function:

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

Definition at line 170 of file CMetricMap.cpp.

References MRPT_END, MRPT_START, MRPT_UNUSED_PARAM, and THROW_EXCEPTION.

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 nullptr is class does not support conversion to MATLAB.

Definition at line 89 of file CSerializable.h.

void CMultiMetricMap::writeToStream ( mrpt::utils::CStream out,
int *  getVersion 
) const
overrideprotectedvirtual

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 nullptr, 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.

Definition at line 278 of file CMultiMetricMap.cpp.

References m_ID, and maps.

Member Data Documentation

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

Definition at line 143 of file CMultiMetricMap.h.

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

Definition at line 143 of file CMultiMetricMap.h.

constexpr const char* mrpt::maps::CMultiMetricMap::className = "CMultiMetricMap"
static

Definition at line 143 of file CMultiMetricMap.h.

TMapGenericParams mrpt::maps::CMetricMap::genericMapParams
inherited
ProxySelectorContainerByClass<mrpt::maps::CBeaconMap::Ptr, TListMaps> mrpt::maps::CMultiMetricMap::m_beaconMap

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

Definition at line 407 of file CMultiMetricMap.h.

ProxyFilterContainerByClass<mrpt::maps::CColouredOctoMap::Ptr, TListMaps> mrpt::maps::CMultiMetricMap::m_colourOctoMaps

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

Definition at line 370 of file CMultiMetricMap.h.

ProxySelectorContainerByClass<mrpt::maps::CColouredPointsMap::Ptr, TListMaps> mrpt::maps::CMultiMetricMap::m_colourPointsMap

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

Definition at line 394 of file CMultiMetricMap.h.

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

Definition at line 374 of file CMultiMetricMap.h.

ProxyFilterContainerByClass<mrpt::maps::CHeightGridMap2D::Ptr, TListMaps> mrpt::maps::CMultiMetricMap::m_heightMaps

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

Definition at line 381 of file CMultiMetricMap.h.

ProxyFilterContainerByClass<mrpt::maps::CHeightGridMap2D_MRF::Ptr, TListMaps> mrpt::maps::CMultiMetricMap::m_heightMRFMaps

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

Definition at line 385 of file CMultiMetricMap.h.

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

Referenced by deleteAllMaps(), operator=(), readFromStream(), and writeToStream().

ProxySelectorContainerByClass<mrpt::maps::CLandmarksMap::Ptr, TListMaps> mrpt::maps::CMultiMetricMap::m_landmarksMap

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

Definition at line 403 of file CMultiMetricMap.h.

Referenced by mrpt::slam::CIncrementalMapPartitioner::addMapFrame().

ProxyFilterContainerByClass<mrpt::maps::COctoMap::Ptr, TListMaps> mrpt::maps::CMultiMetricMap::m_octoMaps

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

Definition at line 367 of file CMultiMetricMap.h.

ProxyFilterContainerByClass<mrpt::maps::CSimplePointsMap::Ptr, TListMaps> mrpt::maps::CMultiMetricMap::m_pointsMaps
ProxyFilterContainerByClass<mrpt::maps::CReflectivityGridMap2D::Ptr, TListMaps> mrpt::maps::CMultiMetricMap::m_reflectivityMaps

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

Definition at line 389 of file CMultiMetricMap.h.

ProxySelectorContainerByClass<mrpt::maps::CWeightedPointsMap::Ptr, TListMaps> mrpt::maps::CMultiMetricMap::m_weightedPointsMap

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

Definition at line 399 of file CMultiMetricMap.h.

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

Definition at line 378 of file CMultiMetricMap.h.

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

Referenced by begin(), compute3DMatchingRatio(), deleteAllMaps(), end(), getMapByIndex(), operator=(), readFromStream(), saveMetricMapRepresentationToFile(), setListOfMaps(), and writeToStream().

const mrpt::utils::TRuntimeClassId mrpt::maps::CMultiMetricMap::runtimeClassId
staticprotected

Definition at line 143 of file CMultiMetricMap.h.




Page generated by Doxygen 1.8.6 for MRPT 1.9.9 Git: 6d99412 Sat Nov 18 10:43:44 2017 +0100 at sáb nov 18 10:50:13 CET 2017