MRPT logo

mrpt::poses::CPosePDFGaussian Class Reference

Declares a class that represents a Probability Density function (PDF) of a 2D pose $ p(\mathbf{x}) = [x ~ y ~ \phi ]^t $. More...

#include <mrpt/poses/CPosePDFGaussian.h>

Inheritance diagram for mrpt::poses::CPosePDFGaussian:

mrpt::poses::CPosePDF mrpt::utils::CSerializable mrpt::utils::CProbabilityDensityFunction< CPose2D, 3 >

List of all members.

Public Member Functions

 CPosePDFGaussian ()
 Default constructor.
 CPosePDFGaussian (const CPose2D &init_Mean)
 Constructor.
 CPosePDFGaussian (const CPose2D &init_Mean, const CMatrixDouble33 &init_Cov)
 Constructor.
 CPosePDFGaussian (const CPosePDF &o)
 Copy constructor, including transformations between other PDFs.
 CPosePDFGaussian (const CPose3DPDF &o)
 Copy constructor, including transformations between other PDFs.
void getMean (CPose2D &mean_pose) const
 Returns an estimate of the pose, (the mean, or mathematical expectation of the PDF).
void getCovarianceAndMean (CMatrixDouble33 &cov, CPose2D &mean_point) const
 Returns an estimate of the pose covariance matrix (3x3 cov matrix) and the mean, both at once.
void copyFrom (const CPosePDF &o)
 Copy operator, translating if necesary (for example, between particles and gaussian representations).
void copyFrom (const CPose3DPDF &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 rotateCov (const double &ang)
 Rotate the covariance matrix by replacing it by $ \mathbf{R}~\mathbf{COV}~\mathbf{R}^t $, where $ \mathbf{R} = \left[ \begin{array}{ccc} \cos\alpha & -\sin\alpha & 0 \\ \sin\alpha & \cos\alpha & 0 \\ 0 & 0 & 1 \end{array}\right] $.
void inverseComposition (const CPosePDFGaussian &x, const CPosePDFGaussian &ref)
 Set $ this = x1 \ominus x0 $ , computing the mean using the "-" operator and the covariances through the corresponding Jacobians (For 'x0' and 'x1' being independent variables!).
void inverseComposition (const CPosePDFGaussian &x1, const CPosePDFGaussian &x0, const CMatrixDouble33 &COV_01)
 Set $ this = x1 \ominus x0 $ , computing the mean using the "-" operator and the covariances through the corresponding Jacobians (Given the 3x3 cross-covariance matrix of variables x0 and x1).
void drawSingleSample (CPose2D &outPart) const
 Draws a single sample from the distribution.
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 1x3 vectors, where each row contains a (x,y,phi) datum.
void bayesianFusion (CPosePDF &p1, CPosePDF &p2, const double &minMahalanobisDistToDrop=0)
 Bayesian fusion of two points gauss.
void inverse (CPosePDF &o) const
 Returns a new PDF such as: NEW_PDF = (0,0,0) - THIS_PDF.
void operator+= (CPose2D Ap)
 Makes: thisPDF = thisPDF + Ap, where "+" is pose composition (both the mean, and the covariance matrix are updated).
double evaluatePDF (const CPose2D &x) const
 Evaluates the PDF at a given point.
double evaluateNormalizedPDF (const CPose2D &x) const
 Evaluates the ratio PDF(x) / PDF(MEAN), that is, the normalized PDF in the range [0,1].
double mahalanobisDistanceTo (const CPosePDFGaussian &theOther)
 Computes the Mahalanobis distance between the centers of two Gaussians.
void assureMinCovariance (const double &minStdXY, const double &minStdPhi)
 Substitutes the diagonal elements if (square) they are below some given minimum values (Use this before bayesianFusion, for example, to avoid inversion of singular matrixes, etc.

Public Attributes

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

Protected Member Functions

void assureSymmetry ()
 Assures the symmetry of the covariance matrix (eventually certain operations in the math-coprocessor lead to non-symmetric matrixes!).


Detailed Description

Declares a class that represents a Probability Density function (PDF) of a 2D pose $ p(\mathbf{x}) = [x ~ y ~ \phi ]^t $.

This class implements that PDF using a mono-modal Gaussian distribution. See mrpt::poses::CPosePDF for more details.

See also:
CPose2D, CPosePDF, CPosePDFParticles

Definition at line 51 of file CPosePDFGaussian.h.


Constructor & Destructor Documentation

mrpt::poses::CPosePDFGaussian::CPosePDFGaussian (  ) 

Default constructor.

mrpt::poses::CPosePDFGaussian::CPosePDFGaussian ( const CPose2D init_Mean  ) 

Constructor.

mrpt::poses::CPosePDFGaussian::CPosePDFGaussian ( const CPose2D init_Mean,
const CMatrixDouble33 init_Cov 
)

Constructor.

mrpt::poses::CPosePDFGaussian::CPosePDFGaussian ( const CPosePDF o  )  [inline]

Copy constructor, including transformations between other PDFs.

Definition at line 75 of file CPosePDFGaussian.h.

mrpt::poses::CPosePDFGaussian::CPosePDFGaussian ( const CPose3DPDF o  )  [inline]

Copy constructor, including transformations between other PDFs.

Definition at line 78 of file CPosePDFGaussian.h.


Member Function Documentation

void mrpt::poses::CPosePDFGaussian::assureMinCovariance ( const double &  minStdXY,
const double &  minStdPhi 
)

Substitutes the diagonal elements if (square) they are below some given minimum values (Use this before bayesianFusion, for example, to avoid inversion of singular matrixes, etc.

..)

void mrpt::poses::CPosePDFGaussian::assureSymmetry (  )  [protected]

Assures the symmetry of the covariance matrix (eventually certain operations in the math-coprocessor lead to non-symmetric matrixes!).

void mrpt::poses::CPosePDFGaussian::bayesianFusion ( CPosePDF p1,
CPosePDF p2,
const double &  minMahalanobisDistToDrop = 0 
) [virtual]

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 );

Implements mrpt::poses::CPosePDF.

void mrpt::poses::CPosePDFGaussian::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.

Implements mrpt::utils::CProbabilityDensityFunction< CPose2D, 3 >.

void mrpt::poses::CPosePDFGaussian::copyFrom ( const CPose3DPDF o  ) 

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

void mrpt::poses::CPosePDFGaussian::copyFrom ( const CPosePDF o  )  [virtual]

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

Implements mrpt::poses::CPosePDF.

void mrpt::poses::CPosePDFGaussian::drawManySamples ( size_t  N,
std::vector< vector_double > &  outSamples 
) const [virtual]

Draws a number of samples from the distribution, and saves as a list of 1x3 vectors, where each row contains a (x,y,phi) datum.

Reimplemented from mrpt::utils::CProbabilityDensityFunction< CPose2D, 3 >.

void mrpt::poses::CPosePDFGaussian::drawSingleSample ( CPose2D outPart  )  const

Draws a single sample from the distribution.

double mrpt::poses::CPosePDFGaussian::evaluateNormalizedPDF ( const CPose2D x  )  const

Evaluates the ratio PDF(x) / PDF(MEAN), that is, the normalized PDF in the range [0,1].

double mrpt::poses::CPosePDFGaussian::evaluatePDF ( const CPose2D x  )  const

Evaluates the PDF at a given point.

void mrpt::poses::CPosePDFGaussian::getCovarianceAndMean ( CMatrixDouble33 cov,
CPose2D mean_point 
) const

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

See also:
getMean

void mrpt::poses::CPosePDFGaussian::getMean ( CPose2D mean_pose  )  const

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

See also:
getCovariance

void mrpt::poses::CPosePDFGaussian::inverse ( CPosePDF o  )  const [virtual]

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

Implements mrpt::poses::CPosePDF.

void mrpt::poses::CPosePDFGaussian::inverseComposition ( const CPosePDFGaussian x1,
const CPosePDFGaussian x0,
const CMatrixDouble33 COV_01 
)

Set $ this = x1 \ominus x0 $ , computing the mean using the "-" operator and the covariances through the corresponding Jacobians (Given the 3x3 cross-covariance matrix of variables x0 and x1).

void mrpt::poses::CPosePDFGaussian::inverseComposition ( const CPosePDFGaussian x,
const CPosePDFGaussian ref 
)

Set $ this = x1 \ominus x0 $ , computing the mean using the "-" operator and the covariances through the corresponding Jacobians (For 'x0' and 'x1' being independent variables!).

double mrpt::poses::CPosePDFGaussian::mahalanobisDistanceTo ( const CPosePDFGaussian theOther  ) 

Computes the Mahalanobis distance between the centers of two Gaussians.

void mrpt::poses::CPosePDFGaussian::operator+= ( CPose2D  Ap  ) 

Makes: thisPDF = thisPDF + Ap, where "+" is pose composition (both the mean, and the covariance matrix are updated).

void mrpt::poses::CPosePDFGaussian::rotateCov ( const double &  ang  ) 

Rotate the covariance matrix by replacing it by $ \mathbf{R}~\mathbf{COV}~\mathbf{R}^t $, where $ \mathbf{R} = \left[ \begin{array}{ccc} \cos\alpha & -\sin\alpha & 0 \\ \sin\alpha & \cos\alpha & 0 \\ 0 & 0 & 1 \end{array}\right] $.

void mrpt::poses::CPosePDFGaussian::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< CPose2D, 3 >.


Member Data Documentation

The 3x3 covariance matrix.

Definition at line 86 of file CPosePDFGaussian.h.

The mean value.

Definition at line 82 of file CPosePDFGaussian.h.




Page generated by Doxygen 1.5.9 for MRPT 0.7.1 SVN: at Mon Aug 17 22:20:53 EDT 2009