MRPT  1.9.9
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::mapByIndex() 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 programmatically. 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

Method #1: Using map definition structures

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

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

Method #3: Manual manipulation

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

#include <mrpt/maps/CMultiMetricMap.h>

Inheritance diagram for mrpt::maps::CMultiMetricMap:

Public Member Functions

 CMultiMetricMap ()=default
 Default ctor: empty list of maps. More...
 
 CMultiMetricMap (const TSetOfMetricMapInitializers &initializers)
 Constructor with a list of map initializers. More...
 
void setListOfMaps (const mrpt::maps::TSetOfMetricMapInitializers &init)
 Sets the list of internal map according to the passed list of map initializers (current maps will be deleted) More...
 
bool isEmpty () const override
 Returns true if all maps returns true in their isEmpty() method. More...
 
void determineMatching2D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose2D &otherMapPose, mrpt::tfest::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
 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. More...
 
void saveMetricMapRepresentationToFile (const std::string &filNamePrefix) const override
 This virtual method saves the map to a file "filNamePrefix"+< some_file_extension >, as an image or in any other applicable way (Notice that other methods to save the map may be implemented in classes implementing this virtual interface). 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...
 
const mrpt::maps::CSimplePointsMapgetAsSimplePointsMap () const override
 If the map is a simple points map or it's a multi-metric map that contains EXACTLY one simple points map, return it. More...
 
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=nullptr)
 Insert the observation information into this map. More...
 
bool insertObservationPtr (const mrpt::obs::CObservation::Ptr &obs, const mrpt::poses::CPose3D *robotPose=nullptr)
 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::tfest::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...
 
mrpt::maps::CSimplePointsMapgetAsSimplePointsMap ()
 
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 for polymorphic hierarchies
mrpt::rtti::CObject::Ptr duplicateGetSmartPtr () const
 Makes a deep copy of the object and returns a smart pointer to it. More...
 

Public Attributes

TMapGenericParams genericMapParams
 Common params to all maps. More...
 

Protected Member Functions

void internal_clear () override
 Internal method called by clear() 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
 Internal method called by canComputeObservationLikelihood() 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
uint8_t serializeGetVersion () const override
 Must return the current versioning number of the object. More...
 
void serializeTo (mrpt::serialization::CArchive &out) const override
 Pure virtual method for writing (serializing) to an abstract archive. More...
 
void serializeFrom (mrpt::serialization::CArchive &in, uint8_t serial_version) override
 Pure virtual method for reading (deserializing) from an abstract archive. More...
 
CSerializable virtual methods
virtual void serializeTo (CSchemeArchiveBase &out) const
 Virtual method for writing (serializing) to an abstract schema based archive. More...
 
virtual void serializeFrom (CSchemeArchiveBase &in)
 Virtual method for reading (deserializing) from an abstract schema based archive. More...
 

RTTI stuff

using Ptr = std::shared_ptr< CMultiMetricMap >
 
using ConstPtr = std::shared_ptr< const CMultiMetricMap >
 
using UniquePtr = std::unique_ptr< CMultiMetricMap >
 
using ConstUniquePtr = std::unique_ptr< const CMultiMetricMap >
 
static mrpt::rtti::CLASSINIT _init_CMultiMetricMap
 
static const mrpt::rtti::TRuntimeClassId runtimeClassId
 
static constexpr const char * className = "CMultiMetricMap"
 
static const mrpt::rtti::TRuntimeClassId_GetBaseClass ()
 
static constexpr auto getClassName ()
 
static const mrpt::rtti::TRuntimeClassIdGetRuntimeClassIdStatic ()
 
static mrpt::rtti::CObjectCreateObject ()
 
template<typename... Args>
static Ptr Create (Args &&... args)
 
template<typename Alloc , typename... Args>
static Ptr CreateAlloc (const Alloc &alloc, Args &&... args)
 
template<typename... Args>
static UniquePtr CreateUnique (Args &&... args)
 
virtual const mrpt::rtti::TRuntimeClassIdGetRuntimeClass () const override
 Returns information about the class of an object in runtime. More...
 
virtual mrpt::rtti::CObjectclone () const override
 Returns a deep copy (clone) of the object, indepently of its class. More...
 

Access to list of maps

using TListMaps = std::deque< mrpt::containers::deepcopy_poly_ptr< mrpt::maps::CMetricMap::Ptr > >
 
using iterator = TListMaps::iterator
 
using const_iterator = TListMaps::const_iterator
 
TListMaps maps
 The list of metric maps in this object. More...
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
mrpt::maps::CMetricMap::Ptr mapByIndex (size_t idx) const
 Gets the i-th map On out-of-bounds. More...
 
template<typename T >
T::Ptr mapByClass (const size_t &ith=0) const
 Returns the i'th map of a given class (or of a derived class), or empty smart pointer if there is no such map. More...
 
template<typename T >
std::size_t countMapsByClass () const
 Count how many maps exist of the given class (or derived class) More...
 

Member Typedef Documentation

◆ const_iterator

using mrpt::maps::CMultiMetricMap::const_iterator = TListMaps::const_iterator

Definition at line 137 of file CMultiMetricMap.h.

◆ ConstPtr

◆ ConstUniquePtr

Definition at line 122 of file CMultiMetricMap.h.

◆ iterator

using mrpt::maps::CMultiMetricMap::iterator = TListMaps::iterator

Definition at line 136 of file CMultiMetricMap.h.

◆ Ptr

A type for the associated smart pointer

Definition at line 122 of file CMultiMetricMap.h.

◆ TListMaps

◆ UniquePtr

Definition at line 122 of file CMultiMetricMap.h.

Constructor & Destructor Documentation

◆ CMultiMetricMap() [1/2]

mrpt::maps::CMultiMetricMap::CMultiMetricMap ( )
default

Default ctor: empty list of maps.

◆ CMultiMetricMap() [2/2]

CMultiMetricMap::CMultiMetricMap ( const TSetOfMetricMapInitializers initializers)

Constructor with a list of map initializers.

Parameters
initializersOne internal map will be created for each entry in this "TSetOfMetricMapInitializers" struct.

Definition at line 105 of file CMultiMetricMap.cpp.

References MRPT_END, and MRPT_START.

Member Function Documentation

◆ _GetBaseClass()

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

◆ auxParticleFilterCleanUp()

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 293 of file CMultiMetricMap.cpp.

References MRPT_END, and MRPT_START.

◆ begin() [1/2]

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

Definition at line 138 of file CMultiMetricMap.h.

References maps.

◆ begin() [2/2]

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

Definition at line 139 of file CMultiMetricMap.h.

References maps.

◆ canComputeObservationLikelihood() [1/2]

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 178 of file CMetricMap.cpp.

◆ canComputeObservationLikelihood() [2/2]

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 119 of file CMetricMap.cpp.

◆ canComputeObservationsLikelihood()

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 85 of file CMetricMap.cpp.

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

Here is the call graph for this function:

◆ clear()

◆ clone()

virtual mrpt::rtti::CObject* mrpt::maps::CMultiMetricMap::clone ( ) const
overridevirtual

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

Implements mrpt::rtti::CObject.

◆ compute3DMatchingRatio()

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

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".
params[IN] Matching parameters
Returns
The matching ratio [0,1]
See also
determineMatching2D

Reimplemented from mrpt::maps::CMetricMap.

Definition at line 268 of file CMultiMetricMap.cpp.

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

Here is the call graph for this function:

◆ computeObservationLikelihood() [1/2]

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 187 of file CMetricMap.cpp.

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

Here is the caller graph for this function:

◆ computeObservationLikelihood() [2/2]

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 76 of file CMetricMap.cpp.

◆ computeObservationsLikelihood()

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 66 of file CMetricMap.cpp.

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

Here is the caller graph for this function:

◆ countMapsByClass()

template<typename T >
std::size_t mrpt::maps::CMultiMetricMap::countMapsByClass ( ) const
inline

Count how many maps exist of the given class (or derived class)

Definition at line 169 of file CMultiMetricMap.h.

Referenced by mrpt::slam::CGridMapAligner::AlignPDF_robustMatch(), and mrpt::slam::CMetricMapBuilderICP::processObservation().

Here is the caller graph for this function:

◆ Create()

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

Definition at line 122 of file CMultiMetricMap.h.

◆ CreateAlloc()

template<typename Alloc , typename... Args>
static Ptr mrpt::maps::CMultiMetricMap::CreateAlloc ( const Alloc &  alloc,
Args &&...  args 
)
inlinestatic

Definition at line 122 of file CMultiMetricMap.h.

◆ CreateObject()

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

◆ CreateUnique()

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

Definition at line 122 of file CMultiMetricMap.h.

◆ determineMatching2D()

void CMultiMetricMap::determineMatching2D ( const mrpt::maps::CMetricMap otherMap,
const mrpt::poses::CPose2D otherMapPose,
mrpt::tfest::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 214 of file CMultiMetricMap.cpp.

References ASSERTMSG_, MRPT_END, and MRPT_START.

◆ determineMatching3D()

void CMetricMap::determineMatching3D ( const mrpt::maps::CMetricMap otherMap,
const mrpt::poses::CPose3D otherMapPose,
mrpt::tfest::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 140 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:

◆ duplicateGetSmartPtr()

mrpt::rtti::CObject::Ptr CObject::duplicateGetSmartPtr ( ) const
inlineinherited

Makes a deep copy of the object and returns a smart pointer to it.

Definition at line 170 of file CObject.h.

References mrpt::rtti::CObject::clone().

Referenced by mrpt::obs::CRawlog::addActions(), and mrpt::obs::CRawlog::addObservations().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ end() [1/2]

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

Definition at line 140 of file CMultiMetricMap.h.

References maps.

◆ end() [2/2]

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

Definition at line 141 of file CMultiMetricMap.h.

References maps.

◆ getAs3DObject()

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

Returns a 3D object representing the map.

See also
genericMapParams, TMapGenericParams::enableSaveAs3DObject

Implements mrpt::maps::CMetricMap.

Definition at line 257 of file CMultiMetricMap.cpp.

References MRPT_END, and MRPT_START.

◆ getAsSimplePointsMap() [1/2]

const CSimplePointsMap * CMultiMetricMap::getAsSimplePointsMap ( ) const
overridevirtual

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 nullptr

Reimplemented from mrpt::maps::CMetricMap.

Definition at line 302 of file CMultiMetricMap.cpp.

References ASSERT_, MRPT_END, and MRPT_START.

◆ getAsSimplePointsMap() [2/2]

mrpt::maps::CSimplePointsMap* mrpt::maps::CMetricMap::getAsSimplePointsMap ( )
inlineinherited

Definition at line 304 of file CMetricMap.h.

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

Here is the call graph for this function:

◆ getClassName()

static constexpr auto mrpt::maps::CMultiMetricMap::getClassName ( )
inlinestatic

Definition at line 122 of file CMultiMetricMap.h.

◆ GetRuntimeClass()

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

Returns information about the class of an object in runtime.

Reimplemented from mrpt::maps::CMetricMap.

◆ GetRuntimeClassIdStatic()

static const mrpt::rtti::TRuntimeClassId& mrpt::maps::CMultiMetricMap::GetRuntimeClassIdStatic ( )
static

◆ hasSubscribers()

bool mrpt::system::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 53 of file CObservable.h.

References mrpt::system::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:

◆ insertObservation()

bool CMetricMap::insertObservation ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose3D robotPose = nullptr 
)
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 93 of file CMetricMap.cpp.

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

Here is the caller graph for this function:

◆ insertObservationPtr()

bool CMetricMap::insertObservationPtr ( const mrpt::obs::CObservation::Ptr obs,
const mrpt::poses::CPose3D robotPose = nullptr 
)
inherited

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

See: Maps and observations compatibility matrix

Definition at line 107 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:

◆ internal_canComputeObservationLikelihood()

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

Internal method called by canComputeObservationLikelihood()

Reimplemented from mrpt::maps::CMetricMap.

Definition at line 192 of file CMultiMetricMap.cpp.

◆ internal_clear()

void CMultiMetricMap::internal_clear ( )
overrideprotectedvirtual

Internal method called by clear()

Implements mrpt::maps::CMetricMap.

Definition at line 132 of file CMultiMetricMap.cpp.

◆ internal_computeObservationLikelihood()

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 177 of file CMultiMetricMap.cpp.

References MRPT_END, and MRPT_START.

◆ internal_insertObservation()

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 202 of file CMultiMetricMap.cpp.

◆ isEmpty()

bool CMultiMetricMap::isEmpty ( ) const
overridevirtual

Returns true if all maps returns true in their isEmpty() method.

Implements mrpt::maps::CMetricMap.

Definition at line 230 of file CMultiMetricMap.cpp.

References MapExecutor::run().

Here is the call graph for this function:

◆ loadFromProbabilisticPosesAndObservations()

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 36 of file CMetricMap.cpp.

References ASSERTMSG_, mrpt::containers::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:

◆ loadFromSimpleMap()

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 107 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:

◆ mapByClass()

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

Returns the i'th map of a given class (or of a derived class), or empty smart pointer if there is no such map.

Example:

multimap.mapByClass<COccupancyGridMap2D>();

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

Definition at line 156 of file CMultiMetricMap.h.

Referenced by mrpt::slam::CGridMapAligner::AlignPDF_robustMatch(), mrpt::slam::CMetricMapBuilderICP::getCurrentMapPoints(), mrpt::detectors::CDetectorDoorCrossing::process(), mrpt::slam::CMetricMapBuilderICP::processObservation(), run_test_pf_localization(), and mrpt::slam::CMetricMapBuilderICP::saveCurrentEstimationToImage().

Here is the caller graph for this function:

◆ mapByIndex()

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

Gets the i-th map On out-of-bounds.

Definition at line 314 of file CMultiMetricMap.cpp.

References MRPT_END, and MRPT_START.

◆ publishEvent()

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

Definition at line 48 of file CObservable.cpp.

References MRPT_END, and MRPT_START.

Referenced by mrpt::gui::CDisplayWindow3D::internal_emitGrabImageEvent(), mrpt::gui::CWindowDialog::OnChar(), mrpt::gui::CWindowDialog::OnClose(), mrpt::gui::C3DWindowDialog::OnClose(), mrpt::gui::CWindowDialog::OnMouseDown(), mrpt::gui::CWindowDialog::OnMouseMove(), mrpt::gui::CWindowDialog::OnResize(), mrpt::gui::C3DWindowDialog::OnResize(), and mrpt::opengl::COpenGLViewport::render().

Here is the caller graph for this function:

◆ saveMetricMapRepresentationToFile()

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

This virtual method saves the map to a file "filNamePrefix"+< some_file_extension >, as an image or in any other applicable way (Notice that other methods to save the map may be implemented in classes implementing this virtual interface).

Implements mrpt::maps::CMetricMap.

Definition at line 238 of file CMultiMetricMap.cpp.

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

Here is the call graph for this function:

◆ serializeFrom() [1/2]

virtual void mrpt::serialization::CSerializable::serializeFrom ( CSchemeArchiveBase in)
inlineprotectedvirtualinherited

Virtual method for reading (deserializing) from an abstract schema based archive.

Definition at line 74 of file CSerializable.h.

References mrpt::serialization::CSerializable::GetRuntimeClass(), and THROW_EXCEPTION.

Here is the call graph for this function:

◆ serializeFrom() [2/2]

void CMultiMetricMap::serializeFrom ( mrpt::serialization::CArchive in,
uint8_t  serial_version 
)
overrideprotectedvirtual

Pure virtual method for reading (deserializing) from an abstract archive.

Users don't call this method directly. Instead, use stream >> object;.

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 I/O error

Implements mrpt::serialization::CSerializable.

Definition at line 147 of file CMultiMetricMap.cpp.

References MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION.

◆ serializeGetVersion()

uint8_t CMultiMetricMap::serializeGetVersion ( ) const
overrideprotectedvirtual

Must return the current versioning number of the object.

Start in zero for new classes, and increments each time there is a change in the stored format.

Implements mrpt::serialization::CSerializable.

Definition at line 139 of file CMultiMetricMap.cpp.

◆ serializeTo() [1/2]

virtual void mrpt::serialization::CSerializable::serializeTo ( CSchemeArchiveBase out) const
inlineprotectedvirtualinherited

Virtual method for writing (serializing) to an abstract schema based archive.

Definition at line 64 of file CSerializable.h.

References mrpt::serialization::CSerializable::GetRuntimeClass(), and THROW_EXCEPTION.

Here is the call graph for this function:

◆ serializeTo() [2/2]

void CMultiMetricMap::serializeTo ( mrpt::serialization::CArchive out) const
overrideprotectedvirtual

Pure virtual method for writing (serializing) to an abstract archive.

Users don't call this method directly. Instead, use stream << object;.

Exceptions
std::exceptionOn any I/O error

Implements mrpt::serialization::CSerializable.

Definition at line 140 of file CMultiMetricMap.cpp.

◆ setListOfMaps()

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

Sets the list of internal map according to the passed list of map initializers (current maps will be deleted)

Definition at line 112 of file CMultiMetricMap.cpp.

References ASSERT_, mrpt::maps::internal::TMetricMapTypesRegistry::Instance(), MRPT_END, and MRPT_START.

Referenced by mrpt::slam::CMetricMapBuilderICP::initialize(), and run_test_pf_localization().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ squareDistanceToClosestCorrespondence()

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 168 of file CMetricMap.cpp.

References MRPT_END, MRPT_START, MRPT_UNUSED_PARAM, and THROW_EXCEPTION.

◆ writeToMatlab()

virtual mxArray* mrpt::serialization::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 90 of file CSerializable.h.

Member Data Documentation

◆ _init_CMultiMetricMap

mrpt::rtti::CLASSINIT mrpt::maps::CMultiMetricMap::_init_CMultiMetricMap
staticprotected

Definition at line 122 of file CMultiMetricMap.h.

◆ className

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

Definition at line 122 of file CMultiMetricMap.h.

◆ genericMapParams

◆ maps

TListMaps mrpt::maps::CMultiMetricMap::maps

The list of 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 134 of file CMultiMetricMap.h.

Referenced by begin(), and end().

◆ runtimeClassId

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

Definition at line 122 of file CMultiMetricMap.h.




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 363e65e4a Wed Jun 19 01:52:47 2019 +0200 at miƩ jun 19 02:00:17 CEST 2019