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

Detailed Description

Declares a class that represents a probability density function (pdf) of a 2D pose (x,y,phi).

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.

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

See also:
CPose2D, CPose3DPDF, CPoseRandomSampler

#include <mrpt/poses/CPosePDF.h>

Inheritance diagram for mrpt::poses::CPosePDF:
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 CPosePDF &o)=0
 Copy operator, translating if necesary (for example, between particles and gaussian representations)
virtual void bayesianFusion (const CPosePDF &p1, const CPosePDF &p2, const double &minMahalanobisDistToDrop=0)=0
 Bayesian fusion of two pose 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 void inverse (CPosePDF &o) const =0
 Returns a new PDF such as: NEW_PDF = (0,0,0) - THIS_PDF.
template<class OPENGL_SETOFOBJECTSPTR >
void getAs3DObject (OPENGL_SETOFOBJECTSPTR &out_obj) const
 Returns a 3D representation of this PDF.
template<class OPENGL_SETOFOBJECTSPTR >
OPENGL_SETOFOBJECTSPTR getAs3DObject () const
 Returns a 3D representation of this PDF.
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 
classCPosePDF
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 79 of file CPosePDF.h.

anonymous enum
Enumerator:
is_PDF_val 

Definition at line 81 of file CPosePDF.h.


Member Function Documentation

static const mrpt::utils::TRuntimeClassId* mrpt::poses::CPosePDF::_GetBaseClass ( ) [static, protected]
virtual void mrpt::poses::CPosePDF::bayesianFusion ( const CPosePDF p1,
const CPosePDF p2,
const double &  minMahalanobisDistToDrop = 0 
) [pure virtual]

Bayesian fusion of two pose 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::CPosePDFSOG, mrpt::poses::CPosePDFParticles, mrpt::poses::CPosePDFGaussianInf, mrpt::poses::CPosePDFGaussian, and mrpt::poses::CPosePDFGrid.

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::CPosePDFSOG, mrpt::poses::CPosePDFParticles, mrpt::poses::CPosePDFGaussianInf, mrpt::poses::CPosePDFGaussian, and mrpt::poses::CPosePDFGrid.

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::CPosePDF::copyFrom ( const CPosePDF o) [pure virtual]

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

Implemented in mrpt::poses::CPosePDFSOG, mrpt::poses::CPosePDFGaussianInf, mrpt::poses::CPosePDFGaussian, mrpt::poses::CPosePDFParticles, and mrpt::poses::CPosePDFGrid.

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.

Reimplemented in mrpt::poses::CPosePDFSOG, mrpt::poses::CPosePDFGaussianInf, mrpt::poses::CPosePDFGaussian, and mrpt::poses::CPosePDFGrid.

Definition at line 126 of file CProbabilityDensityFunction.h.

References mrpt::utils::CProbabilityDensityFunction::drawSingleSample().

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.

template<class OPENGL_SETOFOBJECTSPTR >
void mrpt::poses::CPosePDF::getAs3DObject ( OPENGL_SETOFOBJECTSPTR &  out_obj) const [inline]

Returns a 3D representation of this PDF.

Note:
Needs the mrpt-opengl library, and using mrpt::opengl::CSetOfObjectsPtr as template argument.

Definition at line 88 of file CPosePDF.h.

References mrpt::opengl::posePDF2opengl().

template<class OPENGL_SETOFOBJECTSPTR >
OPENGL_SETOFOBJECTSPTR mrpt::poses::CPosePDF::getAs3DObject ( ) const [inline]

Returns a 3D representation of this PDF.

Note:
Needs the mrpt-opengl library, and using mrpt::opengl::CSetOfObjectsPtr as template argument.

Definition at line 97 of file CPosePDF.h.

References mrpt::opengl::posePDF2opengl().

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.

References mrpt::utils::CProbabilityDensityFunction::getCovarianceDynAndMean().

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.

References mrpt::utils::CProbabilityDensityFunction::getCovarianceAndMean().

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.

References mrpt::math::cov(), and mrpt::utils::CProbabilityDensityFunction::getCovarianceAndMean().

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.

References mrpt::utils::CProbabilityDensityFunction::getCovarianceAndMean().

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.

References mrpt::utils::CProbabilityDensityFunction::getCovariance(), and det().

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.

References mrpt::utils::CProbabilityDensityFunction::getMean().

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

Returns information about the class of an object in runtime.

Reimplemented from mrpt::utils::CSerializable.

Reimplemented in mrpt::poses::CPosePDFParticles, mrpt::poses::CPosePDFSOG, mrpt::poses::CPosePDFGaussianInf, mrpt::poses::CPosePDFGaussian, and mrpt::poses::CPosePDFGrid.

virtual void mrpt::poses::CPosePDF::inverse ( CPosePDF o) const [pure virtual]
static bool mrpt::poses::CPosePDF::is_3D ( ) [inline, static]

Definition at line 80 of file CPosePDF.h.

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

Definition at line 82 of file CPosePDF.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::CPosePDFSOG, mrpt::poses::CPosePDFParticles, mrpt::poses::CPosePDFGaussianInf, mrpt::poses::CPosePDFGaussian, and mrpt::poses::CPosePDFGrid.

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 60 of file CPosePDF.h.


Member Data Documentation

Definition at line 139 of file CObject.h.

Definition at line 60 of file CPosePDF.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