Main MRPT website > C++ reference
MRPT logo
Public Member Functions

mrpt::poses::CPose3DPDFParticles Class Reference


Detailed Description

Declares a class that represents a Probability Density function (PDF) of a 3D pose.

This class is also the base for the implementation of Monte-Carlo Localization (MCL), in mrpt::slam::CMonteCarloLocalization2D.

See the application "app/pf-localization" for an example of usage.

See also:
CPose3D, CPose3DPDF, CPoseGaussianPDF

Definition at line 59 of file CPose3DPDFParticles.h.

#include <mrpt/poses/CPose3DPDFParticles.h>

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

List of all members.

Public Member Functions

 CPose3DPDFParticles (size_t M=1)
 Constructor.
 CPose3DPDFParticles (const CPose3DPDFParticles &obj)
 Copy constructor:
virtual ~CPose3DPDFParticles ()
 Destructor.
void copyFrom (const CPose3DPDF &o)
 Copy operator, translating if necesary (for example, between m_particles and gaussian representations)
void resetDeterministic (const CPose3D &location, size_t particlesCount=0)
 Reset the PDF to a single point: All m_particles will be set exactly to the supplied pose.
void getMean (CPose3D &mean_pose) const
 Returns an estimate of the pose, (the mean, or mathematical expectation of the PDF), computed as a weighted average over all m_particles.
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.
CPose3D getParticlePose (int i) const
 Returns the pose of the i'th particle.
void saveToTextFile (const std::string &file) const
 Save PDF's m_particles to a text file.
size_t size () const
 Get the m_particles count (equivalent to "particlesCount")
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 (WARNING: weights are assumed to be normalized!)
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 operator+= (const CPose3D &Ap)
 Appends (pose-composition) a given pose "p" to each particle.
void append (CPose3DPDFParticles &o)
 Appends (add to the list) a set of m_particles to the existing ones, and then normalize weights.
void inverse (CPose3DPDF &o) const
 Returns a new PDF such as: NEW_PDF = (0,0,0) - THIS_PDF.
CPose3D getMostLikelyParticle () const
 Returns the particle with the highest weight.
void bayesianFusion (const CPose3DPDF &p1, const CPose3DPDF &p2)
 Bayesian fusion.

RTTI stuff

typedef CPose3DPDFParticlesPtr SmartPtr
static mrpt::utils::CLASSINIT _init_CPose3DPDFParticles
static mrpt::utils::TRuntimeClassId classCPose3DPDFParticles
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 CPose3DPDFParticlesPtr Create ()

Member Typedef Documentation

A typedef for the associated smart pointer

Definition at line 65 of file CPose3DPDFParticles.h.


Constructor & Destructor Documentation

mrpt::poses::CPose3DPDFParticles::CPose3DPDFParticles ( size_t  M = 1)

Constructor.

Parameters:
MThe number of m_particles.
mrpt::poses::CPose3DPDFParticles::CPose3DPDFParticles ( const CPose3DPDFParticles obj) [inline]

Copy constructor:

Definition at line 78 of file CPose3DPDFParticles.h.

virtual mrpt::poses::CPose3DPDFParticles::~CPose3DPDFParticles ( ) [virtual]

Destructor.


Member Function Documentation

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

Reimplemented from mrpt::poses::CPose3DPDF.

void mrpt::poses::CPose3DPDFParticles::append ( CPose3DPDFParticles o)

Appends (add to the list) a set of m_particles to the existing ones, and then normalize weights.

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

Bayesian fusion.

Implements mrpt::poses::CPose3DPDF.

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

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

Implements mrpt::poses::CPose3DPDF.

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

Draws a single sample from the distribution (WARNING: weights are assumed to be normalized!)

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

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

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

Implements mrpt::utils::CObject.

void mrpt::poses::CPose3DPDFParticles::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::CPose3DPDFParticles::getMean ( CPose3D mean_pose) const [virtual]

Returns an estimate of the pose, (the mean, or mathematical expectation of the PDF), computed as a weighted average over all m_particles.

See also:
getCovariance

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

CPose3D mrpt::poses::CPose3DPDFParticles::getMostLikelyParticle ( ) const

Returns the particle with the highest weight.

Reimplemented from mrpt::bayes::CParticleFilterData< CPose3D >.

CPose3D mrpt::poses::CPose3DPDFParticles::getParticlePose ( int  i) const

Returns the pose of the i'th particle.

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

Returns information about the class of an object in runtime.

Reimplemented from mrpt::poses::CPose3DPDF.

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

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

Implements mrpt::poses::CPose3DPDF.

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

Appends (pose-composition) a given pose "p" to each particle.

void mrpt::poses::CPose3DPDFParticles::resetDeterministic ( const CPose3D location,
size_t  particlesCount = 0 
)

Reset the PDF to a single point: All m_particles will be set exactly to the supplied pose.

Parameters:
locationThe location to set all the m_particles.
particlesCountIf this is set to 0 the number of m_particles remains unchanged.
See also:
resetUniform, resetUniformFreeSpace
void mrpt::poses::CPose3DPDFParticles::saveToTextFile ( const std::string &  file) const [virtual]

Save PDF's m_particles to a text file.

In each line it will go: "x y z"

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

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

Get the m_particles count (equivalent to "particlesCount")

Definition at line 122 of file CPose3DPDFParticles.h.


Member Data Documentation

Definition at line 65 of file CPose3DPDFParticles.h.

Definition at line 65 of file CPose3DPDFParticles.h.

Definition at line 65 of file CPose3DPDFParticles.h.




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