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: []
Definition at line 44 of file maps/CBeaconMap.h.
#include <mrpt/maps/CBeaconMap.h>
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 | |
typedef std::deque< CBeacon > | TSequenceBeacons |
typedef std::deque< CBeacon >::iterator | iterator |
typedef std::deque< CBeacon >::const_iterator | const_iterator |
Public Member Functions | |
CBeaconMap () | |
Constructor. | |
void | resize (const size_t N) |
Resize the number of SOG modes. | |
const CBeacon & | operator[] (size_t i) const |
Access to individual beacons. | |
const CBeacon & | get (size_t i) const |
Access to individual beacons. | |
CBeacon & | operator[] (size_t i) |
Access to individual beacons. | |
CBeacon & | get (size_t i) |
Access to individual beacons. | |
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. | |
float | compute3DMatchingRatio (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, const TMatchingRatioParams ¶ms) const MRPT_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. | |
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. | |
size_t | size () const |
Returns the stored landmarks count. | |
virtual void | determineMatching2D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose2D &otherMapPose, mrpt::utils::TMatchingPairList &correspondences, const TMatchingParams ¶ms, TMatchingExtraResults &extraResults) const MRPT_OVERRIDE |
Computes the matching between this and another 2D point map, which includes finding: | |
void | computeMatchingWith3DLandmarks (const mrpt::maps::CBeaconMap *otherMap, mrpt::utils::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. | |
void | changeCoordinatesReference (const mrpt::poses::CPose3D &newOrg) |
Changes the reference system of the map to a given 3D pose. | |
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. | |
bool | isEmpty () const MRPT_OVERRIDE |
Returns true if the map is empty/no observation has been inserted. | |
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. | |
void | saveMetricMapRepresentationToFile (const std::string &filNamePrefix) const MRPT_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). | |
void | saveToTextFile (const std::string &fil) const |
Save a text file with a row per beacon, containing this 11 elements: | |
void | getAs3DObject (mrpt::opengl::CSetOfObjectsPtr &outObj) const MRPT_OVERRIDE |
Returns a 3D object representing the map. | |
const CBeacon * | getBeaconByID (CBeacon::TBeaconID id) const |
Returns a pointer to the beacon with the given ID, or NULL if it does not exist. | |
CBeacon * | getBeaconByID (CBeacon::TBeaconID id) |
Returns a pointer to the beacon with the given ID, or NULL if it does not exist. | |
void | clear () |
Erase all the contents of the map. | |
void | loadFromProbabilisticPosesAndObservations (const mrpt::maps::CSimpleMap &Map) |
Load the map contents from a CSimpleMap object, erasing all previous content of the map. | |
void | loadFromSimpleMap (const mrpt::maps::CSimpleMap &Map) |
Load the map contents from a CSimpleMap object, erasing all previous content of the map. | |
bool | insertObservation (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL) |
Insert the observation information into this map. | |
bool | insertObservationPtr (const mrpt::obs::CObservationPtr &obs, const mrpt::poses::CPose3D *robotPose=NULL) |
A wrapper for smart pointers, just calls the non-smart pointer version. | |
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. | |
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. | |
virtual bool | canComputeObservationLikelihood (const mrpt::obs::CObservation *obs) |
Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. | |
bool | canComputeObservationLikelihood (const mrpt::obs::CObservationPtr &obs) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
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. | |
bool | canComputeObservationsLikelihood (const mrpt::obs::CSensoryFrame &sf) |
Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. | |
virtual void | determineMatching3D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, mrpt::utils::TMatchingPairList &correspondences, const TMatchingParams ¶ms, TMatchingExtraResults &extraResults) const |
Computes the matchings between this and another 3D points map - method used in 3D-ICP. | |
virtual void | auxParticleFilterCleanUp () |
This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation". | |
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. | |
virtual const mrpt::maps::CSimplePointsMap * | getAsSimplePointsMap () 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. | |
virtual mrpt::maps::CSimplePointsMap * | getAsSimplePointsMap () |
Public Attributes | |
mrpt::maps::CBeaconMap::TLikelihoodOptions | likelihoodOptions |
mrpt::maps::CBeaconMap::TInsertionOptions | insertionOptions |
TMapGenericParams | genericMapParams |
Common params to all maps. | |
Static Public Attributes | |
RTTI stuff <br> | |
static const mrpt::utils::TRuntimeClassId | classCMetricMap |
Protected Member Functions | |
virtual void | internal_clear () MRPT_OVERRIDE |
Internal method called by clear() | |
virtual bool | internal_insertObservation (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL) MRPT_OVERRIDE |
Internal method called by insertObservation() | |
double | internal_computeObservationLikelihood (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) MRPT_OVERRIDE |
Internal method called by computeObservationLikelihood() | |
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. | |
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. | |
CSerializable virtual methods | |
void | writeToStream (mrpt::utils::CStream &out, int *getVersion) const MRPT_OVERRIDE |
void | readFromStream (mrpt::utils::CStream &in, int version) MRPT_OVERRIDE |
Protected Attributes | |
TSequenceBeacons | m_beacons |
The individual beacons. | |
Private Member Functions | |
virtual bool | internal_canComputeObservationLikelihood (const mrpt::obs::CObservation *obs) |
Internal method called by canComputeObservationLikelihood() | |
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. | |
void | internal_observer_begin (CObserver *) |
void | internal_observer_end (CObserver *) |
Private Attributes | |
std::set< CObserver * > | m_subscribers |
RTTI stuff <br> | |
typedef CBeaconMapPtr | SmartPtr |
static mrpt::utils::CLASSINIT | _init_CBeaconMap |
static mrpt::utils::TRuntimeClassId | classCBeaconMap |
static const mrpt::utils::TRuntimeClassId * | classinfo |
static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const MRPT_OVERRIDE |
virtual mrpt::utils::CObject * | duplicate () const MRPT_OVERRIDE |
static mrpt::utils::CObject * | CreateObject () |
static CBeaconMapPtr | Create () |
Map Definition Interface stuff (see mrpt::maps::TMetricMapInitializer) @{ | |
static const size_t | m_private_map_register_id |
ID used to initialize class registration (just ignore it) | |
static mrpt::maps::TMetricMapInitializer * | MapDefinition () |
Returns default map definition initializer. | |
static CBeaconMap * | CreateFromMapDefinition (const mrpt::maps::TMetricMapInitializer &def) |
Constructor from a map definition structure: initializes the map and its parameters accordingly. | |
static mrpt::maps::CMetricMap * | internal_CreateFromMapDefinition (const mrpt::maps::TMetricMapInitializer &def) |
typedef std::deque<CBeacon>::const_iterator mrpt::maps::CBeaconMap::const_iterator |
Definition at line 52 of file maps/CBeaconMap.h.
typedef std::deque<CBeacon>::iterator mrpt::maps::CBeaconMap::iterator |
Definition at line 51 of file maps/CBeaconMap.h.
A typedef for the associated smart pointer
Definition at line 47 of file maps/CBeaconMap.h.
typedef std::deque<CBeacon> mrpt::maps::CBeaconMap::TSequenceBeacons |
Definition at line 50 of file maps/CBeaconMap.h.
mrpt::maps::CBeaconMap::CBeaconMap | ( | ) |
Constructor.
|
staticprotected |
|
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::CMultiMetricMap, and mrpt::maps::CLandmarksMap.
Definition at line 235 of file maps/CMetricMap.h.
|
inline |
Definition at line 89 of file maps/CBeaconMap.h.
|
inline |
Definition at line 90 of file maps/CBeaconMap.h.
|
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).
obs | The observation. |
|
inherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
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).
sf | The observations. |
void mrpt::maps::CBeaconMap::changeCoordinatesReference | ( | const mrpt::poses::CPose3D & | newOrg | ) |
Changes the reference system of the map to a given 3D pose.
void mrpt::maps::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.
|
inherited |
Erase all the contents of the map.
Referenced by mrpt::maps::CRandomFieldGridMap2D::clear(), and mrpt::maps::CReflectivityGridMap2D::clear().
|
virtual |
Computes the ratio in [0,1] of correspondences between "this" and the "otherMap" map, whose 6D pose relative to "this" is "otherMapPose" In the case of a multi-metric map, this returns the average between the maps.
This method always return 0 for grid maps.
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 |
Reimplemented from mrpt::maps::CMetricMap.
void mrpt::maps::CBeaconMap::computeMatchingWith3DLandmarks | ( | const mrpt::maps::CBeaconMap * | otherMap, |
mrpt::utils::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.
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. |
|
inherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inherited |
Computes the log-likelihood of a given observation given an arbitrary robot 3D pose.
takenFrom | The robot's pose the observation is supposed to be taken from. |
obs | The observation. |
|
inherited |
Returns the sum of the log-likelihoods of each individual observation within a mrpt::obs::CSensoryFrame.
takenFrom | The robot's pose the observation is supposed to be taken from. |
sf | The set of observations in a CSensoryFrame. |
|
static |
|
static |
Constructor from a map definition structure: initializes the map and its parameters accordingly.
|
static |
|
virtual |
Computes the matching between this and another 2D point map, which includes finding:
The algorithm is:
This method is the most time critical one into ICP-like algorithms.
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. |
Reimplemented from mrpt::maps::CMetricMap.
|
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:
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. |
Reimplemented in mrpt::maps::CPointsMap.
|
virtual |
|
inline |
Definition at line 91 of file maps/CBeaconMap.h.
|
inline |
Definition at line 92 of file maps/CBeaconMap.h.
|
inline |
|
inline |
|
virtual |
Returns a 3D object representing the map.
Implements mrpt::maps::CMetricMap.
|
inlinevirtualinherited |
Reimplemented in mrpt::maps::CMultiMetricMap, mrpt::maps::CPointsMap, and mrpt::maps::CSimplePointsMap.
Definition at line 244 of file maps/CMetricMap.h.
|
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::CMultiMetricMap, mrpt::maps::CPointsMap, and mrpt::maps::CSimplePointsMap.
Definition at line 243 of file maps/CMetricMap.h.
CBeacon * mrpt::maps::CBeaconMap::getBeaconByID | ( | CBeacon::TBeaconID | id | ) |
Returns a pointer to the beacon with the given ID, or NULL if it does not exist.
const CBeacon * mrpt::maps::CBeaconMap::getBeaconByID | ( | CBeacon::TBeaconID | id | ) | const |
Returns a pointer to the beacon with the given ID, or NULL if it does not exist.
|
virtual |
Reimplemented from mrpt::maps::CMetricMap.
|
inlineprotectedinherited |
Can be called by a derived class before preparing an event for publishing with publishEvent to determine if there is no one subscribed, so it can save the wasted time preparing an event that will be not read.
Definition at line 52 of file CObservable.h.
|
inherited |
Insert the observation information into this map.
This method must be implemented in derived classes.
obs | The observation |
robotPose | The 3D pose of the robot mobile base in the map reference system, or NULL (default) if you want to use the origin. |
|
inherited |
A wrapper for smart pointers, just calls the non-smart pointer version.
|
inlineprivatevirtualinherited |
Internal method called by canComputeObservationLikelihood()
Reimplemented in mrpt::maps::CMultiMetricMap, and mrpt::maps::COccupancyGridMap2D.
Definition at line 71 of file maps/CMetricMap.h.
References MRPT_UNUSED_PARAM.
|
protectedvirtual |
Internal method called by clear()
Implements mrpt::maps::CMetricMap.
|
protectedvirtual |
Internal method called by computeObservationLikelihood()
Implements mrpt::maps::CMetricMap.
|
static |
|
protectedvirtual |
Internal method called by insertObservation()
Implements mrpt::maps::CMetricMap.
|
privateinherited |
|
privateinherited |
|
virtual |
Returns true if the map is empty/no observation has been inserted.
Implements mrpt::maps::CMetricMap.
|
inherited |
Load the map contents from a CSimpleMap object, erasing all previous content of the map.
This is automaticed invoking "insertObservation" for each observation at the mean 3D robot pose as given by the "poses::CPosePDF" in the CSimpleMap object.
std::exception | Some internal steps in invoked methods can raise exceptions on invalid parameters, etc... |
|
inlineinherited |
Load the map contents from a CSimpleMap object, erasing all previous content of the map.
This is automaticed invoking "insertObservation" for each observation at the mean 3D robot pose as given by the "poses::CPosePDF" in the CSimpleMap object.
std::exception | Some internal steps in invoked methods can raise exceptions on invalid parameters, etc... |
Definition at line 105 of file maps/CMetricMap.h.
|
static |
Returns default map definition initializer.
|
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 79 of file maps/CMetricMap.h.
|
inline |
|
inline |
|
protectedinherited |
Called when you want this object to emit an event to all the observers currently subscribed to this object.
|
inline |
Inserts a copy of the given mode into the SOG.
Definition at line 95 of file maps/CBeaconMap.h.
|
protected |
void mrpt::maps::CBeaconMap::resize | ( | const size_t | N | ) |
Resize the number of SOG modes.
|
virtual |
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:
Implements mrpt::maps::CMetricMap.
bool mrpt::maps::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.
file | The name of the file to save the script to. |
style | The MATLAB-like string for the style of the lines (see 'help plot' in MATLAB for posibilities) |
stdCount | The 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) |
void mrpt::maps::CBeaconMap::saveToTextFile | ( | const std::string & | fil | ) | const |
Save a text file with a row per beacon, containing this 11 elements:
void mrpt::maps::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.
in_robotPose | This robot pose is used to simulate the ranges to each beacon. |
in_sensorLocationOnRobot | The 3D position of the sensor on the robot |
out_Observations | The 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. |
size_t mrpt::maps::CBeaconMap::size | ( | ) | const |
Returns the stored landmarks count.
|
virtualinherited |
Returns the square distance from the 2D point (x0,y0) to the closest correspondence in the map.
Reimplemented in mrpt::maps::CPointsMap.
|
protected |
|
staticprotected |
Definition at line 47 of file maps/CBeaconMap.h.
|
static |
Definition at line 47 of file maps/CBeaconMap.h.
|
staticinherited |
Definition at line 57 of file maps/CMetricMap.h.
|
static |
Definition at line 47 of file maps/CBeaconMap.h.
|
inherited |
Common params to all maps.
Definition at line 230 of file maps/CMetricMap.h.
mrpt::maps::CBeaconMap::TInsertionOptions mrpt::maps::CBeaconMap::insertionOptions |
mrpt::maps::CBeaconMap::TLikelihoodOptions mrpt::maps::CBeaconMap::likelihoodOptions |
|
protected |
The individual beacons.
Definition at line 55 of file maps/CBeaconMap.h.
|
static |
ID used to initialize class registration (just ignore it)
Definition at line 259 of file maps/CBeaconMap.h.
|
privateinherited |
Definition at line 42 of file CObservable.h.
Page generated by Doxygen 1.9.7 for MRPT 1.4.0 SVN: at Tue Jun 27 15:23:24 UTC 2023 |