Main MRPT website > C++ reference
MRPT logo
Public Member Functions | Static Public Member Functions | Protected Member Functions

mrpt::poses::CPose3DPDFGaussianInf Class Reference


Detailed Description

Declares a class that represents a Probability Density function (PDF) of a 3D pose $ p(\mathbf{x}) = [x ~ y ~ z ~ yaw ~ pitch ~ roll]^t $ as a Gaussian described by its mean and its inverse covariance matrix.

This class implements that PDF using a mono-modal Gaussian distribution in "information" form (inverse covariance matrix).

Uncertainty of pose composition operations ( $ y = x \oplus u $) is implemented in the method "CPose3DPDFGaussianInf::operator+=".

For further details on implemented methods and the theory behind them, see this report.

See also:
CPose3D, CPose3DPDF, CPose3DPDFParticles, CPose3DPDFGaussian

Definition at line 55 of file CPose3DPDFGaussianInf.h.

#include <mrpt/poses/CPose3DPDFGaussianInf.h>

Inheritance diagram for mrpt::poses::CPose3DPDFGaussianInf:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CPose3DPDFGaussianInf ()
 Default constructor - mean: all zeros, inverse covariance=all zeros -> so be careful!
 CPose3DPDFGaussianInf (const CPose3D &init_Mean)
 Constructor with a mean value, inverse covariance=all zeros -> so be careful!
 CPose3DPDFGaussianInf (TConstructorFlags_Poses constructor_dummy_param)
 Uninitialized constructor: leave all fields uninitialized - Call with UNINITIALIZED_POSE as argument.
 CPose3DPDFGaussianInf (const CPose3D &init_Mean, const CMatrixDouble66 &init_CovInv)
 Constructor with mean and inv cov.
 CPose3DPDFGaussianInf (const CPose3DQuatPDFGaussian &o)
 Constructor from a 6D pose PDF described as a Quaternion.
void getMean (CPose3D &mean_pose) const
 Returns an estimate of the pose, (the mean, or mathematical expectation of the PDF).
void getCovarianceAndMean (CMatrixDouble66 &cov, CPose3D &mean_point) const
 Returns an estimate of the pose covariance matrix (6x6 cov matrix) and the mean, both at once.
void copyFrom (const CPose3DPDF &o)
 Copy operator, translating if necesary (for example, between particles and gaussian representations)
void copyFrom (const CPosePDF &o)
 Copy operator, translating if necesary (for example, between particles and gaussian representations)
void copyFrom (const CPose3DQuatPDFGaussian &o)
 Copy from a 6D pose PDF described as a Quaternion.
void saveToTextFile (const std::string &file) const
 Save the PDF to a text file, containing the 3D pose in the first line, then the covariance matrix in next 3 lines.
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 drawSingleSample (CPose3D &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 1x6 vectors, where each row contains a (x,y,phi) datum.
void bayesianFusion (const CPose3DPDF &p1, const CPose3DPDF &p2)
 Bayesian fusion of two points gauss.
void inverse (CPose3DPDF &o) const
 Returns a new PDF such as: NEW_PDF = (0,0,0) - THIS_PDF.
CPose3DPDFGaussianInf operator- () const
 Unary - operator, returns the PDF of the inverse pose.
void operator+= (const CPose3D &Ap)
 Makes: thisPDF = thisPDF + Ap, where "+" is pose composition (both the mean, and the covariance matrix are updated).
void operator+= (const CPose3DPDFGaussianInf &Ap)
 Makes: thisPDF = thisPDF + Ap, where "+" is pose composition (both the mean, and the covariance matrix are updated).
void operator-= (const CPose3DPDFGaussianInf &Ap)
 Makes: thisPDF = thisPDF - Ap, where "-" is pose inverse composition (both the mean, and the covariance matrix are updated).
double evaluatePDF (const CPose3D &x) const
 Evaluates the PDF at a given point.
double evaluateNormalizedPDF (const CPose3D &x) const
 Evaluates the ratio PDF(x) / PDF(MEAN), that is, the normalized PDF in the range [0,1].
double mahalanobisDistanceTo (const CPose3DPDFGaussianInf &theOther)
 Computes the Mahalanobis distance between the centers of two Gaussians.
void getInvCovSubmatrix2D (CMatrixDouble &out_cov) const
 Returns a 3x3 matrix with submatrix of the inverse covariance for the variables (x,y,yaw) only.

Static Public Member Functions

static void jacobiansPoseComposition (const CPose3D &x, const CPose3D &u, CMatrixDouble66 &df_dx, CMatrixDouble66 &df_du)
 This static method computes the pose composition Jacobians, with these formulas:

Public Attributes

Data fields
CPose3D mean
 The mean value.
CMatrixDouble66 cov_inv
 The inverse of the 6x6 covariance matrix.

Protected Member Functions

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

RTTI stuff

typedef CPose3DPDFGaussianInfPtr SmartPtr
static mrpt::utils::CLASSINIT _init_CPose3DPDFGaussianInf
static mrpt::utils::TRuntimeClassId classCPose3DPDFGaussianInf
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::CObjectduplicate () const
 Returns a copy of the object, indepently of its class.
static mrpt::utils::CObjectCreateObject ()
static CPose3DPDFGaussianInfPtr Create ()

Member Typedef Documentation

A typedef for the associated smart pointer

Definition at line 58 of file CPose3DPDFGaussianInf.h.


Constructor & Destructor Documentation

mrpt::poses::CPose3DPDFGaussianInf::CPose3DPDFGaussianInf ( )

Default constructor - mean: all zeros, inverse covariance=all zeros -> so be careful!

mrpt::poses::CPose3DPDFGaussianInf::CPose3DPDFGaussianInf ( const CPose3D init_Mean) [explicit]

Constructor with a mean value, inverse covariance=all zeros -> so be careful!

mrpt::poses::CPose3DPDFGaussianInf::CPose3DPDFGaussianInf ( TConstructorFlags_Poses  constructor_dummy_param)

Uninitialized constructor: leave all fields uninitialized - Call with UNINITIALIZED_POSE as argument.

mrpt::poses::CPose3DPDFGaussianInf::CPose3DPDFGaussianInf ( const CPose3D init_Mean,
const CMatrixDouble66 init_CovInv 
)

Constructor with mean and inv cov.

mrpt::poses::CPose3DPDFGaussianInf::CPose3DPDFGaussianInf ( const CPose3DQuatPDFGaussian o) [explicit]

Constructor from a 6D pose PDF described as a Quaternion.


Member Function Documentation

static const mrpt::utils::TRuntimeClassId* mrpt::poses::CPose3DPDFGaussianInf::_GetBaseClass ( ) [static, protected]

Reimplemented from mrpt::poses::CPose3DPDF.

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

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

void mrpt::poses::CPose3DPDFGaussianInf::bayesianFusion ( const CPose3DPDF p1,
const CPose3DPDF p2 
) [virtual]

Bayesian fusion of two points gauss.

distributions, then save the result in this object. The process is as follows:

  • (x1,S1): Mean and variance of the p1 distribution.
  • (x2,S2): Mean and variance of the p2 distribution.
  • (x,S): Mean and variance of the resulting distribution.

S = (S1-1 + S2-1)-1; x = S * ( S1-1*x1 + S2-1*x2 );

Implements mrpt::poses::CPose3DPDF.

void mrpt::poses::CPose3DPDFGaussianInf::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< CPose3D, 6 >.

void mrpt::poses::CPose3DPDFGaussianInf::copyFrom ( const CPose3DPDF o) [virtual]

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

Implements mrpt::poses::CPose3DPDF.

void mrpt::poses::CPose3DPDFGaussianInf::copyFrom ( const CPosePDF o)

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

void mrpt::poses::CPose3DPDFGaussianInf::copyFrom ( const CPose3DQuatPDFGaussian o)

Copy from a 6D pose PDF described as a Quaternion.

static CPose3DPDFGaussianInfPtr mrpt::poses::CPose3DPDFGaussianInf::Create ( ) [static]
static mrpt::utils::CObject* mrpt::poses::CPose3DPDFGaussianInf::CreateObject ( ) [static]
void mrpt::poses::CPose3DPDFGaussianInf::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 1x6 vectors, where each row contains a (x,y,phi) datum.

Reimplemented from mrpt::utils::CProbabilityDensityFunction< CPose3D, 6 >.

void mrpt::poses::CPose3DPDFGaussianInf::drawSingleSample ( CPose3D outPart) const [virtual]

Draws a single sample from the distribution.

Implements mrpt::utils::CProbabilityDensityFunction< CPose3D, 6 >.

virtual mrpt::utils::CObject* mrpt::poses::CPose3DPDFGaussianInf::duplicate ( ) const [virtual]

Returns a copy of the object, indepently of its class.

Implements mrpt::utils::CObject.

double mrpt::poses::CPose3DPDFGaussianInf::evaluateNormalizedPDF ( const CPose3D x) const

Evaluates the ratio PDF(x) / PDF(MEAN), that is, the normalized PDF in the range [0,1].

double mrpt::poses::CPose3DPDFGaussianInf::evaluatePDF ( const CPose3D x) const

Evaluates the PDF at a given point.

void mrpt::poses::CPose3DPDFGaussianInf::getCovarianceAndMean ( CMatrixDouble66 cov,
CPose3D mean_point 
) const

Returns an estimate of the pose covariance matrix (6x6 cov matrix) and the mean, both at once.

See also:
getMean
void mrpt::poses::CPose3DPDFGaussianInf::getInvCovSubmatrix2D ( CMatrixDouble out_cov) const

Returns a 3x3 matrix with submatrix of the inverse covariance for the variables (x,y,yaw) only.

void mrpt::poses::CPose3DPDFGaussianInf::getMean ( CPose3D mean_pose) const [virtual]

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

See also:
getCovariance

Implements mrpt::utils::CProbabilityDensityFunction< CPose3D, 6 >.

virtual const mrpt::utils::TRuntimeClassId* mrpt::poses::CPose3DPDFGaussianInf::GetRuntimeClass ( ) const [virtual]

Returns information about the class of an object in runtime.

Reimplemented from mrpt::poses::CPose3DPDF.

void mrpt::poses::CPose3DPDFGaussianInf::inverse ( CPose3DPDF o) const [virtual]

Returns a new PDF such as: NEW_PDF = (0,0,0) - THIS_PDF.

Implements mrpt::poses::CPose3DPDF.

static void mrpt::poses::CPose3DPDFGaussianInf::jacobiansPoseComposition ( const CPose3D x,
const CPose3D u,
CMatrixDouble66 df_dx,
CMatrixDouble66 df_du 
) [static]

This static method computes the pose composition Jacobians, with these formulas:

                                df_dx =
                                [ 1, 0, 0, -sin(yaw)*cos(p)*xu+(-sin(yaw)*sin(p)*sin(r)-cos(yaw)*cos(r))*yu+(-sin(yaw)*sin(p)*cos(r)+cos(yaw)*sin(r))*zu, -cos(yaw)*sin(p)*xu+cos(yaw)*cos(p)*sin(r)*yu+cos(yaw)*cos(p)*cos(r)*zu, (cos(yaw)*sin(p)*cos(r)+sin(yaw)*sin(r))*yu+(-cos(yaw)*sin(p)*sin(r)+sin(yaw)*cos(r))*zu]
                                [ 0, 1, 0,    cos(yaw)*cos(p)*xu+(cos(yaw)*sin(p)*sin(r)-sin(yaw)*cos(r))*yu+(cos(yaw)*sin(p)*cos(r)+sin(yaw)*sin(r))*zu, -sin(yaw)*sin(p)*xu+sin(yaw)*cos(p)*sin(r)*yu+sin(yaw)*cos(p)*cos(r)*zu, (sin(yaw)*sin(p)*cos(r)-cos(yaw)*sin(r))*yu+(-sin(yaw)*sin(p)*sin(r)-cos(yaw)*cos(r))*zu]
                                [ 0, 0, 1,                                                                                                             0, -cos(p)*xu-sin(p)*sin(r)*yu-sin(p)*cos(r)*zu,                            cos(p)*cos(r)*yu-cos(p)*sin(r)*zu]
                                [ 0, 0, 0, 1, 0, 0]
                                [ 0, 0, 0, 0, 1, 0]
                                [ 0, 0, 0, 0, 0, 1]

                                df_du =
                                [ cos(yaw)*cos(p), cos(yaw)*sin(p)*sin(r)-sin(yaw)*cos(r), cos(yaw)*sin(p)*cos(r)+sin(yaw)*sin(r), 0, 0, 0]
                                [ sin(yaw)*cos(p), sin(yaw)*sin(p)*sin(r)+cos(yaw)*cos(r), sin(yaw)*sin(p)*cos(r)-cos(yaw)*sin(r), 0, 0, 0]
                                [ -sin(p),         cos(p)*sin(r),                          cos(p)*cos(r),                          0, 0, 0]
                                [ 0, 0, 0, 1, 0, 0]
                                [ 0, 0, 0, 0, 1, 0]
                                [ 0, 0, 0, 0, 0, 1]
double mrpt::poses::CPose3DPDFGaussianInf::mahalanobisDistanceTo ( const CPose3DPDFGaussianInf theOther)

Computes the Mahalanobis distance between the centers of two Gaussians.

The variables with a variance exactly equal to 0 are not taken into account in the process, but "infinity" is returned if the corresponding elements are not exactly equal.

void mrpt::poses::CPose3DPDFGaussianInf::operator+= ( const CPose3D Ap)

Makes: thisPDF = thisPDF + Ap, where "+" is pose composition (both the mean, and the covariance matrix are updated).

void mrpt::poses::CPose3DPDFGaussianInf::operator+= ( const CPose3DPDFGaussianInf Ap)

Makes: thisPDF = thisPDF + Ap, where "+" is pose composition (both the mean, and the covariance matrix are updated).

CPose3DPDFGaussianInf mrpt::poses::CPose3DPDFGaussianInf::operator- ( ) const [inline]

Unary - operator, returns the PDF of the inverse pose.

Definition at line 148 of file CPose3DPDFGaussianInf.h.

References inverse(), and mrpt::poses::UNINITIALIZED_POSE.

void mrpt::poses::CPose3DPDFGaussianInf::operator-= ( const CPose3DPDFGaussianInf Ap)

Makes: thisPDF = thisPDF - Ap, where "-" is pose inverse composition (both the mean, and the covariance matrix are updated).

void mrpt::poses::CPose3DPDFGaussianInf::saveToTextFile ( const std::string &  file) const [virtual]

Save the PDF to a text file, containing the 3D pose in the first line, then the covariance matrix in next 3 lines.

Implements mrpt::utils::CProbabilityDensityFunction< CPose3D, 6 >.


Member Data Documentation

Definition at line 58 of file CPose3DPDFGaussianInf.h.

Definition at line 58 of file CPose3DPDFGaussianInf.h.

Definition at line 58 of file CPose3DPDFGaussianInf.h.

The inverse of the 6x6 covariance matrix.

Definition at line 70 of file CPose3DPDFGaussianInf.h.

The mean value.

Definition at line 69 of file CPose3DPDFGaussianInf.h.




Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:40:17 UTC 2011