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

Detailed Description

Declares a class that represents a Probability Density Function (PDF) of a 3D pose (6D actually), by means of a 7-vector with a translation [x y z] and a quaternion [qr qx qy qz].

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:
CPose3DQuatPDF, CPose3DPDF

#include <mrpt/poses/CPose3DQuatPDF.h>

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

List of all members.

Public Types

typedef TDATA type_value
 The type of the state the PDF represents.

Public Member Functions

virtual void copyFrom (const CPose3DQuatPDF &o)=0
 Copy operator, translating if necesary (for example, between particles and gaussian representations)
virtual void bayesianFusion (const CPose3DQuatPDF &p1, const CPose3DQuatPDF &p2)=0
 Bayesian fusion of two pose distributions, then save the result in this object (WARNING: Currently only distributions of the same class can be fused! eg, gaussian with gaussian,etc)
virtual void inverse (CPose3DQuatPDF &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 CPose3DQuatPDFcreateFrom2D (const CPosePDF &o)
 This is a static transformation method from 2D poses to 3D PDFs, preserving the representation type (particles->particles, Gaussians->Gaussians,etc) It returns a new object of any of the derived classes of CPose3DQuatPDF.

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 
classCPose3DQuatPDF
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 Function Documentation

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

Reimplemented from mrpt::utils::CSerializable.

Reimplemented in mrpt::poses::CPose3DQuatPDFGaussian.

virtual void mrpt::poses::CPose3DQuatPDF::bayesianFusion ( const CPose3DQuatPDF p1,
const CPose3DQuatPDF p2 
) [pure virtual]

Bayesian fusion of two pose distributions, then save the result in this object (WARNING: Currently only distributions of the same class can be fused! eg, gaussian with gaussian,etc)

Implemented in mrpt::poses::CPose3DQuatPDFGaussian.

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

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

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

See also:
createFrom2D

Implemented in mrpt::poses::CPose3DQuatPDFGaussian.

static CPose3DQuatPDF* mrpt::poses::CPose3DQuatPDF::createFrom2D ( const CPosePDF o) [static]

This is a static transformation method from 2D poses to 3D PDFs, preserving the representation type (particles->particles, Gaussians->Gaussians,etc) It returns a new object of any of the derived classes of CPose3DQuatPDF.

This object must be deleted by the user when not required anymore.

See also:
copyFrom
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::CPose3DQuatPDFGaussian.

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.

template<class OPENGL_SETOFOBJECTSPTR >
void mrpt::poses::CPose3DQuatPDF::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 92 of file CPose3DQuatPDF.h.

References mrpt::opengl::posePDF2opengl().

template<class OPENGL_SETOFOBJECTSPTR >
OPENGL_SETOFOBJECTSPTR mrpt::poses::CPose3DQuatPDF::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 101 of file CPose3DQuatPDF.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.

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::CPose3DQuatPDF::GetRuntimeClass ( ) const [virtual]

Returns information about the class of an object in runtime.

Reimplemented from mrpt::utils::CSerializable.

Reimplemented in mrpt::poses::CPose3DQuatPDFGaussian.

virtual void mrpt::poses::CPose3DQuatPDF::inverse ( CPose3DQuatPDF o) const [pure virtual]

Returns a new PDF such as: NEW_PDF = (0,0,0) - THIS_PDF.

Implemented in mrpt::poses::CPose3DQuatPDFGaussian.

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

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 66 of file CPose3DQuatPDF.h.


Member Data Documentation

Definition at line 139 of file CObject.h.

Definition at line 66 of file CPose3DQuatPDF.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