Main MRPT website > C++ reference for MRPT 1.4.0
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes
mrpt::poses::CPoint2DPDF Class Referenceabstract

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

Definition at line 35 of file CPoint2DPDF.h.

#include <mrpt/poses/CPoint2DPDF.h>

Inheritance diagram for mrpt::poses::CPoint2DPDF:
Inheritance graph

Public Types

enum  { is_3D_val = 0 }
 
enum  { is_PDF_val = 1 }
 
typedef CPoint2D 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 void getMean (CPoint2D &mean_point) const=0
 Returns the mean, or mathematical expectation of the probability density distribution (PDF).
 
virtual void getCovarianceAndMean (mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &cov, CPoint2D &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 (mrpt::math::CMatrixDouble &cov, CPoint2D &mean_point) const
 Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean, both at once.
 
CPoint2D getMeanVal () const
 Returns the mean, or mathematical expectation of the probability density distribution (PDF).
 
void getCovariance (mrpt::math::CMatrixDouble &cov) const
 Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)
 
void getCovariance (mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &cov) const
 Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)
 
mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > getCovariance () const
 Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)
 
virtual void getInformationMatrix (mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &inf) const
 Returns the information (inverse covariance) matrix (a STATE_LEN x STATE_LEN matrix) Unless reimplemented in derived classes, this method first reads the covariance, then invert it.
 
virtual void saveToTextFile (const std::string &file) const=0
 Save PDF's particles to a text file.
 
virtual void drawSingleSample (CPoint2D &outPart) const=0
 Draws a single sample from the distribution.
 
virtual void drawManySamples (size_t N, std::vector< mrpt::math::CVectorDouble > &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 = p (+) this.
 
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 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 <br>

static const mrpt::utils::TRuntimeClassId classCPoint2DPDF
 
class mrpt::utils::CStream
 
static const mrpt::utils::TRuntimeClassId_GetBaseClass ()
 
virtual const mrpt::utils::TRuntimeClassIdGetRuntimeClass () const MRPT_OVERRIDE
 

Member Typedef Documentation

◆ type_value

typedef CPoint2D mrpt::utils::CProbabilityDensityFunction< CPoint2D , STATE_LEN >::type_value
inherited

The type of the state the PDF represents.

Definition at line 32 of file CProbabilityDensityFunction.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
is_3D_val 

Definition at line 51 of file CPoint2DPDF.h.

◆ anonymous enum

anonymous enum
Enumerator
is_PDF_val 

Definition at line 53 of file CPoint2DPDF.h.

Member Function Documentation

◆ _GetBaseClass()

static const mrpt::utils::TRuntimeClassId * mrpt::poses::CPoint2DPDF::_GetBaseClass ( )
staticprotected

◆ bayesianFusion()

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.

◆ changeCoordinatesReference()

virtual void mrpt::utils::CProbabilityDensityFunction< CPoint2D , STATE_LEN >::changeCoordinatesReference ( const mrpt::poses::CPose3D newReferenceBase)
pure virtualinherited

this = p (+) this.

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.

◆ copyFrom()

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.

◆ drawManySamples()

virtual void mrpt::utils::CProbabilityDensityFunction< CPoint2D , STATE_LEN >::drawManySamples ( size_t  N,
std::vector< mrpt::math::CVectorDouble > &  outSamples 
) const
inlinevirtualinherited

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 117 of file CProbabilityDensityFunction.h.

◆ drawSingleSample()

virtual void mrpt::utils::CProbabilityDensityFunction< CPoint2D , STATE_LEN >::drawSingleSample ( CPoint2D &  outPart) const
pure virtualinherited

Draws a single sample from the distribution.

◆ getCovariance() [1/3]

mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > mrpt::utils::CProbabilityDensityFunction< CPoint2D , STATE_LEN >::getCovariance ( ) const
inlineinherited

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

See also
getMean, getInformationMatrix

Definition at line 85 of file CProbabilityDensityFunction.h.

◆ getCovariance() [2/3]

void mrpt::utils::CProbabilityDensityFunction< CPoint2D , STATE_LEN >::getCovariance ( mrpt::math::CMatrixDouble cov) const
inlineinherited

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

See also
getMean, getCovarianceAndMean, getInformationMatrix

Definition at line 67 of file CProbabilityDensityFunction.h.

◆ getCovariance() [3/3]

void mrpt::utils::CProbabilityDensityFunction< CPoint2D , STATE_LEN >::getCovariance ( mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &  cov) const
inlineinherited

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

See also
getMean, getCovarianceAndMean, getInformationMatrix

Definition at line 76 of file CProbabilityDensityFunction.h.

◆ getCovarianceAndMean()

virtual void mrpt::utils::CProbabilityDensityFunction< CPoint2D , STATE_LEN >::getCovarianceAndMean ( mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &  cov,
CPoint2D &  mean_point 
) const
pure virtualinherited

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

See also
getMean, getInformationMatrix

◆ getCovarianceDynAndMean()

void mrpt::utils::CProbabilityDensityFunction< CPoint2D , STATE_LEN >::getCovarianceDynAndMean ( mrpt::math::CMatrixDouble cov,
CPoint2D &  mean_point 
) const
inlineinherited

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

See also
getMean, getInformationMatrix

Definition at line 47 of file CProbabilityDensityFunction.h.

◆ getCovarianceEntropy()

double mrpt::utils::CProbabilityDensityFunction< CPoint2D , STATE_LEN >::getCovarianceEntropy ( ) const
inlineinherited

Compute the entropy of the estimated covariance matrix.

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

Definition at line 136 of file CProbabilityDensityFunction.h.

◆ getInformationMatrix()

virtual void mrpt::utils::CProbabilityDensityFunction< CPoint2D , STATE_LEN >::getInformationMatrix ( mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &  inf) const
inlinevirtualinherited

Returns the information (inverse covariance) matrix (a STATE_LEN x STATE_LEN matrix) Unless reimplemented in derived classes, this method first reads the covariance, then invert it.

See also
getMean, getCovarianceAndMean

Definition at line 98 of file CProbabilityDensityFunction.h.

◆ getMean()

virtual void mrpt::utils::CProbabilityDensityFunction< CPoint2D , STATE_LEN >::getMean ( CPoint2D &  mean_point) const
pure virtualinherited

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

See also
getCovarianceAndMean, getInformationMatrix

◆ getMeanVal()

CPoint2D mrpt::utils::CProbabilityDensityFunction< CPoint2D , STATE_LEN >::getMeanVal ( ) const
inlineinherited

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

See also
getCovariance, getInformationMatrix

Definition at line 57 of file CProbabilityDensityFunction.h.

◆ GetRuntimeClass()

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

◆ is_3D()

static bool mrpt::poses::CPoint2DPDF::is_3D ( )
inlinestatic

Definition at line 52 of file CPoint2DPDF.h.

◆ is_PDF()

static bool mrpt::poses::CPoint2DPDF::is_PDF ( )
inlinestatic

Definition at line 54 of file CPoint2DPDF.h.

◆ saveToTextFile()

virtual void mrpt::utils::CProbabilityDensityFunction< CPoint2D , STATE_LEN >::saveToTextFile ( const std::string &  file) const
pure virtualinherited

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.

Friends And Related Function Documentation

◆ mrpt::utils::CStream

friend class mrpt::utils::CStream
friend

Definition at line 37 of file CPoint2DPDF.h.

Member Data Documentation

◆ classCPoint2DPDF

const mrpt::utils::TRuntimeClassId mrpt::poses::CPoint2DPDF::classCPoint2DPDF
static

Definition at line 37 of file CPoint2DPDF.h.

◆ state_length

const size_t mrpt::utils::CProbabilityDensityFunction< CPoint2D , STATE_LEN >::state_length
staticinherited

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 31 of file CProbabilityDensityFunction.h.




Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Fri Jan 20 00:13:14 UTC 2023