Main MRPT website > C++ reference
MRPT logo
List of all members | Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Private Member Functions
mrpt::slam::CLandmarksMap Class Reference

Detailed Description

A class for storing a map of 3D probabilistic landmarks.


Currently these types of landmarks are defined: (see mrpt::slam::CLandmark)

Observation class: Generated Landmarks: Comments:
CObservationImage vlSIFT 1) A SIFT feature is created for each SIFT detected in the image,
2) Correspondences between SIFTs features and existing ones are finded by computeMatchingWith3DLandmarks,
3) The corresponding feaures are fused, and the new ones added, with an initial uncertainty according to insertionOptions
CObservationStereoImages vlSIFT Each image is separately procesed by the method for CObservationImage observations
CObservationStereoImages vlColor TODO...
CObservation2DRangeScan glOccupancy A landmark is added for each range in the scan, with its appropiate covariance matrix derived from the jacobians matrixes.
See also
CMetricMap

Definition at line 63 of file CLandmarksMap.h.

#include <mrpt/slam/CLandmarksMap.h>

Inheritance diagram for mrpt::slam::CLandmarksMap:
Inheritance graph
[legend]

Classes

struct  TCustomSequenceLandmarks
 The list of landmarks: the wrapper class is just for maintaining the KD-Tree representation. More...
 
struct  TFuseOptions
 With this struct options are provided to the fusion process. More...
 
struct  TInsertionOptions
 With this struct options are provided to the observation insertion process. More...
 
struct  TInsertionResults
 This struct stores extra results from invoking insertObservation. More...
 
struct  TLikelihoodOptions
 With this struct options are provided to the likelihood computations. More...
 

Public Types

typedef mrpt::slam::CLandmark landmark_type
 

Public Member Functions

 CLandmarksMap ()
 Constructor. More...
 
virtual ~CLandmarksMap ()
 Virtual destructor. More...
 
mrpt::slam::CLandmark::TLandmarkID getMapMaxID ()
 
float compute3DMatchingRatio (const CMetricMap *otherMap, const CPose3D &otherMapPose, float maxDistForCorr=0.10f, float maxMahaDistForCorr=2.0f) const
 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 saveToTextFile (std::string file)
 Save to a text file. More...
 
bool saveToMATLABScript2D (std::string file, const char *style="b", float stdCount=2.0f)
 Save to a MATLAB script which displays 2D error ellipses for the map (top-view, projection on the XY plane). More...
 
bool saveToMATLABScript3D (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...
 
double computeLikelihood_RSLC_2007 (const CLandmarksMap *s, const CPose2D &sensorPose)
 Computes the (logarithmic) likelihood function for a sensed observation "o" according to "this" map. More...
 
void loadSiftFeaturesFromImageObservation (const CObservationImage &obs, const mrpt::vision::CFeatureExtraction::TOptions &feat_options=mrpt::vision::CFeatureExtraction::TOptions(mrpt::vision::featSIFT))
 Loads into this landmarks map the SIFT features extracted from an image observation (Previous contents of map will be erased) The robot is assumed to be at the origin of the map. More...
 
void loadSiftFeaturesFromStereoImageObservation (const CObservationStereoImages &obs, mrpt::slam::CLandmark::TLandmarkID fID, const mrpt::vision::CFeatureExtraction::TOptions &feat_options=mrpt::vision::CFeatureExtraction::TOptions(mrpt::vision::featSIFT))
 Loads into this landmarks map the SIFT features extracted from an observation consisting of a pair of stereo-image (Previous contents of map will be erased) The robot is assumed to be at the origin of the map. More...
 
void loadOccupancyFeaturesFrom2DRangeScan (const CObservation2DRangeScan &obs, const CPose3D *robotPose=NULL, unsigned int downSampleFactor=1)
 Loads into this landmarks-map a set of occupancy features according to a 2D range scan (Previous contents of map will be erased) More...
 
double computeObservationLikelihood (const CObservation *obs, const CPose3D &takenFrom)
 Computes the (logarithmic) likelihood that a given observation was taken from a given pose in the world being modeled with this map. More...
 
void computeMatchingWith2D (const CMetricMap *otherMap, const CPose2D &otherMapPose, float maxDistForCorrespondence, float maxAngularDistForCorrespondence, const CPose2D &angularDistPivotPoint, TMatchingPairList &correspondences, float &correspondencesRatio, float *sumSqrDist=NULL, bool onlyKeepTheClosest=false, bool onlyUniqueRobust=false) const
 
void computeMatchingWith3DLandmarks (const mrpt::slam::CLandmarksMap *otherMap, TMatchingPairList &correspondences, float &correspondencesRatio, std::vector< bool > &otherCorrespondences) const
 Perform a search for correspondences between "this" and another lansmarks map: In this class, the matching is established solely based on the landmarks' IDs. More...
 
void changeCoordinatesReference (const CPose3D &newOrg)
 Changes the reference system of the map to a given 3D pose. More...
 
void changeCoordinatesReference (const CPose3D &newOrg, const mrpt::slam::CLandmarksMap *otherMap)
 Changes the reference system of the map "otherMap" and save the result in "this" map. More...
 
void fuseWith (CLandmarksMap &other, bool justInsertAllOfThem=false)
 Fuses the contents of another map with this one, updating "this" object with the result. More...
 
double computeLikelihood_SIFT_LandmarkMap (CLandmarksMap *map, TMatchingPairList *correspondences=NULL, std::vector< bool > *otherCorrespondences=NULL)
 Returns the (logarithmic) likelihood of a set of landmarks "map" given "this" map. More...
 
bool isEmpty () const
 Returns true if the map is empty/no observation has been inserted. More...
 
void simulateBeaconReadings (const CPose3D &in_robotPose, const CPoint3D &in_sensorLocationOnRobot, CObservationBeaconRanges &out_Observations) const
 Simulates a noisy reading toward each of the beacons in the landmarks map, if any. More...
 
void simulateRangeBearingReadings (const CPose3D &robotPose, const CPose3D &sensorLocationOnRobot, CObservationBearingRange &observations, bool sensorDetectsIDs=true, const float stdRange=0.01f, const float stdYaw=DEG2RAD(0.1f), const float stdPitch=DEG2RAD(0.1f), vector_size_t *real_associations=NULL, const double spurious_count_mean=0, const double spurious_count_std=0) const
 Simulates a noisy bearing-range observation of all the beacons (landamrks with type glBeacon) in the landmarks map, if any. More...
 
void saveMetricMapRepresentationToFile (const std::string &filNamePrefix) const
 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 getAs3DObject (mrpt::opengl::CSetOfObjectsPtr &outObj) const
 Returns a 3D object representing the map. More...
 
virtual void auxParticleFilterCleanUp ()
 This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation". More...
 
void clear ()
 Erase all the contents of the map. More...
 
void loadFromProbabilisticPosesAndObservations (const CSimpleMap &Map)
 Load the map contents from a CSimpleMap object, erasing all previous content of the map. More...
 
void loadFromSimpleMap (const CSimpleMap &Map)
 Load the map contents from a CSimpleMap object, erasing all previous content of the map. More...
 
bool insertObservation (const CObservation *obs, const CPose3D *robotPose=NULL)
 Insert the observation information into this map. More...
 
bool insertObservationPtr (const CObservationPtr &obs, const CPose3D *robotPose=NULL)
 A wrapper for smart pointers, just calls the non-smart pointer version. More...
 
double computeObservationLikelihood (const CObservation *obs, const CPose2D &takenFrom)
 Computes the log-likelihood of a given observation given an arbitrary robot 2D pose. More...
 
virtual bool canComputeObservationLikelihood (const CObservation *obs)
 Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. More...
 
bool canComputeObservationLikelihood (const CObservationPtr &obs)
 
double computeObservationsLikelihood (const CSensoryFrame &sf, const CPose2D &takenFrom)
 Returns the sum of the log-likelihoods of each individual observation within a mrpt::slam::CSensoryFrame. More...
 
bool canComputeObservationsLikelihood (const CSensoryFrame &sf)
 Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. More...
 
virtual void determineMatching2D (const CMetricMap *otherMap, const CPose2D &otherMapPose, TMatchingPairList &correspondences, const TMatchingParams &params, TMatchingExtraResults &extraResults) const
 Computes the matching between this and another 2D point map, which includes finding: More...
 
virtual void determineMatching3D (const CMetricMap *otherMap, const CPose3D &otherMapPose, TMatchingPairList &correspondences, const TMatchingParams &params, TMatchingExtraResults &extraResults) const
 Computes the matchings between this and another 3D points map - method used in 3D-ICP. More...
 
void computeMatchingWith2D (const CMetricMap *otherMap, const CPose2D &otherMapPose, float maxDistForCorrespondence, float maxAngularDistForCorrespondence, const CPose2D &angularDistPivotPoint, TMatchingPairList &correspondences, float &correspondencesRatio, float *sumSqrDist=NULL, bool onlyKeepTheClosest=true, bool onlyUniqueRobust=false, const size_t decimation_other_map_points=1, const size_t offset_other_map_points=0) const MRPT_DEPRECATED_POST("Deprecated")
 DEPRECATED: Use alternative version determineMatching2D with struct parameters instead. More...
 
void computeMatchingWith3D (const CMetricMap *otherMap, const CPose3D &otherMapPose, float maxDistForCorrespondence, float maxAngularDistForCorrespondence, const CPoint3D &angularDistPivotPoint, TMatchingPairList &correspondences, float &correspondencesRatio, float *sumSqrDist=NULL, bool onlyKeepTheClosest=true, bool onlyUniqueRobust=false, const size_t decimation_other_map_points=1, const size_t offset_other_map_points=0) const MRPT_DEPRECATED_POST("Deprecated")
 DEPRECATED: Use alternative version determineMatching3D with struct parameters instead. 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 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 CSimplePointsMapgetAsSimplePointsMap ()
 
mrpt::utils::CObjectPtr duplicateGetSmartPtr () const
 Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer). More...
 
CObjectclone () const
 Cloning interface for smart pointers. More...
 

Public Attributes

struct VISION_IMPEXP mrpt::slam::CLandmarksMap::TCustomSequenceLandmarks landmarks
 
mrpt::slam::CLandmarksMap::TInsertionOptions insertionOptions
 
mrpt::slam::CLandmarksMap::TLikelihoodOptions likelihoodOptions
 
struct VISION_IMPEXP mrpt::slam::CLandmarksMap::TInsertionResults insertionResults
 
struct VISION_IMPEXP mrpt::slam::CLandmarksMap::TFuseOptions fuseOptions
 
bool m_disableSaveAs3DObject
 When set to true (default=false), calling "getAs3DObject" will have no effects. More...
 

Static Public Attributes

static mrpt::utils::TColorf COLOR_LANDMARKS_IN_3DSCENES
 The color of landmark ellipsoids in CLandmarksMap::getAs3DObject. More...
 
static std::map< std::pair< mrpt::slam::CLandmark::TLandmarkID, mrpt::slam::CLandmark::TLandmarkID >, double > _mEDD
 Map of the Euclidean Distance between the descriptors of two SIFT-based landmarks. More...
 
static mrpt::slam::CLandmark::TLandmarkID _mapMaxID
 
static bool _maxIDUpdated
 
static const mrpt::utils::TRuntimeClassId classCObject
 
RTTI stuff
static const mrpt::utils::TRuntimeClassId classCMetricMap
 
RTTI stuff
static const mrpt::utils::TRuntimeClassId classCSerializable
 

Protected Member Functions

void publishEvent (const mrptEvent &e) const
 Called when you want this object to emit an event to all the observers currently subscribed to this object. More...
 
bool hasSubscribers () const
 Can be called by a derived class before preparing an event for publishing with publishEvent to determine if there is no one subscribed, so it can save the wasted time preparing an event that will be not read. More...
 
CSerializable virtual methods
void writeToStream (mrpt::utils::CStream &out, int *getVersion) const
 Introduces a pure virtual method responsible for writing to a CStream. More...
 
void readFromStream (mrpt::utils::CStream &in, int version)
 Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori. More...
 

Private Member Functions

virtual void internal_clear ()
 Internal method called by clear() More...
 
virtual bool internal_insertObservation (const CObservation *obs, const CPose3D *robotPose=NULL)
 Insert the observation information into this map. More...
 

RTTI stuff

typedef CLandmarksMapPtr SmartPtr
 
static mrpt::utils::CLASSINIT _init_CLandmarksMap
 
static mrpt::utils::TRuntimeClassId classCLandmarksMap
 
static const mrpt::utils::TRuntimeClassIdclassinfo
 
static const mrpt::utils::TRuntimeClassId_GetBaseClass ()
 
virtual const mrpt::utils::TRuntimeClassIdGetRuntimeClass () const
 Returns information about the class of an object in runtime. More...
 
virtual mrpt::utils::CObjectduplicate () const
 Returns a copy of the object, indepently of its class. More...
 
static mrpt::utils::CObjectCreateObject ()
 
static CLandmarksMapPtr Create ()
 

Member Typedef Documentation

◆ landmark_type

Definition at line 85 of file CLandmarksMap.h.

◆ SmartPtr

A typedef for the associated smart pointer

Definition at line 66 of file CLandmarksMap.h.

Constructor & Destructor Documentation

◆ CLandmarksMap()

mrpt::slam::CLandmarksMap::CLandmarksMap ( )

Constructor.

◆ ~CLandmarksMap()

virtual mrpt::slam::CLandmarksMap::~CLandmarksMap ( )
virtual

Virtual destructor.

Member Function Documentation

◆ _GetBaseClass()

static const mrpt::utils::TRuntimeClassId* mrpt::slam::CLandmarksMap::_GetBaseClass ( )
staticprotected

◆ auxParticleFilterCleanUp()

virtual void mrpt::slam::CLandmarksMap::auxParticleFilterCleanUp ( )
virtual

This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation".

This method should normally do nothing, but in some cases can be used to free auxiliary cached variables.

Reimplemented from mrpt::slam::CMetricMap.

◆ canComputeObservationLikelihood() [1/2]

virtual bool mrpt::slam::CMetricMap::canComputeObservationLikelihood ( const CObservation obs)
inlinevirtualinherited

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

Parameters
obsThe observation.
See also
computeObservationLikelihood

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

Definition at line 198 of file CMetricMap.h.

◆ canComputeObservationLikelihood() [2/2]

bool mrpt::slam::CMetricMap::canComputeObservationLikelihood ( const CObservationPtr obs)
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 204 of file CMetricMap.h.

References mrpt::slam::CMetricMap::canComputeObservationLikelihood(), and mrpt::slam::CObservationPtr::pointer().

Referenced by mrpt::slam::CMetricMap::canComputeObservationLikelihood().

◆ canComputeObservationsLikelihood()

bool mrpt::slam::CMetricMap::canComputeObservationsLikelihood ( const CSensoryFrame sf)
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).

Parameters
sfThe observations.
See also
canComputeObservationLikelihood

◆ changeCoordinatesReference() [1/2]

void mrpt::slam::CLandmarksMap::changeCoordinatesReference ( const CPose3D newOrg)

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

◆ changeCoordinatesReference() [2/2]

void mrpt::slam::CLandmarksMap::changeCoordinatesReference ( const CPose3D newOrg,
const mrpt::slam::CLandmarksMap otherMap 
)

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

◆ clear()

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

◆ clone()

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

Cloning interface for smart pointers.

Definition at line 135 of file CObject.h.

◆ compute3DMatchingRatio()

float mrpt::slam::CLandmarksMap::compute3DMatchingRatio ( const CMetricMap otherMap,
const CPose3D otherMapPose,
float  maxDistForCorr = 0.10f,
float  maxMahaDistForCorr = 2.0f 
) const
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.

Parameters
otherMap[IN] The other map to compute the matching with.
otherMapPose[IN] The 6D pose of the other map as seen from "this".
maxDistForCorr[IN] The minimum distance between 2 non-probabilistic map elements for counting them as a correspondence.
maxMahaDistForCorr[IN] The minimum Mahalanobis distance between 2 probabilistic map elements for counting them as a correspondence.
Returns
The matching ratio [0,1]
See also
determineMatching2D

Reimplemented from mrpt::slam::CMetricMap.

◆ computeLikelihood_RSLC_2007()

double mrpt::slam::CLandmarksMap::computeLikelihood_RSLC_2007 ( const CLandmarksMap s,
const CPose2D sensorPose 
)

Computes the (logarithmic) likelihood function for a sensed observation "o" according to "this" map.

This is the implementation of the algorithm reported in the paper: J.L. Blanco, J. Gonzalez, and J.A. Fernandez-Madrigal, "A Consensus-based Approach for Estimating the Observation Likelihood of Accurate Range Sensors", in IEEE International Conference on Robotics and Automation (ICRA), Rome (Italy), Apr 10-14, 2007

◆ computeLikelihood_SIFT_LandmarkMap()

double mrpt::slam::CLandmarksMap::computeLikelihood_SIFT_LandmarkMap ( CLandmarksMap map,
TMatchingPairList correspondences = NULL,
std::vector< bool > *  otherCorrespondences = NULL 
)

Returns the (logarithmic) likelihood of a set of landmarks "map" given "this" map.

See paper: JJAA 2006

◆ computeMatchingWith2D() [1/2]

void mrpt::slam::CMetricMap::computeMatchingWith2D ( const CMetricMap otherMap,
const CPose2D otherMapPose,
float  maxDistForCorrespondence,
float  maxAngularDistForCorrespondence,
const CPose2D angularDistPivotPoint,
TMatchingPairList correspondences,
float &  correspondencesRatio,
float *  sumSqrDist = NULL,
bool  onlyKeepTheClosest = true,
bool  onlyUniqueRobust = false,
const size_t  decimation_other_map_points = 1,
const size_t  offset_other_map_points = 0 
) const
inherited

DEPRECATED: Use alternative version determineMatching2D with struct parameters instead.

◆ computeMatchingWith2D() [2/2]

void mrpt::slam::CLandmarksMap::computeMatchingWith2D ( const CMetricMap otherMap,
const CPose2D otherMapPose,
float  maxDistForCorrespondence,
float  maxAngularDistForCorrespondence,
const CPose2D angularDistPivotPoint,
TMatchingPairList correspondences,
float &  correspondencesRatio,
float *  sumSqrDist = NULL,
bool  onlyKeepTheClosest = false,
bool  onlyUniqueRobust = false 
) const

◆ computeMatchingWith3D()

void mrpt::slam::CMetricMap::computeMatchingWith3D ( const CMetricMap otherMap,
const CPose3D otherMapPose,
float  maxDistForCorrespondence,
float  maxAngularDistForCorrespondence,
const CPoint3D angularDistPivotPoint,
TMatchingPairList correspondences,
float &  correspondencesRatio,
float *  sumSqrDist = NULL,
bool  onlyKeepTheClosest = true,
bool  onlyUniqueRobust = false,
const size_t  decimation_other_map_points = 1,
const size_t  offset_other_map_points = 0 
) const
inherited

DEPRECATED: Use alternative version determineMatching3D with struct parameters instead.

◆ computeMatchingWith3DLandmarks()

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

Perform a search for correspondences between "this" and another lansmarks map: In this class, the matching is established solely based on the landmarks' IDs.

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.

◆ computeObservationLikelihood() [1/2]

double mrpt::slam::CMetricMap::computeObservationLikelihood ( const CObservation obs,
const CPose2D takenFrom 
)
inlineinherited

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

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

◆ computeObservationLikelihood() [2/2]

double mrpt::slam::CLandmarksMap::computeObservationLikelihood ( const CObservation obs,
const CPose3D takenFrom 
)
virtual

Computes the (logarithmic) likelihood that a given observation was taken from a given pose in the world being modeled with this map.

In the current implementation, this method behaves in a different way according to the nature of the observation's class:

  • "mrpt::slam::CObservation2DRangeScan": This calls "computeLikelihood_RSLC_2007".
  • "mrpt::slam::CObservationStereoImages": This calls "computeLikelihood_SIFT_LandmarkMap".
Parameters
takenFromThe robot's pose the observation is supposed to be taken from.
obsThe observation.
Returns
This method returns a likelihood value > 0.
See also
Used in particle filter algorithms, see: CMultiMetricMapPDF::update

Implements mrpt::slam::CMetricMap.

◆ computeObservationsLikelihood()

double mrpt::slam::CMetricMap::computeObservationsLikelihood ( const CSensoryFrame sf,
const CPose2D takenFrom 
)
inherited

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

Parameters
takenFromThe robot's pose the observation is supposed to be taken from.
sfThe set of observations in a CSensoryFrame.
Returns
This method returns a log-likelihood.
See also
canComputeObservationsLikelihood

◆ Create()

static CLandmarksMapPtr mrpt::slam::CLandmarksMap::Create ( )
static

◆ CreateObject()

static mrpt::utils::CObject* mrpt::slam::CLandmarksMap::CreateObject ( )
static

◆ determineMatching2D()

virtual void mrpt::slam::CMetricMap::determineMatching2D ( const CMetricMap otherMap,
const CPose2D otherMapPose,
TMatchingPairList correspondences,
const TMatchingParams params,
TMatchingExtraResults extraResults 
) const
inlinevirtualinherited

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 in mrpt::slam::COccupancyGridMap2D, mrpt::slam::CPointsMap, mrpt::slam::CBeaconMap, and mrpt::slam::CMultiMetricMap.

Definition at line 246 of file CMetricMap.h.

References MRPT_END, MRPT_START, and THROW_EXCEPTION.

◆ determineMatching3D()

virtual void mrpt::slam::CMetricMap::determineMatching3D ( const CMetricMap otherMap,
const CPose3D otherMapPose,
TMatchingPairList correspondences,
const TMatchingParams params,
TMatchingExtraResults extraResults 
) const
inlinevirtualinherited

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::slam::CPointsMap.

Definition at line 276 of file CMetricMap.h.

References MRPT_END, MRPT_START, and THROW_EXCEPTION.

◆ duplicate()

virtual mrpt::utils::CObject* mrpt::slam::CLandmarksMap::duplicate ( ) const
virtual

Returns a copy of the object, indepently of its class.

Implements mrpt::utils::CObject.

◆ duplicateGetSmartPtr()

mrpt::utils::CObjectPtr mrpt::utils::CObject::duplicateGetSmartPtr ( ) const
inlineinherited

Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer).

Definition at line 132 of file CObject.h.

◆ fuseWith()

void mrpt::slam::CLandmarksMap::fuseWith ( CLandmarksMap other,
bool  justInsertAllOfThem = false 
)

Fuses the contents of another map with this one, updating "this" object with the result.

This process involves fusing corresponding landmarks, then adding the new ones.

Parameters
otherThe other landmarkmap, whose landmarks will be inserted into "this"
justInsertAllOfThemIf set to "true", all the landmarks in "other" will be inserted into "this" without checking for possible correspondences (may appear duplicates ones, etc...)

◆ getAs3DObject()

void mrpt::slam::CLandmarksMap::getAs3DObject ( mrpt::opengl::CSetOfObjectsPtr outObj) const
virtual

Returns a 3D object representing the map.

See also
COLOR_LANDMARKS_IN_3DSCENES

Implements mrpt::slam::CMetricMap.

◆ getAsSimplePointsMap() [1/2]

virtual const CSimplePointsMap* mrpt::slam::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::slam::CPointsMap, mrpt::slam::CMultiMetricMap, and mrpt::slam::CSimplePointsMap.

Definition at line 382 of file CMetricMap.h.

◆ getAsSimplePointsMap() [2/2]

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

◆ getMapMaxID()

mrpt::slam::CLandmark::TLandmarkID mrpt::slam::CLandmarksMap::getMapMaxID ( )

◆ GetRuntimeClass()

virtual const mrpt::utils::TRuntimeClassId* mrpt::slam::CLandmarksMap::GetRuntimeClass ( ) const
virtual

Returns information about the class of an object in runtime.

Reimplemented from mrpt::slam::CMetricMap.

◆ hasSubscribers()

bool mrpt::utils::CObservable::hasSubscribers ( ) const
inlineprotectedinherited

Can be called by a derived class before preparing an event for publishing with publishEvent to determine if there is no one subscribed, so it can save the wasted time preparing an event that will be not read.

Definition at line 50 of file CObservable.h.

◆ insertObservation()

bool mrpt::slam::CMetricMap::insertObservation ( const CObservation obs,
const CPose3D robotPose = NULL 
)
inlineinherited

Insert the observation information into this map.

This method must be implemented in derived classes.

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

◆ insertObservationPtr()

bool mrpt::slam::CMetricMap::insertObservationPtr ( const CObservationPtr obs,
const CPose3D robotPose = NULL 
)
inlineinherited

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

Definition at line 161 of file CMetricMap.h.

References MRPT_END, MRPT_START, mrpt::slam::CObservationPtr::pointer(), mrpt::stlplus::smart_ptr_base< T, C, COUNTER >::present(), and THROW_EXCEPTION.

◆ internal_clear()

virtual void mrpt::slam::CLandmarksMap::internal_clear ( )
privatevirtual

Internal method called by clear()

Implements mrpt::slam::CMetricMap.

◆ internal_insertObservation()

virtual bool mrpt::slam::CLandmarksMap::internal_insertObservation ( const CObservation obs,
const CPose3D robotPose = NULL 
)
privatevirtual

Insert the observation information into this map.

This method must be implemented in derived classes.

Parameters
obsThe observation
robotPoseThe 3D pose of the robot mobile base in the map reference system, or NULL (default) if you want to use CPose2D(0,0,deg)
See also
CObservation::insertObservationInto

Implements mrpt::slam::CMetricMap.

◆ isEmpty()

bool mrpt::slam::CLandmarksMap::isEmpty ( ) const
virtual

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

Implements mrpt::slam::CMetricMap.

◆ loadFromProbabilisticPosesAndObservations()

void mrpt::slam::CMetricMap::loadFromProbabilisticPosesAndObservations ( const CSimpleMap Map)
inherited

Load the map contents from a CSimpleMap object, erasing all previous content of the map.

This is automaticed invoking "insertObservation" for each observation at the mean 3D robot pose as given by the "poses::CPosePDF" in the CSimpleMap object.

See also
insertObservation, CSimpleMap
Exceptions
std::exceptionSome internal steps in invoked methods can raise exceptions on invalid parameters, etc...

◆ loadFromSimpleMap()

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

Load the map contents from a CSimpleMap object, erasing all previous content of the map.

This is automaticed invoking "insertObservation" for each observation at the mean 3D robot pose as given by the "poses::CPosePDF" in the CSimpleMap object.

See also
insertObservation, CSimpleMap
Exceptions
std::exceptionSome internal steps in invoked methods can raise exceptions on invalid parameters, etc...

Definition at line 138 of file CMetricMap.h.

◆ loadOccupancyFeaturesFrom2DRangeScan()

void mrpt::slam::CLandmarksMap::loadOccupancyFeaturesFrom2DRangeScan ( const CObservation2DRangeScan obs,
const CPose3D robotPose = NULL,
unsigned int  downSampleFactor = 1 
)

Loads into this landmarks-map a set of occupancy features according to a 2D range scan (Previous contents of map will be erased)

Parameters
obsThe observation
robotPoseThe robot pose in the map (Default = the origin) Some options may be applicable from "insertionOptions"

◆ loadSiftFeaturesFromImageObservation()

void mrpt::slam::CLandmarksMap::loadSiftFeaturesFromImageObservation ( const CObservationImage obs,
const mrpt::vision::CFeatureExtraction::TOptions feat_options = mrpt::vision::CFeatureExtraction::TOptions(mrpt::vision::featSIFT) 
)

Loads into this landmarks map the SIFT features extracted from an image observation (Previous contents of map will be erased) The robot is assumed to be at the origin of the map.

Some options may be applicable from "insertionOptions" (insertionOptions.SIFTsLoadDistanceOfTheMean)

Parameters
feat_optionsOptionally, you can pass here parameters for changing the default SIFT detector settings.

◆ loadSiftFeaturesFromStereoImageObservation()

void mrpt::slam::CLandmarksMap::loadSiftFeaturesFromStereoImageObservation ( const CObservationStereoImages obs,
mrpt::slam::CLandmark::TLandmarkID  fID,
const mrpt::vision::CFeatureExtraction::TOptions feat_options = mrpt::vision::CFeatureExtraction::TOptions(mrpt::vision::featSIFT) 
)

Loads into this landmarks map the SIFT features extracted from an observation consisting of a pair of stereo-image (Previous contents of map will be erased) The robot is assumed to be at the origin of the map.

Some options may be applicable from "insertionOptions"

Parameters
feat_optionsOptionally, you can pass here parameters for changing the default SIFT detector settings.

◆ publishEvent()

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

Called when you want this object to emit an event to all the observers currently subscribed to this object.

◆ readFromStream()

void mrpt::slam::CLandmarksMap::readFromStream ( mrpt::utils::CStream in,
int  version 
)
protectedvirtual

Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori.

Parameters
inThe input binary stream where the object data must read from.
versionThe version of the object stored in the stream: use this version number in your code to know how to read the incoming data.
Exceptions
std::exceptionOn any error, see CStream::ReadBuffer
See also
CStream

Implements mrpt::utils::CSerializable.

◆ saveMetricMapRepresentationToFile()

void mrpt::slam::CLandmarksMap::saveMetricMapRepresentationToFile ( const std::string &  filNamePrefix) const
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:

  • "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.

Implements mrpt::slam::CMetricMap.

◆ saveToMATLABScript2D()

bool mrpt::slam::CLandmarksMap::saveToMATLABScript2D ( std::string  file,
const char *  style = "b",
float  stdCount = 2.0f 
)

Save to a MATLAB script which displays 2D error ellipses for the map (top-view, projection on the XY plane).

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 "stdCount" times the "standard deviations". (default is 2std = 95% confidence intervals)
Returns
Returns false if any error occured, true elsewere.

◆ saveToMATLABScript3D()

bool mrpt::slam::CLandmarksMap::saveToMATLABScript3D ( 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.

◆ saveToTextFile()

bool mrpt::slam::CLandmarksMap::saveToTextFile ( std::string  file)

Save to a text file.

In line "i" there are the (x,y,z) mean values of the i'th landmark + type of landmark + # times seen + timestamp + RGB/descriptor + ID

Returns false if any error occured, true elsewere.

◆ simulateBeaconReadings()

void mrpt::slam::CLandmarksMap::simulateBeaconReadings ( const CPose3D in_robotPose,
const CPoint3D in_sensorLocationOnRobot,
CObservationBeaconRanges out_Observations 
) const

Simulates a noisy 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.

◆ simulateRangeBearingReadings()

void mrpt::slam::CLandmarksMap::simulateRangeBearingReadings ( const CPose3D robotPose,
const CPose3D sensorLocationOnRobot,
CObservationBearingRange observations,
bool  sensorDetectsIDs = true,
const float  stdRange = 0.01f,
const float  stdYaw = DEG2RAD(0.1f),
const float  stdPitch = DEG2RAD(0.1f),
vector_size_t real_associations = NULL,
const double  spurious_count_mean = 0,
const double  spurious_count_std = 0 
) const

Simulates a noisy bearing-range observation of all the beacons (landamrks with type glBeacon) in the landmarks map, if any.

Parameters
[in]robotPoseThe robot pose.
[in]sensorLocationOnRobotThe 3D position of the sensor on the robot
[out]observationsThe results will be stored here.
[in]sensorDetectsIDsIf this is set to false, all the landmarks will be sensed with INVALID_LANDMARK_ID as ID.
[in]stdRangeThe sigma of the sensor noise in range (meters).
[in]stdYawThe sigma of the sensor noise in yaw (radians).
[in]stdPitchThe sigma of the sensor noise in pitch (radians).
[out]real_associationsIf it's not a NULL pointer, this will contain at the return the real indices of the landmarks in the map in the same order than they appear in out_Observations. Useful when sensorDetectsIDs=false. Spurious readings are assigned a std::string::npos (=-1) index.
[in]spurious_count_meanThe mean number of spurious measurements (uniformly distributed in range & angle) to generate. The number of spurious is generated by rounding a random Gaussin number. If both this mean and the std are zero (the default) no spurious readings are generated.
[in]spurious_count_stdRead spurious_count_mean above.
Note
The fields "CObservationBearingRange::fieldOfView_*","CObservationBearingRange::maxSensorDistance" and "CObservationBearingRange::minSensorDistance" MUST BE FILLED OUT before calling this function.
At output, the observation will have CObservationBearingRange::validCovariances set to "false" and the 3 sensor_std_* members correctly set to their values. 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 or field of view-

◆ size()

size_t mrpt::slam::CLandmarksMap::size ( ) const

Returns the stored landmarks count.

◆ squareDistanceToClosestCorrespondence()

virtual float mrpt::slam::CMetricMap::squareDistanceToClosestCorrespondence ( float  x0,
float  y0 
) const
inlinevirtualinherited

Returns the square distance from the 2D point (x0,y0) to the closest correspondence in the map.

Reimplemented in mrpt::slam::CPointsMap.

Definition at line 369 of file CMetricMap.h.

References MRPT_END, MRPT_START, and THROW_EXCEPTION.

◆ writeToStream()

void mrpt::slam::CLandmarksMap::writeToStream ( mrpt::utils::CStream out,
int *  getVersion 
) const
protectedvirtual

Introduces a pure virtual method responsible for writing to a CStream.

This can not be used directly be users, instead use "stream << object;" for writing it to a stream.

Parameters
outThe output binary stream where object must be dumped.
getVersionIf NULL, the object must be dumped. If not, only the version of the object dump must be returned in this pointer. This enables the versioning of objects dumping and backward compatibility with previously stored data.
Exceptions
std::exceptionOn any error, see CStream::WriteBuffer
See also
CStream

Implements mrpt::utils::CSerializable.

Member Data Documentation

◆ _init_CLandmarksMap

mrpt::utils::CLASSINIT mrpt::slam::CLandmarksMap::_init_CLandmarksMap
staticprotected

Definition at line 66 of file CLandmarksMap.h.

◆ _mapMaxID

mrpt::slam::CLandmark::TLandmarkID mrpt::slam::CLandmarksMap::_mapMaxID
static

Definition at line 166 of file CLandmarksMap.h.

◆ _maxIDUpdated

bool mrpt::slam::CLandmarksMap::_maxIDUpdated
static

Definition at line 167 of file CLandmarksMap.h.

◆ _mEDD

std::map<std::pair<mrpt::slam::CLandmark::TLandmarkID, mrpt::slam::CLandmark::TLandmarkID>, double> mrpt::slam::CLandmarksMap::_mEDD
static

Map of the Euclidean Distance between the descriptors of two SIFT-based landmarks.

Definition at line 165 of file CLandmarksMap.h.

◆ classCLandmarksMap

mrpt::utils::TRuntimeClassId mrpt::slam::CLandmarksMap::classCLandmarksMap
static

Definition at line 66 of file CLandmarksMap.h.

◆ classCMetricMap

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

Definition at line 95 of file CMetricMap.h.

◆ classCObject

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

Definition at line 120 of file CObject.h.

◆ classCSerializable

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

Definition at line 35 of file CSerializable.h.

◆ classinfo

const mrpt::utils::TRuntimeClassId* mrpt::slam::CLandmarksMap::classinfo
static

Definition at line 66 of file CLandmarksMap.h.

◆ COLOR_LANDMARKS_IN_3DSCENES

mrpt::utils::TColorf mrpt::slam::CLandmarksMap::COLOR_LANDMARKS_IN_3DSCENES
static

The color of landmark ellipsoids in CLandmarksMap::getAs3DObject.

Definition at line 83 of file CLandmarksMap.h.

◆ fuseOptions

struct VISION_IMPEXP mrpt::slam::CLandmarksMap::TFuseOptions mrpt::slam::CLandmarksMap::fuseOptions

◆ insertionOptions

mrpt::slam::CLandmarksMap::TInsertionOptions mrpt::slam::CLandmarksMap::insertionOptions

◆ insertionResults

struct VISION_IMPEXP mrpt::slam::CLandmarksMap::TInsertionResults mrpt::slam::CLandmarksMap::insertionResults

◆ landmarks

struct VISION_IMPEXP mrpt::slam::CLandmarksMap::TCustomSequenceLandmarks mrpt::slam::CLandmarksMap::landmarks

◆ likelihoodOptions

mrpt::slam::CLandmarksMap::TLikelihoodOptions mrpt::slam::CLandmarksMap::likelihoodOptions

◆ m_disableSaveAs3DObject

bool mrpt::slam::CMetricMap::m_disableSaveAs3DObject
inherited

When set to true (default=false), calling "getAs3DObject" will have no effects.

Definition at line 357 of file CMetricMap.h.




Page generated by Doxygen 1.8.14 for MRPT 1.1.0 SVN: at lun oct 28 00:54:49 CET 2019 Hosted on:
SourceForge.net Logo