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

mrpt::poses::CPose3DPDFGaussian 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 $.

This class implements that PDF using a mono-modal Gaussian distribution. See mrpt::poses::CPose3DPDF for more details.

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

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

See also:
CPose3D, CPose3DPDF, CPose3DPDFParticles

Definition at line 55 of file CPose3DPDFGaussian.h.

#include <mrpt/poses/CPose3DPDFGaussian.h>

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

List of all members.

Public Member Functions

 CPose3DPDFGaussian ()
 Default constructor.
 CPose3DPDFGaussian (const CPose3D &init_Mean)
 Constructor.
 CPose3DPDFGaussian (TConstructorFlags_Poses constructor_dummy_param)
 Uninitialized constructor: leave all fields uninitialized - Call with UNINITIALIZED_POSE as argument.
 MRPT_DECLARE_DEPRECATED_FUNCTION ("Deprecated: use the constructor accepting a CMatrixDouble66 instead.", CPose3DPDFGaussian(const CPose3D &init_Mean, const CMatrixD &init_Cov))
 CPose3DPDFGaussian (const CPose3D &init_Mean, const CMatrixDouble66 &init_Cov)
 Constructor.
 CPose3DPDFGaussian (const CPosePDFGaussian &o)
 Constructor from a Gaussian 2D pose PDF (sets to 0 the missing variables z,pitch, and roll).
 CPose3DPDFGaussian (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.
CPose3DPDFGaussian 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 CPose3DPDFGaussian &Ap)
 Makes: thisPDF = thisPDF + Ap, where "+" is pose composition (both the mean, and the covariance matrix are updated).
void operator-= (const CPose3DPDFGaussian &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 CPose3DPDFGaussian &theOther)
 Computes the Mahalanobis distance between the centers of two Gaussians.
void getCovSubmatrix2D (CMatrixDouble &out_cov) const
 Returns a 3x3 matrix with submatrix of the 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.

Public Attributes

CPose3D mean
 The mean value.
CMatrixDouble66 cov
 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 CPose3DPDFGaussianPtr SmartPtr
static mrpt::utils::CLASSINIT _init_CPose3DPDFGaussian
static mrpt::utils::TRuntimeClassId classCPose3DPDFGaussian
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 CPose3DPDFGaussianPtr Create ()

Member Typedef Documentation

A typedef for the associated smart pointer

Definition at line 58 of file CPose3DPDFGaussian.h.


Constructor & Destructor Documentation

mrpt::poses::CPose3DPDFGaussian::CPose3DPDFGaussian (  )

Default constructor.

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

Constructor.

mrpt::poses::CPose3DPDFGaussian::CPose3DPDFGaussian ( TConstructorFlags_Poses  constructor_dummy_param )

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

mrpt::poses::CPose3DPDFGaussian::CPose3DPDFGaussian ( const CPose3D init_Mean,
const CMatrixDouble66 init_Cov 
)

Constructor.

mrpt::poses::CPose3DPDFGaussian::CPose3DPDFGaussian ( const CPosePDFGaussian o ) [explicit]

Constructor from a Gaussian 2D pose PDF (sets to 0 the missing variables z,pitch, and roll).

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

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


Member Function Documentation

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

Reimplemented from mrpt::poses::CPose3DPDF.

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

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

void mrpt::poses::CPose3DPDFGaussian::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::CPose3DPDFGaussian::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::CPose3DPDFGaussian::copyFrom ( const CPose3DPDF o ) [virtual]

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

Implements mrpt::poses::CPose3DPDF.

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

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

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

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

static CPose3DPDFGaussianPtr mrpt::poses::CPose3DPDFGaussian::Create (  ) [static]
static mrpt::utils::CObject* mrpt::poses::CPose3DPDFGaussian::CreateObject (  ) [static]
void mrpt::poses::CPose3DPDFGaussian::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::CPose3DPDFGaussian::drawSingleSample ( CPose3D outPart ) const [virtual]

Draws a single sample from the distribution.

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

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

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

Implements mrpt::utils::CObject.

double mrpt::poses::CPose3DPDFGaussian::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::CPose3DPDFGaussian::evaluatePDF ( const CPose3D x ) const

Evaluates the PDF at a given point.

void mrpt::poses::CPose3DPDFGaussian::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::CPose3DPDFGaussian::getCovSubmatrix2D ( CMatrixDouble out_cov ) const

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

void mrpt::poses::CPose3DPDFGaussian::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::CPose3DPDFGaussian::GetRuntimeClass (  ) const [virtual]

Returns information about the class of an object in runtime.

Reimplemented from mrpt::poses::CPose3DPDF.

void mrpt::poses::CPose3DPDFGaussian::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::CPose3DPDFGaussian::jacobiansPoseComposition ( const CPose3D x,
const CPose3D u,
CMatrixDouble66 df_dx,
CMatrixDouble66 df_du 
) [static]

This static method computes the pose composition Jacobians.

See this techical report: http:///www.mrpt.org/6D_poses:equivalences_compositions_and_uncertainty

Direct equations (for the covariances) in yaw-pitch-roll are too complex. Make a way around them and consider instead this path:

      X(6D)       U(6D)
        |           |
        v           v
      X(7D)       U(7D)
        |           |
        +--- (+) ---+
              |
              v
            RES(7D)
              |
              v
            RES(6D)

Referenced by mrpt::math::jacobians::jacobs_6D_pose_comp().

double mrpt::poses::CPose3DPDFGaussian::mahalanobisDistanceTo ( const CPose3DPDFGaussian 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.

mrpt::poses::CPose3DPDFGaussian::MRPT_DECLARE_DEPRECATED_FUNCTION ( "Deprecated: use the constructor accepting a CMatrixDouble66 instead."  ,
CPose3DPDFGaussian(const CPose3D &init_Mean, const CMatrixD &init_Cov)   
)
void mrpt::poses::CPose3DPDFGaussian::operator+= ( const CPose3DPDFGaussian Ap )

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

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

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

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

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

Definition at line 158 of file CPose3DPDFGaussian.h.

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

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

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

void mrpt::poses::CPose3DPDFGaussian::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 CPose3DPDFGaussian.h.

Definition at line 58 of file CPose3DPDFGaussian.h.

Definition at line 58 of file CPose3DPDFGaussian.h.

The 6x6 covariance matrix.

Definition at line 100 of file CPose3DPDFGaussian.h.

The mean value.

Definition at line 96 of file CPose3DPDFGaussian.h.




Page generated by Doxygen 1.7.2 for MRPT 0.9.4 SVN: at Mon Jan 10 22:46:17 UTC 2011