#include <mrpt/poses/CPosePDFSOG.h>
Classes | |
struct | TGaussianMode |
The struct for each mode:. More... | |
Public Member Functions | |
CPosePDFSOG (size_t nModes=1) | |
Default constructor. | |
size_t | size () const |
Return the number of Gaussians in the SOG. | |
void | mergeModes (double max_KLd=0.5, bool verbose=false) |
Merge very close modes so the overall number of modes is reduced while preserving the total distribution. | |
CPose2D | getEstimatedPose () const |
Returns an estimate of the pose, (the mean, or mathematical expectation of the PDF). | |
CMatrixD | getEstimatedCovariance () const |
Returns an estimate of the pose covariance matrix (3x3 cov.matrix for x,y,phi variables). | |
void | normalizeWeights () |
Normalize the weights in m_modes such as the maximum log-weight is 0. | |
void | copyFrom (const CPosePDF &o) |
Copy operator, translating if necesary (for example, between particles and gaussian representations). | |
void | saveToTextFile (const std::string &file) const |
Save the density to a text file, with the following format: There is one row per Gaussian "mode", and each row contains 10 elements:
| |
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 | rotateAllCovariances (const double &ang) |
Rotate all the covariance matrixes by replacing them by ![]() ![]() | |
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 | 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, bool sumOverAllPhis=false) const |
Evaluates the PDF at a given point. | |
double | evaluateNormalizedPDF (const CPose2D &x) const |
Evaluates the ratio PDF(x) / max_PDF(x*), that is, the normalized PDF in the range [0,1]. | |
void | evaluatePDFInArea (const double &x_min, const double &x_max, const double &y_min, const double &y_max, const double &resolutionXY, const double &phi, CMatrixD &outMatrix, bool sumOverAllPhis=false) |
Evaluates the PDF within a rectangular grid (and a fixed orientation) and saves the result in a matrix (each row contains values for a fixed y-coordinate value). | |
void | bayesianFusion (CPosePDF &p1, CPosePDF &p2, const double &minMahalanobisDistToDrop=0) |
Bayesian fusion of two pose distributions, then save the result in this object (WARNING: Currently p1 must be a mrpt::poses::CPosePDFSOG object and p2 a mrpt::poses::CPosePDFGaussian object). | |
void | getAs3DObject (mrpt::opengl::CSetOfObjectsPtr &outObj) const |
Returns a 3D object representation of all the ellipses in the SoG. | |
Public Attributes | |
std::deque< TGaussianMode > | m_modes |
Access directly to this array for modify the modes as desired. | |
Protected Member Functions | |
void | assureSymmetry () |
Assures the symmetry of the covariance matrix (eventually certain operations in the math-coprocessor lead to non-symmetric matrixes!). |
This class implements that PDF as the following multi-modal Gaussian distribution:
Where the number of modes N is the size of CPosePDFSOG::m_modes
See mrpt::poses::CPosePDF for more details.
Definition at line 57 of file CPosePDFSOG.h.
mrpt::poses::CPosePDFSOG::CPosePDFSOG | ( | size_t | nModes = 1 |
) |
void mrpt::poses::CPosePDFSOG::assureSymmetry | ( | ) | [protected] |
Assures the symmetry of the covariance matrix (eventually certain operations in the math-coprocessor lead to non-symmetric matrixes!).
void mrpt::poses::CPosePDFSOG::bayesianFusion | ( | CPosePDF & | p1, | |
CPosePDF & | p2, | |||
const double & | minMahalanobisDistToDrop = 0 | |||
) | [virtual] |
Bayesian fusion of two pose distributions, then save the result in this object (WARNING: Currently p1 must be a mrpt::poses::CPosePDFSOG object and p2 a mrpt::poses::CPosePDFGaussian object).
Implements mrpt::poses::CPosePDF.
void mrpt::poses::CPosePDFSOG::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::CPosePDFSOG::copyFrom | ( | const CPosePDF & | o | ) | [virtual] |
Copy operator, translating if necesary (for example, between particles and gaussian representations).
Implements mrpt::poses::CPosePDF.
void mrpt::poses::CPosePDFSOG::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::CPosePDFSOG::drawSingleSample | ( | CPose2D & | outPart | ) | const [virtual] |
double mrpt::poses::CPosePDFSOG::evaluateNormalizedPDF | ( | const CPose2D & | x | ) | const |
Evaluates the ratio PDF(x) / max_PDF(x*), that is, the normalized PDF in the range [0,1].
double mrpt::poses::CPosePDFSOG::evaluatePDF | ( | const CPose2D & | x, | |
bool | sumOverAllPhis = false | |||
) | const |
Evaluates the PDF at a given point.
void mrpt::poses::CPosePDFSOG::evaluatePDFInArea | ( | const double & | x_min, | |
const double & | x_max, | |||
const double & | y_min, | |||
const double & | y_max, | |||
const double & | resolutionXY, | |||
const double & | phi, | |||
CMatrixD & | outMatrix, | |||
bool | sumOverAllPhis = false | |||
) |
Evaluates the PDF within a rectangular grid (and a fixed orientation) and saves the result in a matrix (each row contains values for a fixed y-coordinate value).
void mrpt::poses::CPosePDFSOG::getAs3DObject | ( | mrpt::opengl::CSetOfObjectsPtr & | outObj | ) | const |
Returns a 3D object representation of all the ellipses in the SoG.
CMatrixD mrpt::poses::CPosePDFSOG::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::CPosePDFSOG::getEstimatedPose | ( | ) | const [virtual] |
Returns an estimate of the pose, (the mean, or mathematical expectation of the PDF).
Implements mrpt::poses::CPosePDF.
void mrpt::poses::CPosePDFSOG::inverse | ( | CPosePDF & | o | ) | const [virtual] |
void mrpt::poses::CPosePDFSOG::mergeModes | ( | double | max_KLd = 0.5 , |
|
bool | verbose = false | |||
) |
Merge very close modes so the overall number of modes is reduced while preserving the total distribution.
This method uses the approach described in the paper:
max_KLd | The maximum KL-divergence to consider the merge of two nodes (and then stops the process). |
void mrpt::poses::CPosePDFSOG::normalizeWeights | ( | ) |
Normalize the weights in m_modes such as the maximum log-weight is 0.
void mrpt::poses::CPosePDFSOG::operator+= | ( | CPose2D | Ap | ) |
Makes: thisPDF = thisPDF + Ap, where "+" is pose composition (both the mean, and the covariance matrix are updated).
void mrpt::poses::CPosePDFSOG::rotateAllCovariances | ( | const double & | ang | ) |
Rotate all the covariance matrixes by replacing them by , where
.
void mrpt::poses::CPosePDFSOG::saveToTextFile | ( | const std::string & | file | ) | const [virtual] |
Save the density to a text file, with the following format: There is one row per Gaussian "mode", and each row contains 10 elements:
Implements mrpt::poses::CPosePDF.
size_t mrpt::poses::CPosePDFSOG::size | ( | ) | const [inline] |
std::deque<TGaussianMode> mrpt::poses::CPosePDFSOG::m_modes |
Access directly to this array for modify the modes as desired.
Note that no weight can be zero!!
Definition at line 94 of file CPosePDFSOG.h.
Page generated by Doxygen 1.5.7.1 for MRPT 0.6.5 SVN: at Mon Feb 23 13:35:09 EST 2009 |