Declares a class that represents a Probability Density function (PDF) of a 2D pose .
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 56 of file CPosePDFSOG.h.
#include <mrpt/poses/CPosePDFSOG.h>
Classes | |
struct | TGaussianMode |
The struct for each mode: More... | |
Public Types | |
typedef mrpt::aligned_containers < TGaussianMode >::vector_t | CListGaussianModes |
typedef CListGaussianModes::const_iterator | const_iterator |
typedef CListGaussianModes::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 (const CPosePDF &p1, const 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) | |
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. | |
RTTI stuff | |
typedef CPosePDFSOGPtr | SmartPtr |
static mrpt::utils::CLASSINIT | _init_CPosePDFSOG |
static mrpt::utils::TRuntimeClassId | classCPosePDFSOG |
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::CObject * | duplicate () const |
Returns a copy of the object, indepently of its class. | |
static mrpt::utils::CObject * | CreateObject () |
static CPosePDFSOGPtr | Create () |
typedef mrpt::aligned_containers<TGaussianMode>::vector_t mrpt::poses::CPosePDFSOG::CListGaussianModes |
Definition at line 83 of file CPosePDFSOG.h.
Definition at line 84 of file CPosePDFSOG.h.
Definition at line 85 of file CPosePDFSOG.h.
A typedef for the associated smart pointer
Definition at line 59 of file CPosePDFSOG.h.
mrpt::poses::CPosePDFSOG::CPosePDFSOG | ( | size_t | nModes = 1 | ) |
Default constructor.
nModes | The initial size of CPosePDFSOG::m_modes |
static const mrpt::utils::TRuntimeClassId* mrpt::poses::CPosePDFSOG::_GetBaseClass | ( | ) | [static, protected] |
Reimplemented from mrpt::poses::CPosePDF.
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 | ( | const CPosePDF & | p1, |
const 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 136 of file CPosePDFSOG.h.
iterator mrpt::poses::CPosePDFSOG::begin | ( | ) | [inline] |
Definition at line 134 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< CPose2D, 3 >.
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.
static CPosePDFSOGPtr mrpt::poses::CPosePDFSOG::Create | ( | ) | [static] |
static mrpt::utils::CObject* mrpt::poses::CPosePDFSOG::CreateObject | ( | ) | [static] |
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< CPose2D, 3 >.
void mrpt::poses::CPosePDFSOG::drawSingleSample | ( | CPose2D & | outPart | ) | const [virtual] |
Draws a single sample from the distribution.
Implements mrpt::utils::CProbabilityDensityFunction< CPose2D, 3 >.
virtual mrpt::utils::CObject* mrpt::poses::CPosePDFSOG::duplicate | ( | ) | const [virtual] |
Returns a copy of the object, indepently of its class.
Implements mrpt::utils::CObject.
bool mrpt::poses::CPosePDFSOG::empty | ( | ) | const [inline] |
Return whether there is any Gaussian mode.
Definition at line 102 of file CPosePDFSOG.h.
iterator mrpt::poses::CPosePDFSOG::end | ( | ) | [inline] |
Definition at line 135 of file CPosePDFSOG.h.
const_iterator mrpt::poses::CPosePDFSOG::end | ( | ) | const [inline] |
Definition at line 137 of file CPosePDFSOG.h.
Definition at line 139 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).
const TGaussianMode& mrpt::poses::CPosePDFSOG::get | ( | size_t | i | ) | const [inline] |
TGaussianMode& mrpt::poses::CPosePDFSOG::get | ( | size_t | i | ) | [inline] |
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 [virtual] |
Returns an estimate of the pose, (the mean, or mathematical expectation of the PDF).
Implements mrpt::utils::CProbabilityDensityFunction< CPose2D, 3 >.
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.
virtual const mrpt::utils::TRuntimeClassId* mrpt::poses::CPosePDFSOG::GetRuntimeClass | ( | ) | const [virtual] |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::poses::CPosePDF.
void mrpt::poses::CPosePDFSOG::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::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] |
Inserts a copy of the given mode into the SOG.
Definition at line 130 of file CPosePDFSOG.h.
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< CPose2D, 3 >.
size_t mrpt::poses::CPosePDFSOG::size | ( | ) | const [inline] |
Return the number of Gaussian modes.
Definition at line 101 of file CPosePDFSOG.h.
mrpt::utils::CLASSINIT mrpt::poses::CPosePDFSOG::_init_CPosePDFSOG [static, protected] |
Definition at line 59 of file CPosePDFSOG.h.
Definition at line 59 of file CPosePDFSOG.h.
const mrpt::utils::TRuntimeClassId* mrpt::poses::CPosePDFSOG::classinfo [static] |
Definition at line 59 of file CPosePDFSOG.h.
CListGaussianModes mrpt::poses::CPosePDFSOG::m_modes [protected] |
The list of SOG modes.
Definition at line 93 of file CPosePDFSOG.h.
Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:40:17 UTC 2011 |