MRPT logo

mrpt::poses::CPointPDFGaussian Class Reference

A gaussian distribution for 3D points. More...

#include <mrpt/poses/CPointPDFGaussian.h>

Inheritance diagram for mrpt::poses::CPointPDFGaussian:

mrpt::poses::CPointPDF mrpt::utils::CSerializable mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >

List of all members.

Public Member Functions

 CPointPDFGaussian ()
 Default constructor.
 CPointPDFGaussian (const CPoint3D &init_Mean)
 Constructor.
 CPointPDFGaussian (const CPoint3D &init_Mean, const CMatrixDouble33 &init_Cov)
 Constructor.
void getMean (CPoint3D &p) 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, containing the 2D pose in the first line, then the covariance matrix in next 3 lines.
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 bayesianFusion (CPointPDFGaussian &p1, CPointPDFGaussian &p2)
 Bayesian fusion of two points gauss.
double productIntegralWith (CPointPDFGaussian &p) const
 Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the integral from -inf to +inf of the product of both PDF.
double productIntegralWith2D (const CPointPDFGaussian &p) const
 Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the integral from -inf to +inf of the product of both PDF.
double productIntegralNormalizedWith (const CPointPDFGaussian &p) const
 Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the integral from -inf to +inf of the product of both PDF.
double productIntegralNormalizedWith2D (const CPointPDFGaussian &p) const
 Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the integral from -inf to +inf of the product of both PDF.
void drawSingleSample (CPoint3D &outSample) const
 Draw a sample from the pdf.
void bayesianFusion (CPointPDF &p1, 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!).
double mahalanobisDistanceTo (const CPointPDFGaussian &other, bool only_2D=false) const
 Returns the Mahalanobis distance from this PDF to another PDF, that is, it's evaluation at (0,0,0).

Public Attributes

CPoint3D mean
 The mean value.
CMatrixDouble33 cov
 The 3x3 covariance matrix.


Detailed Description

A gaussian distribution for 3D points.

Also a method for bayesian fusion is provided.

See also:
CPointPDF

Definition at line 46 of file CPointPDFGaussian.h.


Constructor & Destructor Documentation

mrpt::poses::CPointPDFGaussian::CPointPDFGaussian (  ) 

Default constructor.

mrpt::poses::CPointPDFGaussian::CPointPDFGaussian ( const CPoint3D init_Mean  ) 

Constructor.

mrpt::poses::CPointPDFGaussian::CPointPDFGaussian ( const CPoint3D init_Mean,
const CMatrixDouble33 init_Cov 
)

Constructor.


Member Function Documentation

void mrpt::poses::CPointPDFGaussian::bayesianFusion ( CPointPDF p1,
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:
p1 The first distribution to fuse
p2 The second distribution to fuse
minMahalanobisDistToDrop If 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::poses::CPointPDFGaussian::bayesianFusion ( CPointPDFGaussian p1,
CPointPDFGaussian p2 
)

Bayesian fusion of two points gauss.

distributions, then save the result in this object. The process is as follows:

  • (x1,S1): Mean and variance of the p1 distribution.
  • (x2,S2): Mean and variance of the p2 distribution.
  • (x,S): Mean and variance of the resulting distribution.

S = (S1-1 + S2-1)-1; x = S * ( S1-1*x1 + S2-1*x2 );

void mrpt::poses::CPointPDFGaussian::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. Both the mean value and the covariance matrix are updated correctly.

Implements mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >.

void mrpt::poses::CPointPDFGaussian::copyFrom ( const CPointPDF o  )  [virtual]

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

Implements mrpt::poses::CPointPDF.

void mrpt::poses::CPointPDFGaussian::drawSingleSample ( CPoint3D outSample  )  const

Draw a sample from the pdf.

void mrpt::poses::CPointPDFGaussian::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::poses::CPointPDFGaussian::getMean ( CPoint3D p  )  const

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

double mrpt::poses::CPointPDFGaussian::mahalanobisDistanceTo ( const CPointPDFGaussian other,
bool  only_2D = false 
) const

Returns the Mahalanobis distance from this PDF to another PDF, that is, it's evaluation at (0,0,0).

double mrpt::poses::CPointPDFGaussian::productIntegralNormalizedWith ( const CPointPDFGaussian p  )  const

Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the integral from -inf to +inf of the product of both PDF.

The resulting number is in the range [0,1] Note that the resulting value is in fact

\[ exp( -\frac{1}{2} D^2 ) \]

, with $ D^2 $ being the square Mahalanobis distance between the two pdfs.

See also:
productIntegralWith
Exceptions:
std::exception On errors like covariance matrix with null determinant, etc...

double mrpt::poses::CPointPDFGaussian::productIntegralNormalizedWith2D ( const CPointPDFGaussian p  )  const

Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the integral from -inf to +inf of the product of both PDF.

The resulting number is in the range [0,1]. This versions ignores the "z" coordinate.

Note that the resulting value is in fact

\[ exp( -\frac{1}{2} D^2 ) \]

, with $ D^2 $ being the square Mahalanobis distance between the two pdfs.

See also:
productIntegralWith
Exceptions:
std::exception On errors like covariance matrix with null determinant, etc...

double mrpt::poses::CPointPDFGaussian::productIntegralWith ( CPointPDFGaussian p  )  const

Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the integral from -inf to +inf of the product of both PDF.

The resulting number is >=0.

See also:
productIntegralNormalizedWith
Exceptions:
std::exception On errors like covariance matrix with null determinant, etc...

double mrpt::poses::CPointPDFGaussian::productIntegralWith2D ( const CPointPDFGaussian p  )  const

Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the integral from -inf to +inf of the product of both PDF.

The resulting number is >=0. NOTE: This version ignores the "z" coordinates!!

See also:
productIntegralNormalizedWith
Exceptions:
std::exception On errors like covariance matrix with null determinant, etc...

void mrpt::poses::CPointPDFGaussian::saveToTextFile ( const std::string &  file  )  const [virtual]

Save PDF's particles to a text file, containing the 2D pose in the first line, then the covariance matrix in next 3 lines.

Implements mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >.


Member Data Documentation

The 3x3 covariance matrix.

Definition at line 70 of file CPointPDFGaussian.h.

Referenced by mrpt::slam::CLandmark::getPose().

The mean value.

Definition at line 66 of file CPointPDFGaussian.h.

Referenced by mrpt::slam::CLandmark::getPose().




Page generated by Doxygen 1.5.7.1 for MRPT 0.7.1 SVN: at Mon Aug 17 23:02:22 EDT 2009