Main MRPT website > C++ reference
MRPT logo
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions
mrpt::poses::CPoint2DPDF Class Reference

Detailed Description

Declares a class that represents a Probability Distribution function (PDF) of a 2D point (x,y).

This class is just the base class for unifying many diferent ways this PDF can be implemented.

For convenience, a pose composition is also defined for any PDF derived class, changeCoordinatesReference, in the form of a method rather than an operator.

For a similar class for 6D poses (a 3D point with attitude), see CPose3DPDF

See also the tutorial on probabilistic spatial representations in the MRPT.

See also:
CPoint2D, CPointPDF

#include <mrpt/poses/CPoint2DPDF.h>

Inheritance diagram for mrpt::poses::CPoint2DPDF:
Inheritance graph
[legend]

List of all members.

Public Types

enum  { is_3D_val = 0 }
enum  { is_PDF_val = 1 }
typedef TDATA type_value
 The type of the state the PDF represents.

Public Member Functions

virtual void copyFrom (const CPoint2DPDF &o)=0
 Copy operator, translating if necesary (for example, between particles and gaussian representations)
virtual void bayesianFusion (const CPoint2DPDF &p1, const CPoint2DPDF &p2, const double &minMahalanobisDistToDrop=0)=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!)
virtual CObjectduplicate () const =0
 Returns a copy of the object, indepently of its class.
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.
virtual void getMean (TDATA &mean_point) const =0
 Returns the mean, or mathematical expectation of the probability density distribution (PDF).
virtual void getCovarianceAndMean (CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &cov, TDATA &mean_point) const =0
 Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean, both at once.
void getCovarianceDynAndMean (CMatrixDouble &cov, TDATA &mean_point) const
 Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean, both at once.
TDATA getMeanVal () const
 Returns the mean, or mathematical expectation of the probability density distribution (PDF).
void getCovariance (CMatrixDouble &cov) const
 Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)
void getCovariance (CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &cov) const
 Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)
CMatrixFixedNumeric< double,
STATE_LEN, STATE_LEN > 
getCovariance () const
 Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)
virtual void saveToTextFile (const std::string &file) const =0
 Save PDF's particles to a text file.
virtual void drawSingleSample (TDATA &outPart) const =0
 Draws a single sample from the distribution.
virtual void drawManySamples (size_t N, std::vector< vector_double > &outSamples) const
 Draws a number of samples from the distribution, and saves as a list of 1xSTATE_LEN vectors, where each row contains a (x,y,z,yaw,pitch,roll) datum.
virtual void changeCoordinatesReference (const mrpt::poses::CPose3D &newReferenceBase)=0
 This can be used to convert a PDF from local coordinates to global, providing the point (newReferenceBase) from which "to project" the current pdf.
double getCovarianceEntropy () const
 Compute the entropy of the estimated covariance matrix.

Static Public Member Functions

static bool is_3D ()
static bool is_PDF ()

Static Public Attributes

static const
mrpt::utils::TRuntimeClassId 
classCObject
static const size_t state_length
 The length of the variable, for example, 3 for a 3D point, 6 for a 3D pose (x y z yaw pitch roll).
RTTI stuff
static const
mrpt::utils::TRuntimeClassId 
classCSerializable

Protected Member Functions

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.

RTTI stuff

static const
mrpt::utils::TRuntimeClassId 
classCPoint2DPDF
class mrpt::utils::CStream
static const
mrpt::utils::TRuntimeClassId
_GetBaseClass ()
virtual const
mrpt::utils::TRuntimeClassId
GetRuntimeClass () const
 Returns information about the class of an object in runtime.

Member Typedef Documentation

The type of the state the PDF represents.

Definition at line 54 of file CProbabilityDensityFunction.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
is_3D_val 

Definition at line 72 of file CPoint2DPDF.h.

anonymous enum
Enumerator:
is_PDF_val 

Definition at line 74 of file CPoint2DPDF.h.


Member Function Documentation

static const mrpt::utils::TRuntimeClassId* mrpt::poses::CPoint2DPDF::_GetBaseClass ( ) [static, protected]

Reimplemented from mrpt::utils::CSerializable.

Reimplemented in mrpt::poses::CPoint2DPDFGaussian.

virtual void mrpt::poses::CPoint2DPDF::bayesianFusion ( const CPoint2DPDF p1,
const CPoint2DPDF p2,
const double &  minMahalanobisDistToDrop = 0 
) [pure 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.

Implemented in mrpt::poses::CPoint2DPDFGaussian.

virtual void mrpt::utils::CProbabilityDensityFunction::changeCoordinatesReference ( const mrpt::poses::CPose3D newReferenceBase) [pure virtual, inherited]

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.

Implemented in mrpt::poses::CPoint2DPDFGaussian.

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.

virtual void mrpt::poses::CPoint2DPDF::copyFrom ( const CPoint2DPDF o) [pure virtual]

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

Implemented in mrpt::poses::CPoint2DPDFGaussian.

virtual void mrpt::utils::CProbabilityDensityFunction::drawManySamples ( size_t  N,
std::vector< vector_double > &  outSamples 
) const [inline, virtual, inherited]

Draws a number of samples from the distribution, and saves as a list of 1xSTATE_LEN vectors, where each row contains a (x,y,z,yaw,pitch,roll) datum.

This base method just call N times to drawSingleSample, but derived classes should implemented optimized method for each particular PDF.

Definition at line 126 of file CProbabilityDensityFunction.h.

virtual void mrpt::utils::CProbabilityDensityFunction::drawSingleSample ( TDATA &  outPart) const [pure virtual, inherited]

Draws a single sample from the distribution.

virtual CObject* mrpt::utils::CObject::duplicate ( ) const [pure virtual, inherited]

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

Implemented in mrpt::graphs::CNetworkOfPoses3DInf, mrpt::graphs::CNetworkOfPoses2DInf, mrpt::graphs::CNetworkOfPoses3DCov, mrpt::graphs::CNetworkOfPoses2DCov, mrpt::graphs::CNetworkOfPoses3D, mrpt::graphs::CNetworkOfPoses2D, mrpt::utils::TStereoCamera, mrpt::reactivenav::CLogFileRecord_ND, mrpt::utils::CSimpleDatabase, mrpt::utils::CImage, mrpt::detectors::CDetectable3D, mrpt::slam::CObservation3DRangeScan, mrpt::hmtslam::THypothesisIDSet, mrpt::slam::COccupancyGridMap2D, mrpt::hmtslam::CHMTSLAM, mrpt::hmtslam::CLocalMetricHypothesis, mrpt::gui::CDisplayWindow3D, mrpt::slam::CHeightGridMap2D, mrpt::slam::CObservationIMU, mrpt::slam::CMultiMetricMapPDF, mrpt::slam::CLandmarksMap, mrpt::vision::CFeature, mrpt::slam::CMultiMetricMap, mrpt::slam::CRawlog, mrpt::slam::CSensoryFrame, mrpt::poses::CPose3D, mrpt::slam::CObservation2DRangeScan, mrpt::poses::CPointPDFParticles, mrpt::poses::CPose3DInterpolator, mrpt::opengl::COpenGLViewport, mrpt::slam::CBeaconMap, mrpt::slam::CReflectivityGridMap2D, mrpt::hmtslam::CLSLAMParticleData, mrpt::opengl::CPointCloud, mrpt::detectors::CDetectable2D, mrpt::opengl::COpenGLScene, mrpt::opengl::CPointCloudColoured, mrpt::math::CMatrixD, mrpt::utils::CMHPropertiesValuesList, mrpt::opengl::CPlanarLaserScan, mrpt::slam::CWirelessPowerGridMap2D, mrpt::slam::CObservationStereoImages, mrpt::math::CMatrix, mrpt::poses::CPose3DPDFParticles, mrpt::poses::CPose3DQuat, mrpt::hmtslam::CHMHMapNode, mrpt::slam::CBeacon, mrpt::opengl::CText3D, mrpt::slam::CObservationStereoImagesFeatures, mrpt::opengl::CEllipsoid, mrpt::slam::CLandmark, mrpt::poses::CPose3DQuatPDFGaussian, mrpt::hmtslam::CRobotPosesGraph, mrpt::opengl::CMesh, mrpt::poses::CPosePDFParticles, mrpt::poses::CPosePDFSOG, mrpt::gui::CDisplayWindowPlots, mrpt::slam::CGasConcentrationGridMap2D, mrpt::slam::CObservationImage, mrpt::opengl::CSetOfLines, mrpt::opengl::CText, mrpt::poses::CPose3DPDFGaussian, mrpt::poses::CPose3DPDFGaussianInf, mrpt::hmtslam::CHMHMapArc, mrpt::opengl::CPolyhedron, mrpt::poses::CPosePDFGaussianInf, mrpt::hmtslam::CHierarchicalMHMap, mrpt::opengl::CAngularObservationMesh, mrpt::slam::CColouredPointsMap, mrpt::slam::CIncrementalMapPartitioner, mrpt::slam::CRBPFParticleData, mrpt::poses::CPoint2D, mrpt::poses::CPointPDFSOG, mrpt::poses::CPose2D, mrpt::slam::CSimplePointsMap, mrpt::opengl::CDisk, mrpt::opengl::CSetOfObjects, mrpt::poses::CPose3DPDFSOG, mrpt::utils::TCamera, mrpt::slam::CActionRobotMovement2D, mrpt::slam::CObservationBatteryState, mrpt::opengl::CGridPlaneXY, mrpt::opengl::CGridPlaneXZ, mrpt::poses::CPoint3D, mrpt::poses::CPosePDFGaussian, mrpt::slam::CSimpleMap, mrpt::opengl::CArrow, mrpt::opengl::CAxis, mrpt::opengl::CSphere, mrpt::slam::CWeightedPointsMap, mrpt::opengl::CCamera, mrpt::poses::CPosePDFGrid, mrpt::utils::CStringList, mrpt::slam::CObservationOdometry, mrpt::opengl::CBox, mrpt::opengl::CSetOfTexturedTriangles, mrpt::utils::CMemoryChunk, mrpt::slam::CActionCollection, mrpt::slam::CObservationGPS, mrpt::slam::CObservationRange, mrpt::reactivenav::CLogFileRecord, mrpt::math::CSplineInterpolator1D, mrpt::utils::CPropertiesValuesList, mrpt::gui::CDisplayWindow, mrpt::slam::CObservationBearingRange, mrpt::slam::CObservationGasSensors, mrpt::slam::CObservationWirelessPower, mrpt::opengl::C3DSScene, mrpt::slam::CObservationVisualLandmarks, mrpt::math::CMatrixB, mrpt::poses::CPointPDFGaussian, mrpt::poses::CPoses2DSequence, mrpt::poses::CPoses3DSequence, mrpt::utils::CSimpleDatabaseTable, mrpt::slam::CActionRobotMovement3D, mrpt::slam::CObservationBeaconRanges, mrpt::slam::CObservationComment, mrpt::opengl::CCylinder, mrpt::opengl::CSetOfTriangles, mrpt::slam::CObservationReflectivity, mrpt::opengl::CGeneralizedCylinder, mrpt::math::CPolygon, mrpt::poses::CPoint2DPDFGaussian, mrpt::poses::TSimple3DPoint, mrpt::opengl::COpenGLStandardObject, mrpt::opengl::CSimpleLine, mrpt::opengl::CTexturedPlane, mrpt::utils::CTypeSelector, and mrpt::reactivenav::CLogFileRecord_VFF.

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.

void mrpt::utils::CProbabilityDensityFunction::getCovariance ( CMatrixDouble cov) const [inline, inherited]

Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)

See also:
getMean, getCovarianceAndMean

Definition at line 89 of file CProbabilityDensityFunction.h.

void mrpt::utils::CProbabilityDensityFunction::getCovariance ( CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &  cov) const [inline, inherited]

Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)

See also:
getMean, getCovarianceAndMean

Definition at line 98 of file CProbabilityDensityFunction.h.

CMatrixFixedNumeric<double,STATE_LEN,STATE_LEN> mrpt::utils::CProbabilityDensityFunction::getCovariance ( ) const [inline, inherited]

Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)

See also:
getMean

Definition at line 107 of file CProbabilityDensityFunction.h.

virtual void mrpt::utils::CProbabilityDensityFunction::getCovarianceAndMean ( CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &  cov,
TDATA &  mean_point 
) const [pure virtual, inherited]

Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean, both at once.

See also:
getMean
void mrpt::utils::CProbabilityDensityFunction::getCovarianceDynAndMean ( CMatrixDouble cov,
TDATA &  mean_point 
) const [inline, inherited]

Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean, both at once.

See also:
getMean

Definition at line 69 of file CProbabilityDensityFunction.h.

double mrpt::utils::CProbabilityDensityFunction::getCovarianceEntropy ( ) const [inline, inherited]

Compute the entropy of the estimated covariance matrix.

See also:
http://en.wikipedia.org/wiki/Multivariate_normal_distribution#Entropy

Definition at line 145 of file CProbabilityDensityFunction.h.

virtual void mrpt::utils::CProbabilityDensityFunction::getMean ( TDATA &  mean_point) const [pure virtual, inherited]

Returns the mean, or mathematical expectation of the probability density distribution (PDF).

See also:
getCovarianceAndMean
TDATA mrpt::utils::CProbabilityDensityFunction::getMeanVal ( ) const [inline, inherited]

Returns the mean, or mathematical expectation of the probability density distribution (PDF).

See also:
getCovariance

Definition at line 79 of file CProbabilityDensityFunction.h.

virtual const mrpt::utils::TRuntimeClassId* mrpt::poses::CPoint2DPDF::GetRuntimeClass ( ) const [virtual]

Returns information about the class of an object in runtime.

Reimplemented from mrpt::utils::CSerializable.

Reimplemented in mrpt::poses::CPoint2DPDFGaussian.

static bool mrpt::poses::CPoint2DPDF::is_3D ( ) [inline, static]

Definition at line 73 of file CPoint2DPDF.h.

static bool mrpt::poses::CPoint2DPDF::is_PDF ( ) [inline, static]

Definition at line 75 of file CPoint2DPDF.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.

virtual void mrpt::utils::CProbabilityDensityFunction::saveToTextFile ( const std::string file) const [pure virtual, inherited]

Save PDF's particles to a text file.

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

Implemented in mrpt::poses::CPoint2DPDFGaussian.

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]

Reimplemented from mrpt::utils::CSerializable.

Definition at line 58 of file CPoint2DPDF.h.


Member Data Documentation

Definition at line 139 of file CObject.h.

Definition at line 58 of file CPoint2DPDF.h.

Definition at line 56 of file CSerializable.h.

The length of the variable, for example, 3 for a 3D point, 6 for a 3D pose (x y z yaw pitch roll).

Definition at line 53 of file CProbabilityDensityFunction.h.




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