MRPT logo

mrpt::poses::CPosePDFGrid Class Reference

Declares a class that represents a Probability Distribution function (PDF) of a 2D pose (x,y,phi). More...

#include <mrpt/poses/CPosePDFGrid.h>

Inheritance diagram for mrpt::poses::CPosePDFGrid:
mrpt::poses::CPosePDF mrpt::poses::CPose2DGridTemplate< double > mrpt::utils::CSerializable mrpt::utils::CProbabilityDensityFunction< CPose2D, 3 >

List of all members.

Public Member Functions

 CPosePDFGrid (double xMin=-1.0f, double xMax=1.0f, double yMin=-1.0f, double yMax=1.0f, double resolutionXY=0.5f, double resolutionPhi=DEG2RAD(180), double phiMin=-M_PIf, double phiMax=M_PIf)
 Constructor: Initializes a, uniform distribution over the whole given range.
virtual ~CPosePDFGrid ()
 Destructor.
void copyFrom (const CPosePDF &o)
 Copy operator, translating if necesary (for example, between particles and gaussian representations).
void normalize ()
 Normalizes the PDF, such as all cells sum the unity.
void uniformDistribution ()
 Assigns the same value to all the cells in the grid, so the sum 1.
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 saveToTextFile (const std::string &dataFile) const
 Save the contents of the 3D grid in one file, as a vertical concatenation of rectangular matrix for the different "PHI" discrete levels, and the size in X,Y,and PHI in another file named "<filename>_dims.txt".
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 (CPosePDF &p1, CPosePDF &p2, const double &minMahalanobisDistToDrop=0)
 Bayesian fusion of 2 densities (In the grid representation this becomes a pointwise multiplication).
void inverse (CPosePDF &o) const
 Returns a new PDF such as: NEW_PDF = (0,0,0) - THIS_PDF.
void drawSingleSample (CPose2D &outPart) const
 Draws a single sample from the distribution (WARNING: weights are assumed to be normalized!).
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.

Detailed Description

Declares a class that represents a Probability Distribution function (PDF) of a 2D pose (x,y,phi).

This class implements that PDF using a 3D grid.

See also:
CPose2D, CPosePDF, CPose2DGridTemplate

Definition at line 49 of file CPosePDFGrid.h.


Constructor & Destructor Documentation

mrpt::poses::CPosePDFGrid::CPosePDFGrid ( double  xMin = -1.0f,
double  xMax = 1.0f,
double  yMin = -1.0f,
double  yMax = 1.0f,
double  resolutionXY = 0.5f,
double  resolutionPhi = DEG2RAD(180),
double  phiMin = -M_PIf,
double  phiMax = M_PIf 
)

Constructor: Initializes a, uniform distribution over the whole given range.

virtual mrpt::poses::CPosePDFGrid::~CPosePDFGrid (  )  [virtual]

Destructor.


Member Function Documentation

void mrpt::poses::CPosePDFGrid::bayesianFusion ( CPosePDF p1,
CPosePDF p2,
const double &  minMahalanobisDistToDrop = 0 
)

Bayesian fusion of 2 densities (In the grid representation this becomes a pointwise multiplication).

void mrpt::poses::CPosePDFGrid::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::CPosePDFGrid::copyFrom ( const CPosePDF o  ) 

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

void mrpt::poses::CPosePDFGrid::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::CPosePDFGrid::drawSingleSample ( CPose2D outPart  )  const

Draws a single sample from the distribution (WARNING: weights are assumed to be normalized!).

void mrpt::poses::CPosePDFGrid::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::CPosePDFGrid::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::CPosePDFGrid::inverse ( CPosePDF o  )  const

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

void mrpt::poses::CPosePDFGrid::normalize (  ) 

Normalizes the PDF, such as all cells sum the unity.

void mrpt::poses::CPosePDFGrid::saveToTextFile ( const std::string &  dataFile  )  const [virtual]

Save the contents of the 3D grid in one file, as a vertical concatenation of rectangular matrix for the different "PHI" discrete levels, and the size in X,Y,and PHI in another file named "<filename>_dims.txt".

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

void mrpt::poses::CPosePDFGrid::uniformDistribution (  ) 

Assigns the same value to all the cells in the grid, so the sum 1.




Page generated by Doxygen 1.6.1 for MRPT 0.7.1 SVN: at Tue Dec 22 08:29:35 CET 2009