Main MRPT website > C++ reference
MRPT logo
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes

mrpt::slam::CBeacon Class Reference


Detailed Description

The class for storing individual "beacon landmarks" under a variety of 3D position PDF distributions.

This class is used for storage within the class CBeaconMap. The class implements the same methods than the interface "CPointPDF", and invoking them actually becomes a mapping into the methods of the current PDF representation of the beacon, selectable by means of "m_typePDF"

See also:
CBeaconMap, CPointPDFSOG

Definition at line 61 of file CBeacon.h.

#include <mrpt/slam/CBeacon.h>

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

List of all members.

Public Types

enum  TTypePDF { pdfMonteCarlo = 0, pdfGauss, pdfSOG }
 

See m_typePDF.

More...
typedef int64_t TBeaconID
 The type for the IDs of landmarks.

Public Member Functions

 CBeacon ()
 Default constructor.
virtual ~CBeacon ()
 Virtual destructor.
void getMean (CPoint3D &mean_point) const
 Returns an estimate of the point, (the mean, or mathematical expectation of the PDF).
void getCovarianceAndMean (CMatrixDouble33 &cov, CPoint3D &mean_point) const
 Returns an estimate of the point covariance matrix (3x3 cov matrix) and the mean, both at once.
void copyFrom (const CPointPDF &o)
 Copy operator, translating if necesary (for example, between particles and gaussian representations)
void saveToTextFile (const std::string &file) const
 Save PDF's particles to a text file.
void changeCoordinatesReference (const CPose3D &newReferenceBase)
 This can be used to convert a PDF from local coordinates to global, providing the point (newReferenceBase) from which "to project" the current pdf.
void getAs3DObject (mrpt::opengl::CSetOfObjectsPtr &outObj) const
 Saves a 3D representation of the beacon into a given OpenGL scene.
void getAsMatlabDrawCommands (utils::CStringList &out_Str) const
 Gets a set of MATLAB commands which draw the current state of the beacon:
void drawSingleSample (CPoint3D &outSample) const
 Draw a sample from the pdf.
void bayesianFusion (const CPointPDF &p1, const CPointPDF &p2, const double &minMahalanobisDistToDrop=0)
 Bayesian fusion of two point distributions (product of two distributions->new distribution), then save the result in this object (WARNING: See implementing classes to see classes that can and cannot be mixtured!)
void generateObservationModelDistribution (const float &sensedRange, CPointPDFSOG &outPDF, const CBeaconMap *myBeaconMap, const CPoint3D &sensorPntOnRobot, const CPoint3D &centerPoint=CPoint3D(0, 0, 0), const float &maxDistanceFromCenter=0) const
 Compute the observation model p(z_t|x_t) for a given observation (range value), and return it as an approximate SOG.

Static Public Member Functions

static void generateRingSOG (const float &sensedRange, CPointPDFSOG &outPDF, const CBeaconMap *myBeaconMap, const CPoint3D &sensorPnt, const CMatrixDouble33 *covarianceCompositionToAdd=NULL, bool clearPreviousContentsOutPDF=true, const CPoint3D &centerPoint=CPoint3D(0, 0, 0), const float &maxDistanceFromCenter=0)
 This static method returns a SOG with ring-shape (or as a 3D sphere) that can be used to initialize a beacon if observed the first time.

Public Attributes

TTypePDF m_typePDF
 Which one of the different 3D point PDF is currently used in this object: montecarlo, gaussian, or a sum of gaussians.
CPointPDFParticles m_locationMC
 The individual PDF, if m_typePDF=pdfMonteCarlo (publicly accesible for ease of use, but the CPointPDF interface is also implemented in CBeacon).
CPointPDFGaussian m_locationGauss
 The individual PDF, if m_typePDF=pdfGauss (publicly accesible for ease of use, but the CPointPDF interface is also implemented in CBeacon).
CPointPDFSOG m_locationSOG
 The individual PDF, if m_typePDF=pdfSOG (publicly accesible for ease of use, but the CPointPDF interface is also implemented in CBeacon).
TBeaconID m_ID
 An ID for the landmark (see details next...) This ID was introduced in the version 3 of this class (21/NOV/2006), and its aim is to provide a way for easily establishing correspondences between landmarks detected in sequential image frames.

RTTI stuff

typedef CBeaconPtr SmartPtr
static mrpt::utils::CLASSINIT _init_CBeacon
static mrpt::utils::TRuntimeClassId classCBeacon
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 CBeaconPtr Create ()

Member Typedef Documentation

A typedef for the associated smart pointer

Definition at line 64 of file CBeacon.h.

The type for the IDs of landmarks.

Definition at line 69 of file CBeacon.h.


Member Enumeration Documentation

See m_typePDF.

Enumerator:
pdfMonteCarlo 
pdfGauss 
pdfSOG 

Definition at line 73 of file CBeacon.h.


Constructor & Destructor Documentation

mrpt::slam::CBeacon::CBeacon ( )

Default constructor.

virtual mrpt::slam::CBeacon::~CBeacon ( ) [virtual]

Virtual destructor.


Member Function Documentation

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

Reimplemented from mrpt::poses::CPointPDF.

void mrpt::slam::CBeacon::bayesianFusion ( const CPointPDF p1,
const CPointPDF p2,
const double &  minMahalanobisDistToDrop = 0 
) [virtual]

Bayesian fusion of two point distributions (product of two distributions->new distribution), then save the result in this object (WARNING: See implementing classes to see classes that can and cannot be mixtured!)

Parameters:
p1The first distribution to fuse
p2The second distribution to fuse
minMahalanobisDistToDropIf set to different of 0, the result of very separate Gaussian modes (that will result in negligible components) in SOGs will be dropped to reduce the number of modes in the output.

Implements mrpt::poses::CPointPDF.

void mrpt::slam::CBeacon::changeCoordinatesReference ( const CPose3D newReferenceBase) [virtual]

This can be used to convert a PDF from local coordinates to global, providing the point (newReferenceBase) from which "to project" the current pdf.

Result PDF substituted the currently stored one in the object.

Implements mrpt::utils::CProbabilityDensityFunction< CPoint3D, 3 >.

void mrpt::slam::CBeacon::copyFrom ( const CPointPDF o) [virtual]

Copy operator, translating if necesary (for example, between particles and gaussian representations)

Implements mrpt::poses::CPointPDF.

static CBeaconPtr mrpt::slam::CBeacon::Create ( ) [static]
static mrpt::utils::CObject* mrpt::slam::CBeacon::CreateObject ( ) [static]
void mrpt::slam::CBeacon::drawSingleSample ( CPoint3D outSample) const [virtual]

Draw a sample from the pdf.

Implements mrpt::utils::CProbabilityDensityFunction< CPoint3D, 3 >.

virtual mrpt::utils::CObject* mrpt::slam::CBeacon::duplicate ( ) const [virtual]

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

Implements mrpt::utils::CObject.

void mrpt::slam::CBeacon::generateObservationModelDistribution ( const float &  sensedRange,
CPointPDFSOG outPDF,
const CBeaconMap myBeaconMap,
const CPoint3D sensorPntOnRobot,
const CPoint3D centerPoint = CPoint3D(0, 0, 0),
const float &  maxDistanceFromCenter = 0 
) const

Compute the observation model p(z_t|x_t) for a given observation (range value), and return it as an approximate SOG.

Note that if the beacon is a SOG itself, the number of gaussian modes will be square. As a speed-up, if a "center point"+"maxDistanceFromCenter" is supplied (maxDistanceFromCenter!=0), those modes farther than this sphere will be discarded. Parameters such as the stdSigma of the sensor are gathered from "myBeaconMap" The result is one "ring" for each Gaussian mode that represent the beacon position in this object. The position of the sensor on the robot is used to shift the resulting densities such as they represent the position of the robot, not the sensor.

See also:
CBeaconMap::insertionOptions, generateRingSOG
static void mrpt::slam::CBeacon::generateRingSOG ( const float &  sensedRange,
CPointPDFSOG outPDF,
const CBeaconMap myBeaconMap,
const CPoint3D sensorPnt,
const CMatrixDouble33 covarianceCompositionToAdd = NULL,
bool  clearPreviousContentsOutPDF = true,
const CPoint3D centerPoint = CPoint3D(0, 0, 0),
const float &  maxDistanceFromCenter = 0 
) [static]

This static method returns a SOG with ring-shape (or as a 3D sphere) that can be used to initialize a beacon if observed the first time.

sensorPnt is the center of the ring/sphere, i.e. the absolute position of the range sensor. If clearPreviousContentsOutPDF=false, the SOG modes will be added to the current contents of outPDF If the 3x3 matrix covarianceCompositionToAdd is provided, it will be add to every Gaussian (to model the composition of uncertainty).

See also:
generateObservationModelDistribution
void mrpt::slam::CBeacon::getAs3DObject ( mrpt::opengl::CSetOfObjectsPtr outObj) const

Saves a 3D representation of the beacon into a given OpenGL scene.

void mrpt::slam::CBeacon::getAsMatlabDrawCommands ( utils::CStringList out_Str) const

Gets a set of MATLAB commands which draw the current state of the beacon:

void mrpt::slam::CBeacon::getCovarianceAndMean ( CMatrixDouble33 cov,
CPoint3D mean_point 
) const

Returns an estimate of the point covariance matrix (3x3 cov matrix) and the mean, both at once.

See also:
getMean
void mrpt::slam::CBeacon::getMean ( CPoint3D mean_point) const [virtual]

Returns an estimate of the point, (the mean, or mathematical expectation of the PDF).

See also:
getCovariance

Implements mrpt::utils::CProbabilityDensityFunction< CPoint3D, 3 >.

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

Returns information about the class of an object in runtime.

Reimplemented from mrpt::poses::CPointPDF.

void mrpt::slam::CBeacon::saveToTextFile ( const std::string &  file) const [virtual]

Save PDF's particles to a text file.

See derived classes for more information about the format of generated files.

Implements mrpt::utils::CProbabilityDensityFunction< CPoint3D, 3 >.


Member Data Documentation

Definition at line 64 of file CBeacon.h.

Definition at line 64 of file CBeacon.h.

Definition at line 64 of file CBeacon.h.

An ID for the landmark (see details next...) This ID was introduced in the version 3 of this class (21/NOV/2006), and its aim is to provide a way for easily establishing correspondences between landmarks detected in sequential image frames.

Thus, the management of this field should be:

  • In 'servers' (classes/modules/... that detect landmarks from images): A different ID must be assigned to every landmark (e.g. a sequential counter), BUT only in the case of being sure of the correspondence of one landmark with another one in the past (e.g. tracking).
  • In 'clients': This field can be ignored, but if it is used, the advantage is solving the correspondence between landmarks detected in consequentive instants of time: Two landmarks with the same ID correspond to the same physical feature, BUT it should not be expected the inverse to be always true.

Note that this field is never fill out automatically, it must be set by the programmer if used.

Definition at line 101 of file CBeacon.h.

The individual PDF, if m_typePDF=pdfGauss (publicly accesible for ease of use, but the CPointPDF interface is also implemented in CBeacon).

Definition at line 86 of file CBeacon.h.

The individual PDF, if m_typePDF=pdfMonteCarlo (publicly accesible for ease of use, but the CPointPDF interface is also implemented in CBeacon).

Definition at line 82 of file CBeacon.h.

The individual PDF, if m_typePDF=pdfSOG (publicly accesible for ease of use, but the CPointPDF interface is also implemented in CBeacon).

Definition at line 90 of file CBeacon.h.

Which one of the different 3D point PDF is currently used in this object: montecarlo, gaussian, or a sum of gaussians.

See also:
m_location

Definition at line 78 of file CBeacon.h.




Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:16:28 UTC 2011