Main MRPT website > C++ reference
MRPT logo
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes
mrpt::slam::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::slam::CBeacon objects.
When invoking CBeaconMap::insertObservation(), landmarks will be extracted and fused into the map. The only currently supported observation type is mrpt::slam::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

#include <mrpt/slam/CBeaconMap.h>

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

List of all members.

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

Public Types

typedef std::deque< CBeaconTSequenceBeacons
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 CBeaconoperator[] (size_t i) const
 Access to individual beacons.
const CBeaconget (size_t i) const
 Access to individual beacons.
CBeaconoperator[] (size_t i)
 Access to individual beacons.
CBeaconget (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 CMetricMap *otherMap, const CPose3D &otherMapPose, float minDistForCorr=0.10f, float minMahaDistForCorr=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.
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.
size_t size () const
 Returns the stored landmarks count.
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.
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 size_t decimation_other_map_points=1, const size_t offset_other_map_points=0) const
 Computes the matchings between this and another 2D points map.
void computeMatchingWith3DLandmarks (const mrpt::slam::CBeaconMap *otherMap, 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 CPose3D &newOrg)
 Changes the reference system of the map to a given 3D pose.
void changeCoordinatesReference (const CPose3D &newOrg, const mrpt::slam::CBeaconMap *otherMap)
 Changes the reference system of the map "otherMap" and save the result in "this" map.
bool isEmpty () const
 Returns true if the map is empty/no observation has been inserted.
void simulateBeaconReadings (const CPose3D &in_robotPose, const CPoint3D &in_sensorLocationOnRobot, 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
 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
 Returns a 3D object representing the map.
const CBeacongetBeaconByID (CBeacon::TBeaconID id) const
 Returns a pointer to the beacon with the given ID, or NULL if it does not exist.
CBeacongetBeaconByID (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 CSimpleMap &Map)
 Load the map contents from a CSimpleMap object, erasing all previous content of the map.
void loadFromSimpleMap (const CSimpleMap &Map)
 Load the map contents from a CSimpleMap object, erasing all previous content of the map.
bool insertObservation (const CObservation *obs, const CPose3D *robotPose=NULL)
 Insert the observation information into this map.
bool insertObservationPtr (const CObservationPtr &obs, const CPose3D *robotPose=NULL)
 A wrapper for smart pointers, just calls the non-smart pointer version.
double computeObservationLikelihood (const CObservation *obs, const CPose2D &takenFrom)
 Computes the log-likelihood of a given observation given an arbitrary robot 2D pose.
virtual bool canComputeObservationLikelihood (const CObservation *obs)
 Returns true if this map is able to compute a sensible likelihood function for this observation (i.e.
double computeObservationsLikelihood (const CSensoryFrame &sf, const CPose2D &takenFrom)
 Returns the sum of the log-likelihoods of each individual observation within a mrpt::slam::CSensoryFrame.
bool canComputeObservationsLikelihood (const CSensoryFrame &sf)
 Returns true if this map is able to compute a sensible likelihood function for this observation (i.e.
virtual 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
 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 (const float &x0, const float &y0) const
 Returns the square distance from the 2D point (x0,y0) to the closest correspondence in the map.
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.
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).
CObjectclone () const
 Cloning interface for smart pointers.

Public Attributes

mrpt::slam::CBeaconMap::TLikelihoodOptions likelihoodOptions
mrpt::slam::CBeaconMap::TInsertionOptions insertionOptions
bool m_disableSaveAs3DObject
 When set to true (default=false), calling "getAs3DObject" will have no effects.

Static Public Attributes

static const
mrpt::utils::TRuntimeClassId 
classCObject
RTTI stuff
static const
mrpt::utils::TRuntimeClassId 
classCSerializable

Protected Member Functions

virtual void internal_clear ()
 Clear the map, erasing all landmarks.
virtual bool internal_insertObservation (const CObservation *obs, const CPose3D *robotPose=NULL)
 Insert the observation information into this map.
virtual void writeToStream (mrpt::utils::CStream &out, int *getVersion) const =0
 Introduces a pure virtual method responsible for writing to a CStream.
virtual void readFromStream (mrpt::utils::CStream &in, int version)=0
 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.
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.

Protected Attributes

TSequenceBeacons m_beacons
 The individual beacons.

RTTI stuff

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
 Returns information about the class of an object in runtime.
virtual mrpt::utils::CObjectduplicate () const
 Returns a copy of the object, indepently of its class.
static mrpt::utils::CObjectCreateObject ()
static CBeaconMapPtr Create ()

RTTI stuff

static const
mrpt::utils::TRuntimeClassId 
classCMetricMap
class mrpt::utils::CStream

Member Typedef Documentation

Definition at line 77 of file CBeaconMap.h.

Definition at line 76 of file CBeaconMap.h.

A typedef for the associated smart pointer

Definition at line 72 of file CBeaconMap.h.

Definition at line 75 of file CBeaconMap.h.


Constructor & Destructor Documentation

mrpt::slam::CBeaconMap::CBeaconMap ( )

Constructor.


Member Function Documentation

static const mrpt::utils::TRuntimeClassId* mrpt::slam::CBeaconMap::_GetBaseClass ( ) [static, protected]

Reimplemented from mrpt::slam::CMetricMap.

virtual void mrpt::slam::CMetricMap::auxParticleFilterCleanUp ( ) [inline, virtual, inherited]

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

Definition at line 326 of file CMetricMap.h.

iterator mrpt::slam::CBeaconMap::begin ( ) [inline]

Definition at line 123 of file CBeaconMap.h.

const_iterator mrpt::slam::CBeaconMap::begin ( ) const [inline]

Definition at line 124 of file CBeaconMap.h.

virtual bool mrpt::slam::CMetricMap::canComputeObservationLikelihood ( const CObservation obs) [inline, virtual, 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:
obsThe observation.
See also:
computeObservationLikelihood

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

Definition at line 184 of file CMetricMap.h.

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
void mrpt::slam::CBeaconMap::changeCoordinatesReference ( const CPose3D newOrg)

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

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

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

void mrpt::slam::CMetricMap::clear ( ) [inherited]
CObject* mrpt::utils::CObject::clone ( ) const [inline, inherited]

Cloning interface for smart pointers.

Reimplemented in mrpt::opengl::CRenderizable, and mrpt::opengl::CRenderizableDisplayList.

Definition at line 154 of file CObject.h.

float mrpt::slam::CBeaconMap::compute3DMatchingRatio ( const CMetricMap otherMap,
const CPose3D otherMapPose,
float  minDistForCorr = 0.10f,
float  minMahaDistForCorr = 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".
minDistForCorr[IN] The minimum distance between 2 non-probabilistic map elements for counting them as a correspondence.
minMahaDistForCorr[IN] The minimum Mahalanobis distance between 2 probabilistic map elements for counting them as a correspondence.
Returns:
The matching ratio [0,1]
See also:
computeMatchingWith2D

Implements mrpt::slam::CMetricMap.

void mrpt::slam::CBeaconMap::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 size_t  decimation_other_map_points = 1,
const size_t  offset_other_map_points = 0 
) const [virtual]

Computes the matchings between this and another 2D points map.

This includes finding:

  • The set of points pairs in each map
  • The mean squared distance between corresponding pairs. This method is the most time critical one into the ICP algorithm.
Parameters:
otherMap[IN] The other map to compute the matching with.
otherMapPose[IN] The pose of the other map as seen from "this".
maxDistForCorrespondence[IN] Maximum 2D linear distance between two points to be matched.
maxAngularDistForCorrespondence[IN] In radians: The aim is to allow larger distances to more distant correspondences.
angularDistPivotPoint[IN] The point used to calculate distances from in both maps.
correspondences[OUT] The detected matchings pairs.
correspondencesRatio[OUT] The ratio [0,1] of points in otherMap with at least one correspondence.
sumSqrDist[OUT] The sum of all matched points squared distances.If undesired, set to NULL, as default.
covariance[OUT] The resulting matching covariance 3x3 matrix, or NULL if undesired.
onlyKeepTheClosest[IN] If set to true, only the closest correspondence will be returned. If false (default) all are returned.
See also:
compute3DMatchingRatio

Reimplemented from mrpt::slam::CMetricMap.

virtual 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 [inline, virtual, inherited]

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 the ICP algorithm.

Parameters:
otherMap[IN] The other map to compute the matching with.
otherMapPose[IN] The pose of the other map as seen from "this".
maxDistForCorrespondence[IN] Maximum 2D linear distance between two points to be matched.
maxAngularDistForCorrespondence[IN] In radians: The aim is to allow larger distances to more distant correspondences.
angularDistPivotPoint[IN] The point used to calculate distances from in both maps.
correspondences[OUT] The detected matchings pairs.
correspondencesRatio[OUT] The ratio [0,1] of points in otherMap with at least one correspondence.
sumSqrDist[OUT] The sum of all matched points squared distances.If undesired, set to NULL, as default.
onlyKeepTheClosest[IN] If set to true, only the closest correspondence will be returned. If false (default) all are returned.
See also:
compute3DMatchingRatio

Reimplemented in mrpt::slam::CPointsMap.

Definition at line 272 of file CMetricMap.h.

References MRPT_START, THROW_EXCEPTION, and MRPT_END.

void mrpt::slam::CBeaconMap::computeMatchingWith3DLandmarks ( const mrpt::slam::CBeaconMap otherMap,
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.
double mrpt::slam::CMetricMap::computeObservationLikelihood ( const CObservation obs,
const CPose2D takenFrom 
) [inline, inherited]

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

double mrpt::slam::CBeaconMap::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.

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
static CBeaconMapPtr mrpt::slam::CBeaconMap::Create ( ) [static]
static mrpt::utils::CObject* mrpt::slam::CBeaconMap::CreateObject ( ) [static]
virtual mrpt::utils::CObject* mrpt::slam::CBeaconMap::duplicate ( ) const [virtual]

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

Implements mrpt::utils::CObject.

mrpt::utils::CObjectPtr mrpt::utils::CObject::duplicateGetSmartPtr ( ) const [inline, inherited]

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 151 of file CObject.h.

iterator mrpt::slam::CBeaconMap::end ( ) [inline]

Definition at line 125 of file CBeaconMap.h.

const_iterator mrpt::slam::CBeaconMap::end ( ) const [inline]

Definition at line 126 of file CBeaconMap.h.

const CBeacon& mrpt::slam::CBeaconMap::get ( size_t  i) const [inline]

Access to individual beacons.

Definition at line 108 of file CBeaconMap.h.

References ASSERT_.

CBeacon& mrpt::slam::CBeaconMap::get ( size_t  i) [inline]

Access to individual beacons.

Definition at line 118 of file CBeaconMap.h.

References ASSERT_.

void mrpt::slam::CBeaconMap::getAs3DObject ( mrpt::opengl::CSetOfObjectsPtr outObj) const [virtual]

Returns a 3D object representing the map.

Implements mrpt::slam::CMetricMap.

virtual const CSimplePointsMap* mrpt::slam::CMetricMap::getAsSimplePointsMap ( ) const [inline, virtual, inherited]

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

virtual CSimplePointsMap* mrpt::slam::CMetricMap::getAsSimplePointsMap ( ) [inline, virtual, inherited]
const CBeacon* mrpt::slam::CBeaconMap::getBeaconByID ( CBeacon::TBeaconID  id) const

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

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

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

virtual const mrpt::utils::TRuntimeClassId* mrpt::slam::CBeaconMap::GetRuntimeClass ( ) const [virtual]

Returns information about the class of an object in runtime.

Reimplemented from mrpt::slam::CMetricMap.

bool mrpt::utils::CObservable::hasSubscribers ( ) const [inline, protected, inherited]

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 69 of file CObservable.h.

bool mrpt::slam::CMetricMap::insertObservation ( const CObservation obs,
const CPose3D robotPose = NULL 
) [inline, inherited]

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

bool mrpt::slam::CMetricMap::insertObservationPtr ( const CObservationPtr obs,
const CPose3D robotPose = NULL 
) [inline, inherited]

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

Definition at line 147 of file CMetricMap.h.

References MRPT_START, THROW_EXCEPTION, mrpt::slam::CObservationPtr::pointer(), and MRPT_END.

virtual void mrpt::slam::CBeaconMap::internal_clear ( ) [protected, virtual]

Clear the map, erasing all landmarks.

Implements mrpt::slam::CMetricMap.

virtual bool mrpt::slam::CBeaconMap::internal_insertObservation ( const CObservation obs,
const CPose3D robotPose = NULL 
) [protected, virtual]

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.

bool mrpt::slam::CBeaconMap::isEmpty ( ) const [virtual]

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

Implements mrpt::slam::CMetricMap.

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...
void mrpt::slam::CMetricMap::loadFromSimpleMap ( const CSimpleMap Map) [inline, 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...

Definition at line 124 of file CMetricMap.h.

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

Access to individual beacons.

Definition at line 103 of file CBeaconMap.h.

References ASSERT_.

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

Access to individual beacons.

Definition at line 113 of file CBeaconMap.h.

References ASSERT_.

void mrpt::utils::CObservable::publishEvent ( const mrptEvent e) const [protected, inherited]

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

void mrpt::slam::CBeaconMap::push_back ( const CBeacon m) [inline]

Inserts a copy of the given mode into the SOG.

Definition at line 129 of file CBeaconMap.h.

virtual void mrpt::utils::CSerializable::readFromStream ( mrpt::utils::CStream in,
int  version 
) [protected, pure virtual, inherited]

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

Implemented in mrpt::math::CMatrixD, and mrpt::math::CMatrix.

void mrpt::slam::CBeaconMap::resize ( const size_t  N)

Resize the number of SOG modes.

void mrpt::slam::CBeaconMap::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.
  • "filNamePrefix"+"_covs.m": A textual representation (see saveToTextFile)

Implements mrpt::slam::CMetricMap.

bool mrpt::slam::CBeaconMap::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.
void mrpt::slam::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
void mrpt::slam::CBeaconMap::simulateBeaconReadings ( const CPose3D in_robotPose,
const CPoint3D in_sensorLocationOnRobot,
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.
size_t mrpt::slam::CBeaconMap::size ( ) const

Returns the stored landmarks count.

virtual float mrpt::slam::CMetricMap::squareDistanceToClosestCorrespondence ( const float &  x0,
const float &  y0 
) const [inline, virtual, inherited]

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

Definition at line 333 of file CMetricMap.h.

References MRPT_START, THROW_EXCEPTION, and MRPT_END.

virtual void mrpt::utils::CSerializable::writeToStream ( mrpt::utils::CStream out,
int *  getVersion 
) const [protected, pure virtual, inherited]

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

Implemented in mrpt::math::CMatrixD, and mrpt::math::CMatrix.


Friends And Related Function Documentation

friend class mrpt::utils::CStream [friend, inherited]

Reimplemented from mrpt::utils::CSerializable.

Reimplemented in mrpt::slam::CRandomFieldGridMap2D, and mrpt::slam::CPointsMap.

Definition at line 81 of file CMetricMap.h.


Member Data Documentation

Definition at line 72 of file CBeaconMap.h.

Definition at line 72 of file CBeaconMap.h.

Definition at line 81 of file CMetricMap.h.

Definition at line 139 of file CObject.h.

Definition at line 56 of file CSerializable.h.

Definition at line 72 of file CBeaconMap.h.

The individual beacons.

Definition at line 81 of file CBeaconMap.h.

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

Definition at line 321 of file CMetricMap.h.




Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011