#include <mrpt/poses/CPosePDFSOG.h>
Classes | |
struct | TGaussianMode |
The struct for each mode:. More... | |
Public Types | |
typedef std::deque< TGaussianMode > | CListGaussianModes |
typedef std::deque < TGaussianMode > ::const_iterator | const_iterator |
typedef std::deque < TGaussianMode >::iterator | iterator |
Public Member Functions | |
CPosePDFSOG (size_t nModes=1) | |
Default constructor. | |
size_t | size () const |
Return the number of Gaussian modes. | |
bool | empty () const |
Return whether there is any Gaussian mode. | |
void | clear () |
Clear the list of modes. | |
const TGaussianMode & | operator[] (size_t i) const |
Access to individual beacons. | |
TGaussianMode & | operator[] (size_t i) |
Access to individual beacons. | |
const TGaussianMode & | get (size_t i) const |
Access to individual beacons. | |
TGaussianMode & | get (size_t i) |
Access to individual beacons. | |
void | push_back (const TGaussianMode &m) |
Inserts a copy of the given mode into the SOG. | |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
iterator | erase (iterator i) |
void | resize (const size_t N) |
Resize the number of SOG modes. | |
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. | |
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 | getMostLikelyCovarianceAndMean (CMatrixDouble33 &cov, CPose2D &mean_point) const |
For the most likely Gaussian mode in the SOG, returns the pose covariance matrix (3x3 cov matrix) and the mean. | |
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 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 | 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+= (const 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. | |
Protected Member Functions | |
void | assureSymmetry () |
Assures the symmetry of the covariance matrix (eventually certain operations in the math-coprocessor lead to non-symmetric matrixes!). | |
Protected Attributes | |
CListGaussianModes | m_modes |
The list of SOG modes. |
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.
typedef std::deque<TGaussianMode> mrpt::poses::CPosePDFSOG::CListGaussianModes |
Definition at line 81 of file CPosePDFSOG.h.
typedef std::deque<TGaussianMode>::const_iterator mrpt::poses::CPosePDFSOG::const_iterator |
Definition at line 82 of file CPosePDFSOG.h.
typedef std::deque<TGaussianMode>::iterator mrpt::poses::CPosePDFSOG::iterator |
Definition at line 83 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.
const_iterator mrpt::poses::CPosePDFSOG::begin | ( | ) | const [inline] |
Definition at line 134 of file CPosePDFSOG.h.
iterator mrpt::poses::CPosePDFSOG::begin | ( | ) | [inline] |
Definition at line 132 of file CPosePDFSOG.h.
void mrpt::poses::CPosePDFSOG::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< TDATA, STATE_LEN >.
void mrpt::poses::CPosePDFSOG::clear | ( | ) |
Clear the list of modes.
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.
Reimplemented from mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >.
void mrpt::poses::CPosePDFSOG::drawSingleSample | ( | CPose2D & | outPart | ) | const |
Draws a single sample from the distribution.
bool mrpt::poses::CPosePDFSOG::empty | ( | ) | const [inline] |
const_iterator mrpt::poses::CPosePDFSOG::end | ( | ) | const [inline] |
Definition at line 135 of file CPosePDFSOG.h.
iterator mrpt::poses::CPosePDFSOG::end | ( | ) | [inline] |
Definition at line 133 of file CPosePDFSOG.h.
Definition at line 137 of file CPosePDFSOG.h.
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).
TGaussianMode& mrpt::poses::CPosePDFSOG::get | ( | size_t | i | ) | [inline] |
const TGaussianMode& mrpt::poses::CPosePDFSOG::get | ( | size_t | i | ) | const [inline] |
void mrpt::poses::CPosePDFSOG::getAs3DObject | ( | mrpt::opengl::CSetOfObjectsPtr & | outObj | ) | const |
Returns a 3D object representation of all the ellipses in the SoG.
void mrpt::poses::CPosePDFSOG::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 mrpt::poses::CPosePDFSOG::getMean | ( | CPose2D & | mean_pose | ) | const |
Returns an estimate of the pose, (the mean, or mathematical expectation of the PDF).
void mrpt::poses::CPosePDFSOG::getMostLikelyCovarianceAndMean | ( | CMatrixDouble33 & | cov, | |
CPose2D & | mean_point | |||
) | const |
For the most likely Gaussian mode in the SOG, returns the pose covariance matrix (3x3 cov matrix) and the mean.
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+= | ( | const CPose2D | Ap | ) |
Makes: thisPDF = thisPDF + Ap, where "+" is pose composition (both the mean, and the covariance matrix are updated).
TGaussianMode& mrpt::poses::CPosePDFSOG::operator[] | ( | size_t | i | ) | [inline] |
const TGaussianMode& mrpt::poses::CPosePDFSOG::operator[] | ( | size_t | i | ) | const [inline] |
void mrpt::poses::CPosePDFSOG::push_back | ( | const TGaussianMode & | m | ) | [inline] |
void mrpt::poses::CPosePDFSOG::resize | ( | const size_t | N | ) |
Resize the number of SOG modes.
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::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >.
size_t mrpt::poses::CPosePDFSOG::size | ( | ) | const [inline] |
CListGaussianModes mrpt::poses::CPosePDFSOG::m_modes [protected] |
Page generated by Doxygen 1.5.7.1 for MRPT 0.7.1 SVN: at Mon Aug 17 22:58:25 EDT 2009 |