MRPT logo

mrpt::poses::CPointPDFSOG Class Reference

Declares a class that represents a Probability Density function (PDF) of a 3D point $ p(\mathbf{x}) = [x ~ y ~ z ]^t $. More...

#include <mrpt/poses/CPointPDFSOG.h>

Inheritance diagram for mrpt::poses::CPointPDFSOG:

mrpt::poses::CPointPDF mrpt::utils::CSerializable

List of all members.

Classes

struct  TGaussianMode
 The struct for each mode:. More...

Public Types

typedef std::vector
< TGaussianMode
CListGaussianModes

Public Member Functions

 CPointPDFSOG (size_t nModes=1)
 Default constructor.
size_t size () const
 Returns the number of Gaussian modes in the SOG.
CPoint3D getEstimatedPoint () const
 Returns an estimate of the point, (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,z variables).
void normalizeWeights ()
 Normalize the weights in m_modes such as the maximum log-weight is 0.
double ESS () const
 Computes the "Effective sample size" (typical measure for Particle Filters), applied to the weights of the individual Gaussian modes, as a measure of the equality of the modes (in the range [0,total # of modes]).
void copyFrom (const CPointPDF &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:
  • w (The weight)
  • x_mean (gaussian mean value)
  • y_mean (gaussian mean value)
  • x_mean (gaussian mean value)
  • C11 (Covariance elements)
  • C22 (Covariance elements)
  • C33 (Covariance elements)
  • C12 (Covariance elements)
  • C13 (Covariance elements)
  • C23 (Covariance 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 getAs3DObject (mrpt::opengl::CSetOfObjectsPtr &outObj) const
 Returns a 3D object representation of all the ellipses in the SoG.
void drawSingleSample (CPoint3D &outSample) const
 Draw a sample from the pdf.
void bayesianFusion (CPointPDF &p1, CPointPDF &p2, const double &minMahalanobisDistToDrop=0)
 Bayesian fusion of two point distributions (product of two distributions->new distribution), then save the result in this object (WARNING: See implementing classes to see classes that can and cannot be mixtured!).
void evaluatePDFInArea (float x_min, float x_max, float y_min, float y_max, float resolutionXY, float z, CMatrixD &outMatrix, bool sumOverAllZs=false)
 Evaluates the PDF within a rectangular grid and saves the result in a matrix (each row contains values for a fixed y-coordinate value).
double evaluatePDF (const CPoint3D &x, bool sumOverAllZs) const
 Evaluates the PDF at a given point.

Public Attributes

CListGaussianModes 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!).


Detailed Description

Declares a class that represents a Probability Density function (PDF) of a 3D point $ p(\mathbf{x}) = [x ~ y ~ z ]^t $.

This class implements that PDF as the following multi-modal Gaussian distribution:

$ p(\mathbf{x}) = \sum\limits_{i=1}^N \omega^i \mathcal{N}( \mathbf{x} ; \bar{\mathbf{x}}^i, \mathbf{\Sigma}^i ) $

Where the number of modes N is the size of CPointPDFSOG::m_modes

See mrpt::poses::CPointPDF for more details.

See also:
CPointPDF, CPosePDF,

Definition at line 57 of file CPointPDFSOG.h.


Member Typedef Documentation

Definition at line 89 of file CPointPDFSOG.h.


Constructor & Destructor Documentation

mrpt::poses::CPointPDFSOG::CPointPDFSOG ( size_t  nModes = 1  ) 

Default constructor.

Parameters:
nModes The initial size of CPointPDFSOG::m_modes


Member Function Documentation

void mrpt::poses::CPointPDFSOG::assureSymmetry (  )  [protected]

Assures the symmetry of the covariance matrix (eventually certain operations in the math-coprocessor lead to non-symmetric matrixes!).

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

Bayesian fusion of two point distributions (product of two distributions->new distribution), then save the result in this object (WARNING: See implementing classes to see classes that can and cannot be mixtured!).

Parameters:
p1 The first distribution to fuse
p2 The second distribution to fuse
minMahalanobisDistToDrop If set to different of 0, the result of very separate Gaussian modes (that will result in negligible components) in SOGs will be dropped to reduce the number of modes in the output.

Implements mrpt::poses::CPointPDF.

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

void mrpt::poses::CPointPDFSOG::copyFrom ( const CPointPDF o  )  [virtual]

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

Implements mrpt::poses::CPointPDF.

void mrpt::poses::CPointPDFSOG::drawSingleSample ( CPoint3D outSample  )  const [virtual]

Draw a sample from the pdf.

Implements mrpt::poses::CPointPDF.

double mrpt::poses::CPointPDFSOG::ESS (  )  const

Computes the "Effective sample size" (typical measure for Particle Filters), applied to the weights of the individual Gaussian modes, as a measure of the equality of the modes (in the range [0,total # of modes]).

double mrpt::poses::CPointPDFSOG::evaluatePDF ( const CPoint3D x,
bool  sumOverAllZs 
) const

Evaluates the PDF at a given point.

void mrpt::poses::CPointPDFSOG::evaluatePDFInArea ( float  x_min,
float  x_max,
float  y_min,
float  y_max,
float  resolutionXY,
float  z,
CMatrixD outMatrix,
bool  sumOverAllZs = false 
)

Evaluates the PDF within a rectangular grid and saves the result in a matrix (each row contains values for a fixed y-coordinate value).

void mrpt::poses::CPointPDFSOG::getAs3DObject ( mrpt::opengl::CSetOfObjectsPtr &  outObj  )  const

Returns a 3D object representation of all the ellipses in the SoG.

CMatrixD mrpt::poses::CPointPDFSOG::getEstimatedCovariance (  )  const [virtual]

Returns an estimate of the pose covariance matrix (3x3 cov.matrix for x,y,z variables).

Implements mrpt::poses::CPointPDF.

CPoint3D mrpt::poses::CPointPDFSOG::getEstimatedPoint (  )  const [virtual]

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

Implements mrpt::poses::CPointPDF.

void mrpt::poses::CPointPDFSOG::normalizeWeights (  ) 

Normalize the weights in m_modes such as the maximum log-weight is 0.

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

  • w (The weight)
  • x_mean (gaussian mean value)
  • y_mean (gaussian mean value)
  • x_mean (gaussian mean value)
  • C11 (Covariance elements)
  • C22 (Covariance elements)
  • C33 (Covariance elements)
  • C12 (Covariance elements)
  • C13 (Covariance elements)
  • C23 (Covariance elements).

Implements mrpt::poses::CPointPDF.

size_t mrpt::poses::CPointPDFSOG::size (  )  const [inline]

Returns the number of Gaussian modes in the SOG.

Definition at line 98 of file CPointPDFSOG.h.


Member Data Documentation

Access directly to this array for modify the modes as desired.

Note that no weight can be zero!!

Definition at line 94 of file CPointPDFSOG.h.




Page generated by Doxygen 1.5.7.1 for MRPT 0.6.5 SVN: at Mon Feb 23 13:35:09 EST 2009