Main MRPT website > C++ reference for MRPT 1.4.0
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
mrpt::poses::CPosePDFSOG Class Referenceabstract

Detailed Description

Declares a class that represents a Probability Density function (PDF) of a 2D pose $ p(\mathbf{x}) = [x ~ y ~ \phi ]^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 CPosePDFSOG::m_modes

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

See also
CPose2D, CPosePDF, CPosePDFParticles

Definition at line 36 of file CPosePDFSOG.h.

#include <mrpt/poses/CPosePDFSOG.h>

Inheritance diagram for mrpt::poses::CPosePDFSOG:
Inheritance graph

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
 
enum  { is_3D_val = 0 }
 
enum  { is_PDF_val = 1 }
 
typedef CPose2D type_value
 The type of the state the PDF represents.
 

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 TGaussianModeoperator[] (size_t i) const
 Access to individual beacons.
 
TGaussianModeoperator[] (size_t i)
 Access to individual beacons.
 
const TGaussianModeget (size_t i) const
 Access to individual beacons.
 
TGaussianModeget (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 MRPT_OVERRIDE
 Returns an estimate of the pose, (the mean, or mathematical expectation of the PDF)
 
void getCovarianceAndMean (mrpt::math::CMatrixDouble33 &cov, CPose2D &mean_point) const MRPT_OVERRIDE
 Returns an estimate of the pose covariance matrix (3x3 cov matrix) and the mean, both at once.
 
void getMostLikelyCovarianceAndMean (mrpt::math::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) MRPT_OVERRIDE
 Copy operator, translating if necesary (for example, between particles and gaussian representations)
 
void saveToTextFile (const std::string &file) const MRPT_OVERRIDE
 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) MRPT_OVERRIDE
 this = p (+) this.
 
void rotateAllCovariances (const double &ang)
 Rotate all the covariance matrixes by replacing them by $ \mathbf{R}~\mathbf{COV}~\mathbf{R}^t $, where $ \mathbf{R} = \left[ \begin{array}{ccc} \cos\alpha & -\sin\alpha & 0 \\ \sin\alpha & \cos\alpha & 0 \\ 0 & 0 & 1 \end{array}\right] $.
 
void drawSingleSample (CPose2D &outPart) const MRPT_OVERRIDE
 Draws a single sample from the distribution.
 
void drawManySamples (size_t N, std::vector< mrpt::math::CVectorDouble > &outSamples) const MRPT_OVERRIDE
 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 MRPT_OVERRIDE
 Returns a new PDF such as: NEW_PDF = (0,0,0) - THIS_PDF.
 
void operator+= (const mrpt::poses::CPose2D &Ap)
 Makes: thisPDF = thisPDF + Ap, where "+" is pose composition (both the mean, and the covariance matrix are updated).
 
double evaluatePDF (const mrpt::poses::CPose2D &x, bool sumOverAllPhis=false) const
 Evaluates the PDF at a given point.
 
double evaluateNormalizedPDF (const mrpt::poses::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, mrpt::math::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) MRPT_OVERRIDE
 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)
 
template<class OPENGL_SETOFOBJECTSPTR >
void getAs3DObject (OPENGL_SETOFOBJECTSPTR &out_obj) const
 Returns a 3D representation of this PDF (it doesn't clear the current contents of out_obj, but append new OpenGL objects to that list)
 
template<class OPENGL_SETOFOBJECTSPTR >
OPENGL_SETOFOBJECTSPTR getAs3DObject () const
 Returns a 3D representation of this PDF.
 
virtual void getMean (CPose2D &mean_point) const=0
 Returns the mean, or mathematical expectation of the probability density distribution (PDF).
 
virtual void getCovarianceAndMean (mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &cov, CPose2D &mean_point) const=0
 Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean, both at once.
 
void getCovarianceDynAndMean (mrpt::math::CMatrixDouble &cov, CPose2D &mean_point) const
 Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean, both at once.
 
CPose2D getMeanVal () const
 Returns the mean, or mathematical expectation of the probability density distribution (PDF).
 
void getCovariance (mrpt::math::CMatrixDouble &cov) const
 Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)
 
void getCovariance (mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &cov) const
 Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)
 
mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > getCovariance () const
 Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)
 
virtual void getInformationMatrix (mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &inf) const
 Returns the information (inverse covariance) matrix (a STATE_LEN x STATE_LEN matrix) Unless reimplemented in derived classes, this method first reads the covariance, then invert it.
 
virtual void drawSingleSample (CPose2D &outPart) const=0
 Draws a single sample from the distribution.
 
double getCovarianceEntropy () const
 Compute the entropy of the estimated covariance matrix.
 

Static Public Member Functions

static void jacobiansPoseComposition (const CPose2D &x, const CPose2D &u, mrpt::math::CMatrixDouble33 &df_dx, mrpt::math::CMatrixDouble33 &df_du, const bool compute_df_dx=true, const bool compute_df_du=true)
 This static method computes the pose composition Jacobians, with these formulas:
 
static void jacobiansPoseComposition (const CPosePDFGaussian &x, const CPosePDFGaussian &u, mrpt::math::CMatrixDouble33 &df_dx, mrpt::math::CMatrixDouble33 &df_du)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
static bool is_3D ()
 
static bool is_PDF ()
 

Static Public Attributes

static const size_t state_length
 The length of the variable, for example, 3 for a 3D point, 6 for a 3D pose (x y z yaw pitch roll).
 
RTTI stuff <br>
static const mrpt::utils::TRuntimeClassId classCPosePDF
 

Protected Member Functions

void assureSymmetry ()
 Ensures the symmetry of the covariance matrix (eventually certain operations in the math-coprocessor lead to non-symmetric matrixes!)
 
CSerializable virtual methods
void writeToStream (mrpt::utils::CStream &out, int *getVersion) const MRPT_OVERRIDE
 
void readFromStream (mrpt::utils::CStream &in, int version) MRPT_OVERRIDE
 

Protected Attributes

CListGaussianModes m_modes
 The list of SOG modes.
 

RTTI stuff <br>

typedef CPosePDFSOGPtr SmartPtr
 
static mrpt::utils::CLASSINIT _init_CPosePDFSOG
 
static mrpt::utils::TRuntimeClassId classCPosePDFSOG
 
static const mrpt::utils::TRuntimeClassIdclassinfo
 
static const mrpt::utils::TRuntimeClassId_GetBaseClass ()
 
virtual const mrpt::utils::TRuntimeClassIdGetRuntimeClass () const MRPT_OVERRIDE
 
virtual mrpt::utils::CObjectduplicate () const MRPT_OVERRIDE
 
static mrpt::utils::CObjectCreateObject ()
 
static CPosePDFSOGPtr Create ()
 

Member Typedef Documentation

◆ CListGaussianModes

Definition at line 63 of file CPosePDFSOG.h.

◆ const_iterator

typedef CListGaussianModes::const_iterator mrpt::poses::CPosePDFSOG::const_iterator

Definition at line 64 of file CPosePDFSOG.h.

◆ iterator

typedef CListGaussianModes::iterator mrpt::poses::CPosePDFSOG::iterator

Definition at line 65 of file CPosePDFSOG.h.

◆ SmartPtr

A typedef for the associated smart pointer

Definition at line 39 of file CPosePDFSOG.h.

◆ type_value

typedef CPose2D mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::type_value
inherited

The type of the state the PDF represents.

Definition at line 32 of file CProbabilityDensityFunction.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
is_3D_val 

Definition at line 91 of file CPosePDF.h.

◆ anonymous enum

anonymous enum
inherited
Enumerator
is_PDF_val 

Definition at line 93 of file CPosePDF.h.

Constructor & Destructor Documentation

◆ CPosePDFSOG()

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

Default constructor.

Parameters
nModesThe initial size of CPosePDFSOG::m_modes

Member Function Documentation

◆ _GetBaseClass()

static const mrpt::utils::TRuntimeClassId * mrpt::poses::CPosePDFSOG::_GetBaseClass ( )
staticprotected

◆ assureSymmetry()

void mrpt::poses::CPosePDFSOG::assureSymmetry ( )
protected

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

◆ bayesianFusion()

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.

◆ begin() [1/2]

iterator mrpt::poses::CPosePDFSOG::begin ( )
inline

Definition at line 110 of file CPosePDFSOG.h.

◆ begin() [2/2]

const_iterator mrpt::poses::CPosePDFSOG::begin ( ) const
inline

Definition at line 112 of file CPosePDFSOG.h.

◆ changeCoordinatesReference()

void mrpt::poses::CPosePDFSOG::changeCoordinatesReference ( const CPose3D newReferenceBase)
virtual

this = p (+) this.

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 >.

◆ clear()

void mrpt::poses::CPosePDFSOG::clear ( )

Clear the list of modes.

◆ copyFrom()

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.

◆ Create()

static CPosePDFSOGPtr mrpt::poses::CPosePDFSOG::Create ( )
static

◆ CreateObject()

static mrpt::utils::CObject * mrpt::poses::CPosePDFSOG::CreateObject ( )
static

◆ drawManySamples()

void mrpt::poses::CPosePDFSOG::drawManySamples ( size_t  N,
std::vector< mrpt::math::CVectorDouble > &  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 >.

◆ drawSingleSample() [1/2]

void mrpt::poses::CPosePDFSOG::drawSingleSample ( CPose2D outPart) const

Draws a single sample from the distribution.

◆ drawSingleSample() [2/2]

virtual void mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::drawSingleSample ( CPose2D &  outPart) const
pure virtualinherited

Draws a single sample from the distribution.

◆ duplicate()

virtual mrpt::utils::CObject * mrpt::poses::CPosePDFSOG::duplicate ( ) const
virtual

◆ empty()

bool mrpt::poses::CPosePDFSOG::empty ( ) const
inline

Return whether there is any Gaussian mode.

Definition at line 78 of file CPosePDFSOG.h.

◆ end() [1/2]

iterator mrpt::poses::CPosePDFSOG::end ( )
inline

Definition at line 111 of file CPosePDFSOG.h.

◆ end() [2/2]

const_iterator mrpt::poses::CPosePDFSOG::end ( ) const
inline

Definition at line 113 of file CPosePDFSOG.h.

◆ erase()

iterator mrpt::poses::CPosePDFSOG::erase ( iterator  i)
inline

Definition at line 115 of file CPosePDFSOG.h.

◆ evaluateNormalizedPDF()

double mrpt::poses::CPosePDFSOG::evaluateNormalizedPDF ( const mrpt::poses::CPose2D x) const

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

◆ evaluatePDF()

double mrpt::poses::CPosePDFSOG::evaluatePDF ( const mrpt::poses::CPose2D x,
bool  sumOverAllPhis = false 
) const

Evaluates the PDF at a given point.

◆ evaluatePDFInArea()

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,
mrpt::math::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).

◆ get() [1/2]

TGaussianMode & mrpt::poses::CPosePDFSOG::get ( size_t  i)
inline

Access to individual beacons.

Definition at line 100 of file CPosePDFSOG.h.

References ASSERT_.

◆ get() [2/2]

const TGaussianMode & mrpt::poses::CPosePDFSOG::get ( size_t  i) const
inline

Access to individual beacons.

Definition at line 95 of file CPosePDFSOG.h.

References ASSERT_.

◆ getAs3DObject() [1/2]

template<class OPENGL_SETOFOBJECTSPTR >
OPENGL_SETOFOBJECTSPTR mrpt::poses::CPosePDF::getAs3DObject ( ) const
inlineinherited

Returns a 3D representation of this PDF.

Note
Needs the mrpt-opengl library, and using mrpt::opengl::CSetOfObjectsPtr as template argument.

Definition at line 109 of file CPosePDF.h.

◆ getAs3DObject() [2/2]

template<class OPENGL_SETOFOBJECTSPTR >
void mrpt::poses::CPosePDF::getAs3DObject ( OPENGL_SETOFOBJECTSPTR &  out_obj) const
inlineinherited

Returns a 3D representation of this PDF (it doesn't clear the current contents of out_obj, but append new OpenGL objects to that list)

Note
Needs the mrpt-opengl library, and using mrpt::opengl::CSetOfObjectsPtr as template argument.

Definition at line 100 of file CPosePDF.h.

◆ getCovariance() [1/3]

mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::getCovariance ( ) const
inlineinherited

Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)

See also
getMean, getInformationMatrix

Definition at line 85 of file CProbabilityDensityFunction.h.

◆ getCovariance() [2/3]

void mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::getCovariance ( mrpt::math::CMatrixDouble cov) const
inlineinherited

Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)

See also
getMean, getCovarianceAndMean, getInformationMatrix

Definition at line 67 of file CProbabilityDensityFunction.h.

◆ getCovariance() [3/3]

void mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::getCovariance ( mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &  cov) const
inlineinherited

Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)

See also
getMean, getCovarianceAndMean, getInformationMatrix

Definition at line 76 of file CProbabilityDensityFunction.h.

◆ getCovarianceAndMean() [1/2]

void mrpt::poses::CPosePDFSOG::getCovarianceAndMean ( mrpt::math::CMatrixDouble33 cov,
CPose2D mean_point 
) const

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

See also
getMean

◆ getCovarianceAndMean() [2/2]

virtual void mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::getCovarianceAndMean ( mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &  cov,
CPose2D &  mean_point 
) const
pure virtualinherited

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

See also
getMean, getInformationMatrix

◆ getCovarianceDynAndMean()

void mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::getCovarianceDynAndMean ( mrpt::math::CMatrixDouble cov,
CPose2D &  mean_point 
) const
inlineinherited

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

See also
getMean, getInformationMatrix

Definition at line 47 of file CProbabilityDensityFunction.h.

◆ getCovarianceEntropy()

double mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::getCovarianceEntropy ( ) const
inlineinherited

Compute the entropy of the estimated covariance matrix.

See also
http://en.wikipedia.org/wiki/Multivariate_normal_distribution#Entropy

Definition at line 136 of file CProbabilityDensityFunction.h.

◆ getInformationMatrix()

virtual void mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::getInformationMatrix ( mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &  inf) const
inlinevirtualinherited

Returns the information (inverse covariance) matrix (a STATE_LEN x STATE_LEN matrix) Unless reimplemented in derived classes, this method first reads the covariance, then invert it.

See also
getMean, getCovarianceAndMean

Definition at line 98 of file CProbabilityDensityFunction.h.

◆ getMean() [1/2]

virtual void mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::getMean ( CPose2D &  mean_point) const
pure virtualinherited

Returns the mean, or mathematical expectation of the probability density distribution (PDF).

See also
getCovarianceAndMean, getInformationMatrix

◆ getMean() [2/2]

void mrpt::poses::CPosePDFSOG::getMean ( CPose2D mean_pose) const

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

See also
getCovariance

◆ getMeanVal()

CPose2D mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::getMeanVal ( ) const
inlineinherited

Returns the mean, or mathematical expectation of the probability density distribution (PDF).

See also
getCovariance, getInformationMatrix

Definition at line 57 of file CProbabilityDensityFunction.h.

◆ getMostLikelyCovarianceAndMean()

void mrpt::poses::CPosePDFSOG::getMostLikelyCovarianceAndMean ( mrpt::math::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.

See also
getMean

◆ GetRuntimeClass()

virtual const mrpt::utils::TRuntimeClassId * mrpt::poses::CPosePDFSOG::GetRuntimeClass ( ) const
virtual

Reimplemented from mrpt::poses::CPosePDF.

◆ inverse()

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.

◆ is_3D()

static bool mrpt::poses::CPosePDF::is_3D ( )
inlinestaticinherited

Definition at line 92 of file CPosePDF.h.

◆ is_PDF()

static bool mrpt::poses::CPosePDF::is_PDF ( )
inlinestaticinherited

Definition at line 94 of file CPosePDF.h.

◆ jacobiansPoseComposition() [1/2]

static void mrpt::poses::CPosePDF::jacobiansPoseComposition ( const CPose2D x,
const CPose2D u,
mrpt::math::CMatrixDouble33 df_dx,
mrpt::math::CMatrixDouble33 df_du,
const bool  compute_df_dx = true,
const bool  compute_df_du = true 
)
staticinherited

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

df_dx =
[ 1, 0, -sin(phi_x)*x_u-cos(phi_x)*y_u ]
[ 0, 1, cos(phi_x)*x_u-sin(phi_x)*y_u ]
[ 0, 0, 1 ]
df_du =
[ cos(phi_x) , -sin(phi_x) , 0 ]
[ sin(phi_x) , cos(phi_x) , 0 ]
[ 0 , 0 , 1 ]

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

◆ jacobiansPoseComposition() [2/2]

static void mrpt::poses::CPosePDF::jacobiansPoseComposition ( const CPosePDFGaussian x,
const CPosePDFGaussian u,
mrpt::math::CMatrixDouble33 df_dx,
mrpt::math::CMatrixDouble33 df_du 
)
staticinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ mergeModes()

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:

  • "Kullback-Leibler Approach to Gaussian Mixture Reduction" AR Runnalls. IEEE Transactions on Aerospace and Electronic Systems, 2007.
Parameters
max_KLdThe maximum KL-divergence to consider the merge of two nodes (and then stops the process).

◆ normalizeWeights()

void mrpt::poses::CPosePDFSOG::normalizeWeights ( )

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

◆ operator+=()

void mrpt::poses::CPosePDFSOG::operator+= ( const mrpt::poses::CPose2D Ap)

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

◆ operator[]() [1/2]

TGaussianMode & mrpt::poses::CPosePDFSOG::operator[] ( size_t  i)
inline

Access to individual beacons.

Definition at line 89 of file CPosePDFSOG.h.

References ASSERT_.

◆ operator[]() [2/2]

const TGaussianMode & mrpt::poses::CPosePDFSOG::operator[] ( size_t  i) const
inline

Access to individual beacons.

Definition at line 84 of file CPosePDFSOG.h.

References ASSERT_.

◆ push_back()

void mrpt::poses::CPosePDFSOG::push_back ( const TGaussianMode m)
inline

Inserts a copy of the given mode into the SOG.

Definition at line 106 of file CPosePDFSOG.h.

◆ readFromStream()

void mrpt::poses::CPosePDFSOG::readFromStream ( mrpt::utils::CStream in,
int  version 
)
protected

◆ resize()

void mrpt::poses::CPosePDFSOG::resize ( const size_t  N)

Resize the number of SOG modes.

◆ rotateAllCovariances()

void mrpt::poses::CPosePDFSOG::rotateAllCovariances ( const double &  ang)

Rotate all the covariance matrixes by replacing them by $ \mathbf{R}~\mathbf{COV}~\mathbf{R}^t $, where $ \mathbf{R} = \left[ \begin{array}{ccc} \cos\alpha & -\sin\alpha & 0 \\ \sin\alpha & \cos\alpha & 0 \\ 0 & 0 & 1 \end{array}\right] $.

◆ saveToTextFile()

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:

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

Implements mrpt::utils::CProbabilityDensityFunction< CPose2D, 3 >.

◆ size()

size_t mrpt::poses::CPosePDFSOG::size ( ) const
inline

Return the number of Gaussian modes.

Definition at line 77 of file CPosePDFSOG.h.

◆ writeToStream()

void mrpt::poses::CPosePDFSOG::writeToStream ( mrpt::utils::CStream out,
int *  getVersion 
) const
protected

Member Data Documentation

◆ _init_CPosePDFSOG

mrpt::utils::CLASSINIT mrpt::poses::CPosePDFSOG::_init_CPosePDFSOG
staticprotected

Definition at line 39 of file CPosePDFSOG.h.

◆ classCPosePDF

const mrpt::utils::TRuntimeClassId mrpt::poses::CPosePDF::classCPosePDF
staticinherited

Definition at line 41 of file CPosePDF.h.

◆ classCPosePDFSOG

mrpt::utils::TRuntimeClassId mrpt::poses::CPosePDFSOG::classCPosePDFSOG
static

Definition at line 39 of file CPosePDFSOG.h.

◆ classinfo

const mrpt::utils::TRuntimeClassId* mrpt::poses::CPosePDFSOG::classinfo
static

Definition at line 39 of file CPosePDFSOG.h.

◆ m_modes

CListGaussianModes mrpt::poses::CPosePDFSOG::m_modes
protected

The list of SOG modes.

Definition at line 70 of file CPosePDFSOG.h.

◆ state_length

const size_t mrpt::utils::CProbabilityDensityFunction< CPose2D , STATE_LEN >::state_length
staticinherited

The length of the variable, for example, 3 for a 3D point, 6 for a 3D pose (x y z yaw pitch roll).

Definition at line 31 of file CProbabilityDensityFunction.h.




Page generated by Doxygen 1.9.7 for MRPT 1.4.0 SVN: at Tue Jun 13 14:10:35 UTC 2023