#include <mrpt/poses/CPosePDFGrid.h>
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. | |
CPose2D | getEstimatedPose () const |
Returns an estimate of the pose, (the mean, or mathematical expectation of the PDF), computed as a weighted average over all particles. | |
CMatrixD | getEstimatedCovariance () const |
Returns an estimate of the pose covariance matrix (3x3 cov.matrix for x,y,phi variables). | |
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 CPose2D &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. |
This class implements that PDF using a 3D grid.
Definition at line 49 of file CPosePDFGrid.h.
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.
void mrpt::poses::CPosePDFGrid::bayesianFusion | ( | CPosePDF & | p1, | |
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 CPose2D & | 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::poses::CPosePDF.
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.
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.
Implements mrpt::poses::CPosePDF.
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::poses::CPosePDF.
CMatrixD mrpt::poses::CPosePDFGrid::getEstimatedCovariance | ( | ) | const [virtual] |
Returns an estimate of the pose covariance matrix (3x3 cov.matrix for x,y,phi variables).
Implements mrpt::poses::CPosePDF.
CPose2D mrpt::poses::CPosePDFGrid::getEstimatedPose | ( | ) | const [virtual] |
Returns an estimate of the pose, (the mean, or mathematical expectation of the PDF), computed as a weighted average over all particles.
Implements mrpt::poses::CPosePDF.
void mrpt::poses::CPosePDFGrid::inverse | ( | CPosePDF & | o | ) | const [virtual] |
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::poses::CPosePDF.
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.5.8 for MRPT 0.6.5 SVN: at Thu Feb 26 02:07:47 EST 2009 |