Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
mrpt::maps::CBeaconMap Class Reference

Detailed Description

A class for storing a map of 3D probabilistic beacons, using a Montecarlo, Gaussian, or Sum of Gaussians (SOG) representation (for range-only SLAM).


The individual beacons are defined as mrpt::maps::CBeacon objects.
When invoking CBeaconMap::insertObservation(), landmarks will be extracted and fused into the map. The only currently supported observation type is mrpt::obs::CObservationBeaconRanges. See insertionOptions and likelihoodOptions for parameters used when creating and fusing beacon landmarks.
Use "TInsertionOptions::insertAsMonteCarlo" to select between 2 different behaviors:

Refer to the papers: []

See also
CMetricMap

Definition at line 46 of file CBeaconMap.h.

#include <mrpt/maps/CBeaconMap.h>

Inheritance diagram for mrpt::maps::CBeaconMap:
Inheritance graph

Classes

struct  TInsertionOptions
 This struct contains data for choosing the method by which new beacons are inserted in the map. More...
 
struct  TLikelihoodOptions
 With this struct options are provided to the likelihood computations. More...
 
struct  TMapDefinition
 
struct  TMapDefinitionBase
 

Public Types

using TSequenceBeacons = std::deque< CBeacon >
 
using iterator = std::deque< CBeacon >::iterator
 
using const_iterator = std::deque< CBeacon >::const_iterator
 

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
 
 CBeaconMap ()
 Constructor. More...
 
void resize (const size_t N)
 Resize the number of SOG modes. More...
 
const CBeaconoperator[] (size_t i) const
 Access to individual beacons. More...
 
const CBeaconget (size_t i) const
 Access to individual beacons. More...
 
CBeaconoperator[] (size_t i)
 Access to individual beacons. More...
 
CBeaconget (size_t i)
 Access to individual beacons. More...
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
void push_back (const CBeacon &m)
 Inserts a copy of the given mode into the SOG. 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...
 
bool saveToMATLABScript3D (const std::string &file, const char *style="b", float confInterval=0.95f) const
 Save to a MATLAB script which displays 3D error ellipses for the map. More...
 
size_t size () const
 Returns the stored landmarks count. More...
 
virtual void determineMatching2D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose2D &otherMapPose, mrpt::tfest::TMatchingPairList &correspondences, const TMatchingParams &params, TMatchingExtraResults &extraResults) const override
 Computes the matching between this and another 2D point map, which includes finding: More...
 
void computeMatchingWith3DLandmarks (const mrpt::maps::CBeaconMap *otherMap, mrpt::tfest::TMatchingPairList &correspondences, float &correspondencesRatio, std::vector< bool > &otherCorrespondences) const
 Perform a search for correspondences between "this" and another lansmarks map: Firsly, the landmarks' descriptor is used to find correspondences, then inconsistent ones removed by looking at their 3D poses. More...
 
void changeCoordinatesReference (const mrpt::poses::CPose3D &newOrg)
 Changes the reference system of the map to a given 3D pose. More...
 
void changeCoordinatesReference (const mrpt::poses::CPose3D &newOrg, const mrpt::maps::CBeaconMap *otherMap)
 Changes the reference system of the map "otherMap" and save the result in "this" map. More...
 
bool isEmpty () const override
 Returns true if the map is empty/no observation has been inserted. More...
 
void simulateBeaconReadings (const mrpt::poses::CPose3D &in_robotPose, const mrpt::poses::CPoint3D &in_sensorLocationOnRobot, mrpt::obs::CObservationBeaconRanges &out_Observations) const
 Simulates a reading toward each of the beacons in the landmarks map, if any. 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 saveToTextFile (const std::string &fil) const
 Save a text file with a row per beacon, containing this 11 elements: More...
 
void getAs3DObject (mrpt::opengl::CSetOfObjects::Ptr &outObj) const override
 Returns a 3D object representing the map. More...
 
const CBeacongetBeaconByID (CBeacon::TBeaconID id) const
 Returns a pointer to the beacon with the given ID, or nullptr if it does not exist. More...
 
CBeacongetBeaconByID (CBeacon::TBeaconID id)
 Returns a pointer to the beacon with the given ID, or nullptr if it does not exist. 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)
 !This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. 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)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
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
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
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 void auxParticleFilterCleanUp ()
 This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation". 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 const mrpt::maps::CSimplePointsMapgetAsSimplePointsMap () const
 If the map is a simple points map or it's a multi-metric map that contains EXACTLY one simple points map, return it. More...
 
virtual 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...
 

Static Public Member Functions

static voidoperator new (size_t size, void *ptr)
 

Public Attributes

mrpt::maps::CBeaconMap::TLikelihoodOptions likelihoodOptions
 
mrpt::maps::CBeaconMap::TInsertionOptions insertionOptions
 
TMapGenericParams genericMapParams
 Common params to all maps. More...
 

Protected Member Functions

virtual void internal_clear () override
 Internal method called by clear() More...
 
virtual bool internal_insertObservation (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=nullptr) override
 Internal method called by insertObservation() 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...
 

Protected Attributes

TSequenceBeacons m_beacons
 The individual beacons. More...
 

Private Member Functions

virtual bool internal_canComputeObservationLikelihood (const mrpt::obs::CObservation *obs) const
 Internal method called by canComputeObservationLikelihood() More...
 
virtual void OnPostSuccesfulInsertObs (const mrpt::obs::CObservation *)
 Hook for each time a "internal_insertObservation" returns "true" This is called automatically from insertObservation() when internal_insertObservation returns true. More...
 
void internal_observer_begin (CObserver *)
 
void internal_observer_end (CObserver *)
 

Private Attributes

std::set< CObserver * > m_subscribers
 

RTTI stuff


using Ptr = std::shared_ptr< CBeaconMap >
 
using ConstPtr = std::shared_ptr< const CBeaconMap >
 
using UniquePtr = std::unique_ptr< CBeaconMap >
 
using ConstUniquePtr = std::unique_ptr< const CBeaconMap >
 
static mrpt::rtti::CLASSINIT _init_CBeaconMap
 
static const mrpt::rtti::TRuntimeClassId runtimeClassId
 
static constexpr const char * className = "CBeaconMap"
 
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... 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...
 

Map Definition Interface stuff (see * mrpt::maps::TMetricMapInitializer) @{

static const size_t m_private_map_register_id = mrpt::maps::internal::TMetricMapTypesRegistry::Instance().doRegister( "CBeaconMap,beaconMap" , & mrpt::maps::CBeaconMap ::MapDefinition, & mrpt::maps::CBeaconMap ::internal_CreateFromMapDefinition)
 ID used to initialize class registration (just ignore it) More...
 
static mrpt::maps::TMetricMapInitializerMapDefinition ()
 Returns default map definition initializer. More...
 
static CBeaconMapCreateFromMapDefinition (const mrpt::maps::TMetricMapInitializer &def)
 Constructor from a map definition structure: initializes the map and * its parameters accordingly. More...
 
static mrpt::maps::CMetricMapinternal_CreateFromMapDefinition (const mrpt::maps::TMetricMapInitializer &def)
 

Member Typedef Documentation

◆ const_iterator

Definition at line 53 of file CBeaconMap.h.

◆ ConstPtr

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

Definition at line 48 of file CBeaconMap.h.

◆ ConstUniquePtr

using mrpt::maps::CBeaconMap::ConstUniquePtr = std::unique_ptr<const CBeaconMap >

Definition at line 48 of file CBeaconMap.h.

◆ iterator

Definition at line 52 of file CBeaconMap.h.

◆ Ptr

using mrpt::maps::CBeaconMap::Ptr = std::shared_ptr< CBeaconMap >

A type for the associated smart pointer

Definition at line 48 of file CBeaconMap.h.

◆ TSequenceBeacons

Definition at line 51 of file CBeaconMap.h.

◆ UniquePtr

using mrpt::maps::CBeaconMap::UniquePtr = std::unique_ptr< CBeaconMap >

Definition at line 48 of file CBeaconMap.h.

Constructor & Destructor Documentation

◆ CBeaconMap()

CBeaconMap::CBeaconMap ( )

Constructor.

Definition at line 87 of file CBeaconMap.cpp.

Member Function Documentation

◆ _GetBaseClass()

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

◆ auxParticleFilterCleanUp()

virtual void mrpt::maps::CMetricMap::auxParticleFilterCleanUp ( )
inlinevirtualinherited

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 in mrpt::maps::CLandmarksMap, and mrpt::maps::CMultiMetricMap.

Definition at line 290 of file CMetricMap.h.

◆ begin() [1/2]

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

Definition at line 100 of file CBeaconMap.h.

References m_beacons.

◆ begin() [2/2]

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

Definition at line 101 of file CBeaconMap.h.

References m_beacons.

◆ 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 180 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 121 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 86 of file CMetricMap.cpp.

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

◆ changeCoordinatesReference() [1/2]

void CBeaconMap::changeCoordinatesReference ( const mrpt::poses::CPose3D newOrg)

Changes the reference system of the map to a given 3D pose.

Definition at line 823 of file CBeaconMap.cpp.

Referenced by compute3DMatchingRatio(), and determineMatching2D().

◆ changeCoordinatesReference() [2/2]

void CBeaconMap::changeCoordinatesReference ( const mrpt::poses::CPose3D newOrg,
const mrpt::maps::CBeaconMap otherMap 
)

Changes the reference system of the map "otherMap" and save the result in "this" map.

Definition at line 833 of file CBeaconMap.cpp.

◆ clear()

void CMetricMap::clear ( )
inherited

◆ clone()

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

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

Implements mrpt::rtti::CObject.

◆ compute3DMatchingRatio()

float CBeaconMap::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 1195 of file CBeaconMap.cpp.

References changeCoordinatesReference(), CLASS_ID, mrpt::maps::CMetricMap::GetRuntimeClass(), MRPT_END, and MRPT_START.

◆ computeMatchingWith3DLandmarks()

void CBeaconMap::computeMatchingWith3DLandmarks ( const mrpt::maps::CBeaconMap otherMap,
mrpt::tfest::TMatchingPairList correspondences,
float &  correspondencesRatio,
std::vector< bool > &  otherCorrespondences 
) const

Perform a search for correspondences between "this" and another lansmarks map: Firsly, the landmarks' descriptor is used to find correspondences, then inconsistent ones removed by looking at their 3D poses.

Parameters
otherMap[IN] The other map.
correspondences[OUT] The matched pairs between maps.
correspondencesRatio[OUT] This is NumberOfMatchings / NumberOfLandmarksInTheAnotherMap
otherCorrespondences[OUT] Will be returned with a vector containing "true" for the indexes of the other map's landmarks with a correspondence.

Definition at line 845 of file CBeaconMap.cpp.

References m_beacons, MRPT_END, MRPT_START, mrpt::tfest::TMatchingPair::other_idx, mrpt::tfest::TMatchingPair::other_x, mrpt::tfest::TMatchingPair::other_y, mrpt::tfest::TMatchingPair::other_z, mrpt::tfest::TMatchingPair::this_idx, mrpt::tfest::TMatchingPair::this_x, mrpt::tfest::TMatchingPair::this_y, mrpt::tfest::TMatchingPair::this_z, mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::x(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::y().

◆ computeObservationLikelihood() [1/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 77 of file CMetricMap.cpp.

◆ computeObservationLikelihood() [2/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 189 of file CMetricMap.cpp.

Referenced by mrpt::slam::CMonteCarloLocalization3D::PF_SLAM_computeObservationLikelihoodForParticle(), mrpt::slam::CMonteCarloLocalization2D::PF_SLAM_computeObservationLikelihoodForParticle(), and mrpt::maps::CMultiMetricMapPDF::PF_SLAM_computeObservationLikelihoodForParticle().

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

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

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

◆ Create()

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

Definition at line 48 of file CBeaconMap.h.

◆ CreateFromMapDefinition()

mrpt::maps::CBeaconMap * mrpt::maps::CBeaconMap::CreateFromMapDefinition ( const mrpt::maps::TMetricMapInitializer def)
static

Constructor from a map definition structure: initializes the map and * its parameters accordingly.

Definition at line 43 of file CBeaconMap.cpp.

◆ CreateObject()

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

◆ CreateUnique()

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

Definition at line 48 of file CBeaconMap.h.

◆ determineMatching2D()

void CBeaconMap::determineMatching2D ( const mrpt::maps::CMetricMap otherMap,
const mrpt::poses::CPose2D otherMapPose,
mrpt::tfest::TMatchingPairList correspondences,
const TMatchingParams params,
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 792 of file CBeaconMap.cpp.

References ASSERT_, changeCoordinatesReference(), CLASS_ID, mrpt::maps::CMetricMap::GetRuntimeClass(), MRPT_END, MRPT_START, and MRPT_UNUSED_PARAM.

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

References MRPT_END, MRPT_START, MRPT_UNUSED_PARAM, and THROW_EXCEPTION.

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

◆ duplicateGetSmartPtr()

mrpt::rtti::CObject::Ptr 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 169 of file CObject.h.

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

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

◆ end() [1/2]

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

Definition at line 102 of file CBeaconMap.h.

References m_beacons.

◆ end() [2/2]

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

Definition at line 103 of file CBeaconMap.h.

References m_beacons.

◆ get() [1/2]

CBeacon& mrpt::maps::CBeaconMap::get ( size_t  i)
inline

Access to individual beacons.

Definition at line 94 of file CBeaconMap.h.

References ASSERT_, and m_beacons.

◆ get() [2/2]

const CBeacon& mrpt::maps::CBeaconMap::get ( size_t  i) const
inline

Access to individual beacons.

Definition at line 82 of file CBeaconMap.h.

References ASSERT_, and m_beacons.

◆ getAs3DObject()

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

Returns a 3D object representing the map.

Implements mrpt::maps::CMetricMap.

Definition at line 1160 of file CBeaconMap.cpp.

References mrpt::opengl::stock_objects::CornerXYZ(), MRPT_END, and MRPT_START.

◆ getAsSimplePointsMap() [1/2]

virtual mrpt::maps::CSimplePointsMap* mrpt::maps::CMetricMap::getAsSimplePointsMap ( )
inlinevirtualinherited

◆ getAsSimplePointsMap() [2/2]

virtual const mrpt::maps::CSimplePointsMap* mrpt::maps::CMetricMap::getAsSimplePointsMap ( ) const
inlinevirtualinherited

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 in mrpt::maps::CPointsMap, mrpt::maps::CMultiMetricMap, and mrpt::maps::CSimplePointsMap.

Definition at line 302 of file CMetricMap.h.

Referenced by mrpt::maps::CPointsMap::compute3DMatchingRatio().

◆ getBeaconByID() [1/2]

CBeacon * CBeaconMap::getBeaconByID ( CBeacon::TBeaconID  id)

Returns a pointer to the beacon with the given ID, or nullptr if it does not exist.

Definition at line 1239 of file CBeaconMap.cpp.

◆ getBeaconByID() [2/2]

const CBeacon * CBeaconMap::getBeaconByID ( CBeacon::TBeaconID  id) const

Returns a pointer to the beacon with the given ID, or nullptr if it does not exist.

Definition at line 1229 of file CBeaconMap.cpp.

◆ getClassName()

static constexpr auto mrpt::maps::CBeaconMap::getClassName ( )
inlinestaticconstexpr

Definition at line 48 of file CBeaconMap.h.

◆ GetRuntimeClass()

virtual const mrpt::rtti::TRuntimeClassId* mrpt::maps::CBeaconMap::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::CBeaconMap::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 55 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().

◆ insertObservation()

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::opengl::CPlanarLaserScan::getBoundingBox(), mrpt::graphslam::deciders::CRangeScanOps< typename mrpt::graphs::CNetworkOfPoses2DInf >::getICPEdge(), CAngularObservationMesh_fnctr::operator()(), mrpt::opengl::CPlanarLaserScan::render_dl(), TEST(), and mrpt::graphslam::CGraphSlamEngine< mrpt::graphs::CNetworkOfPoses2DInf >::updateMapVisualization().

◆ insertObservationPtr()

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

◆ internal_canComputeObservationLikelihood()

virtual bool mrpt::maps::CMetricMap::internal_canComputeObservationLikelihood ( const mrpt::obs::CObservation obs) const
inlineprivatevirtualinherited

Internal method called by canComputeObservationLikelihood()

Reimplemented in mrpt::maps::COccupancyGridMap2D, and mrpt::maps::CMultiMetricMap.

Definition at line 75 of file CMetricMap.h.

References MRPT_UNUSED_PARAM.

◆ internal_clear()

void CBeaconMap::internal_clear ( )
overrideprotectedvirtual

Internal method called by clear()

Implements mrpt::maps::CMetricMap.

Definition at line 94 of file CBeaconMap.cpp.

◆ internal_computeObservationLikelihood()

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

◆ internal_CreateFromMapDefinition()

mrpt::maps::CMetricMap * CBeaconMap::internal_CreateFromMapDefinition ( const mrpt::maps::TMetricMapInitializer def)
static

◆ internal_insertObservation()

bool CBeaconMap::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 354 of file CBeaconMap.cpp.

References ASSERT_, mrpt::poses::CPointPDFSOG::begin(), CLASS_ID, mrpt::poses::CPointPDFParticles::clear(), mrpt::poses::CPointPDFGaussian::cov, mrpt::DEG2RAD(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distance3DTo(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distanceTo(), mrpt::random::CRandomGenerator::drawGaussian1D(), mrpt::random::CRandomGenerator::drawUniform(), mrpt::poses::CPointPDFSOG::end(), mrpt::poses::CPointPDFSOG::erase(), mrpt::bayes::CParticleFilterDataImpl< Derived, particle_list_t >::ESS(), mrpt::maps::CBeacon::generateRingSOG(), mrpt::poses::CPointPDFParticles::getCovarianceAndMean(), mrpt::poses::CPointPDFSOG::getCovarianceAndMean(), mrpt::random::getRandomGenerator(), mrpt::obs::CObservation::GetRuntimeClass(), mrpt::bayes::CParticleFilterData< T, STORAGE >::getWeights(), mrpt::maps::CBeacon::m_ID, mrpt::maps::CBeacon::m_locationGauss, mrpt::maps::CBeacon::m_locationMC, mrpt::maps::CBeacon::m_locationSOG, mrpt::bayes::CParticleFilterData< T, STORAGE >::m_particles, M_PI, mrpt::maps::CBeacon::m_typePDF, mrpt::max3(), mrpt::poses::CPointPDFGaussian::mean, MRPT_END, MRPT_START, mrpt::poses::CPointPDFSOG::normalizeWeights(), mrpt::maps::CBeacon::pdfGauss, mrpt::maps::CBeacon::pdfMonteCarlo, mrpt::maps::CBeacon::pdfSOG, mrpt::bayes::CParticleFilterDataImpl< Derived, particle_list_t >::performSubstitution(), R, mrpt::round(), mrpt::obs::CObservationBeaconRanges::sensedData, mrpt::poses::CPointPDFParticles::setSize(), mrpt::square(), THROW_EXCEPTION, mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::x(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::x_incr(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::y(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::y_incr().

◆ internal_observer_begin()

void CObservable::internal_observer_begin ( CObserver o)
privateinherited

Definition at line 29 of file CObservable.cpp.

◆ internal_observer_end()

void CObservable::internal_observer_end ( CObserver o)
privateinherited

Definition at line 34 of file CObservable.cpp.

References ASSERTMSG_, MRPT_END, and MRPT_START.

◆ isEmpty()

bool CBeaconMap::isEmpty ( ) const
overridevirtual

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

Implements mrpt::maps::CMetricMap.

Definition at line 1046 of file CBeaconMap.cpp.

◆ 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 37 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().

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

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

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

◆ MapDefinition()

mrpt::maps::TMetricMapInitializer * mrpt::maps::CBeaconMap::MapDefinition ( )
static

Returns default map definition initializer.

See * mrpt::maps::TMetricMapInitializer

Definition at line 43 of file CBeaconMap.cpp.

◆ OnPostSuccesfulInsertObs()

virtual void mrpt::maps::CMetricMap::OnPostSuccesfulInsertObs ( const mrpt::obs::CObservation )
inlineprivatevirtualinherited

Hook for each time a "internal_insertObservation" returns "true" This is called automatically from insertObservation() when internal_insertObservation returns true.

Reimplemented in mrpt::maps::COccupancyGridMap2D.

Definition at line 86 of file CMetricMap.h.

◆ operator delete() [1/3]

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

Definition at line 48 of file CBeaconMap.h.

◆ operator delete() [2/3]

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

Definition at line 48 of file CBeaconMap.h.

◆ operator delete() [3/3]

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

Definition at line 48 of file CBeaconMap.h.

◆ operator delete[]()

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

Definition at line 48 of file CBeaconMap.h.

◆ operator new() [1/3]

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

Definition at line 48 of file CBeaconMap.h.

◆ operator new() [2/3]

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

Definition at line 48 of file CBeaconMap.h.

◆ operator new() [3/3]

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

Definition at line 48 of file CBeaconMap.h.

◆ operator new[]()

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

Definition at line 48 of file CBeaconMap.h.

◆ operator[]() [1/2]

CBeacon& mrpt::maps::CBeaconMap::operator[] ( size_t  i)
inline

Access to individual beacons.

Definition at line 88 of file CBeaconMap.h.

References ASSERT_, and m_beacons.

◆ operator[]() [2/2]

const CBeacon& mrpt::maps::CBeaconMap::operator[] ( size_t  i) const
inline

Access to individual beacons.

Definition at line 76 of file CBeaconMap.h.

References ASSERT_, and m_beacons.

◆ publishEvent()

void CObservable::publishEvent ( const mrptEvent e) const
protectedinherited

◆ push_back()

void mrpt::maps::CBeaconMap::push_back ( const CBeacon m)
inline

Inserts a copy of the given mode into the SOG.

Definition at line 105 of file CBeaconMap.h.

References m_beacons.

◆ resize()

void CBeaconMap::resize ( const size_t  N)

Resize the number of SOG modes.

Definition at line 102 of file CBeaconMap.cpp.

◆ saveMetricMapRepresentationToFile()

void CBeaconMap::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).

In the case of this class, these files are generated:

  • "filNamePrefix"+"_3D.m": A script for MATLAB for drawing landmarks as 3D ellipses.
  • "filNamePrefix"+"_3D.3DScene": A 3D scene with a "ground plane grid" and the set of ellipsoids in 3D.
  • "filNamePrefix"+"_covs.m": A textual representation (see saveToTextFile)

Implements mrpt::maps::CMetricMap.

Definition at line 1094 of file CBeaconMap.cpp.

References mrpt::opengl::CGridPlaneXY::Create(), mrpt::system::os::fclose(), mrpt::system::os::fopen(), mrpt::system::os::fprintf(), mrpt::opengl::COpenGLScene::insert(), MRPT_END, MRPT_START, mrpt::maps::CBeacon::pdfGauss, mrpt::maps::CBeacon::pdfMonteCarlo, mrpt::maps::CBeacon::pdfSOG, mrpt::opengl::COpenGLScene::saveToFile(), and saveToTextFile().

◆ saveToMATLABScript3D()

bool CBeaconMap::saveToMATLABScript3D ( const std::string file,
const char *  style = "b",
float  confInterval = 0.95f 
) const

Save to a MATLAB script which displays 3D error ellipses for the map.

Parameters
fileThe name of the file to save the script to.
styleThe MATLAB-like string for the style of the lines (see 'help plot' in MATLAB for posibilities)
stdCountThe ellipsoids will be drawn from the center to a given confidence interval in [0,1], e.g. 2 sigmas=0.95 (default is 2std = 0.95 confidence intervals)
Returns
Returns false if any error occured, true elsewere.

Definition at line 922 of file CBeaconMap.cpp.

References mrpt::system::os::fclose(), mrpt::system::os::fopen(), mrpt::system::os::fprintf(), MRPT_UNUSED_PARAM, and mrpt::system::stringListAsString().

◆ saveToTextFile()

void CBeaconMap::saveToTextFile ( const std::string fil) const

Save a text file with a row per beacon, containing this 11 elements:

  • X Y Z: Mean values
  • VX VY VZ: Variances of each dimension (C11, C22, C33)
  • DET2D DET3D: Determinant of the 2D and 3D covariance matrixes.
  • C12, C13, C23: Cross covariances

Definition at line 1252 of file CBeaconMap.cpp.

References ASSERT_, mrpt::system::os::fclose(), mrpt::system::os::fopen(), mrpt::system::os::fprintf(), MRPT_END, MRPT_START, and mrpt::square().

◆ serializeFrom()

void CBeaconMap::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 115 of file CBeaconMap.cpp.

References mrpt::containers::clear(), and MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION.

◆ serializeGetVersion()

uint8_t CBeaconMap::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 103 of file CBeaconMap.cpp.

◆ serializeTo()

void CBeaconMap::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 104 of file CBeaconMap.cpp.

References begin().

◆ simulateBeaconReadings()

void CBeaconMap::simulateBeaconReadings ( const mrpt::poses::CPose3D in_robotPose,
const mrpt::poses::CPoint3D in_sensorLocationOnRobot,
mrpt::obs::CObservationBeaconRanges out_Observations 
) const

Simulates a reading toward each of the beacons in the landmarks map, if any.

Parameters
in_robotPoseThis robot pose is used to simulate the ranges to each beacon.
in_sensorLocationOnRobotThe 3D position of the sensor on the robot
out_ObservationsThe results will be stored here. NOTICE that the fields "CObservationBeaconRanges::minSensorDistance","CObservationBeaconRanges::maxSensorDistance" and "CObservationBeaconRanges::stdError" MUST BE FILLED OUT before calling this function. An observation will be generated for each beacon in the map, but notice that some of them may be missed if out of the sensor maximum range.

Definition at line 1050 of file CBeaconMap.cpp.

References mrpt::obs::CObservationBeaconRanges::TMeasurement::beaconID, mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distanceTo(), mrpt::random::CRandomGenerator::drawGaussian1D(), mrpt::random::getRandomGenerator(), mrpt::obs::CObservationBeaconRanges::maxSensorDistance, mrpt::obs::CObservationBeaconRanges::minSensorDistance, mrpt::obs::CObservationBeaconRanges::sensedData, mrpt::obs::CObservationBeaconRanges::TMeasurement::sensedDistance, mrpt::obs::CObservationBeaconRanges::TMeasurement::sensorLocationOnRobot, and mrpt::obs::CObservationBeaconRanges::stdError.

◆ size()

size_t CBeaconMap::size ( ) const

Returns the stored landmarks count.

Definition at line 98 of file CBeaconMap.cpp.

◆ 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 170 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 70 of file CSerializable.h.

Member Data Documentation

◆ _init_CBeaconMap

mrpt::rtti::CLASSINIT mrpt::maps::CBeaconMap::_init_CBeaconMap
staticprotected

Definition at line 48 of file CBeaconMap.h.

◆ className

constexpr const char* mrpt::maps::CBeaconMap::className = "CBeaconMap"
staticconstexpr

Definition at line 48 of file CBeaconMap.h.

◆ genericMapParams

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

◆ insertionOptions

mrpt::maps::CBeaconMap::TInsertionOptions mrpt::maps::CBeaconMap::insertionOptions

◆ likelihoodOptions

mrpt::maps::CBeaconMap::TLikelihoodOptions mrpt::maps::CBeaconMap::likelihoodOptions

◆ m_beacons

TSequenceBeacons mrpt::maps::CBeaconMap::m_beacons
protected

The individual beacons.

Definition at line 57 of file CBeaconMap.h.

Referenced by begin(), computeMatchingWith3DLandmarks(), end(), get(), operator[](), and push_back().

◆ m_private_map_register_id

const size_t mrpt::maps::CBeaconMap::m_private_map_register_id = mrpt::maps::internal::TMetricMapTypesRegistry::Instance().doRegister( "CBeaconMap,beaconMap" , & mrpt::maps::CBeaconMap ::MapDefinition, & mrpt::maps::CBeaconMap ::internal_CreateFromMapDefinition)
static

ID used to initialize class registration (just ignore it)

Definition at line 316 of file CBeaconMap.h.

◆ m_subscribers

std::set<CObserver*> mrpt::system::CObservable::m_subscribers
privateinherited

Definition at line 42 of file CObservable.h.

Referenced by mrpt::system::CObservable::hasSubscribers().

◆ runtimeClassId

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

Definition at line 48 of file CBeaconMap.h.




Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST