Main MRPT website > C++ reference
MRPT logo
Public Member Functions

mrpt::poses::CPosePDFGrid Class Reference


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.

#include <mrpt/poses/CPosePDFGrid.h>

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

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 (const CPosePDF &p1, const 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.

RTTI stuff

typedef CPosePDFGridPtr SmartPtr
static mrpt::utils::CLASSINIT _init_CPosePDFGrid
static mrpt::utils::TRuntimeClassId classCPosePDFGrid
static const
mrpt::utils::TRuntimeClassId
classinfo
static const
mrpt::utils::TRuntimeClassId
_GetBaseClass ()
virtual const
mrpt::utils::TRuntimeClassId
GetRuntimeClass () const
 Returns information about the class of an object in runtime.
virtual mrpt::utils::CObjectduplicate () const
 Returns a copy of the object, indepently of its class.
static mrpt::utils::CObjectCreateObject ()
static CPosePDFGridPtr Create ()

Member Typedef Documentation

A typedef for the associated smart pointer

Definition at line 52 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

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

Reimplemented from mrpt::poses::CPosePDF.

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

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

Implements mrpt::poses::CPosePDF.

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) [virtual]

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

Implements mrpt::poses::CPosePDF.

static CPosePDFGridPtr mrpt::poses::CPosePDFGrid::Create ( ) [static]
static mrpt::utils::CObject* mrpt::poses::CPosePDFGrid::CreateObject ( ) [static]
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 [virtual]

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

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

virtual mrpt::utils::CObject* mrpt::poses::CPosePDFGrid::duplicate ( ) const [virtual]

Returns a copy of the object, indepently of its class.

Implements mrpt::utils::CObject.

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 [virtual]

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

See also:
getCovariance

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

virtual const mrpt::utils::TRuntimeClassId* mrpt::poses::CPosePDFGrid::GetRuntimeClass ( ) const [virtual]

Returns information about the class of an object in runtime.

Reimplemented from mrpt::poses::CPosePDF.

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


Member Data Documentation

Definition at line 52 of file CPosePDFGrid.h.

Definition at line 52 of file CPosePDFGrid.h.

Definition at line 52 of file CPosePDFGrid.h.




Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:16:28 UTC 2011