Class CPointPDFParticles

Inheritance Relationships

Base Types

  • public mrpt::poses::CPointPDF (Class CPointPDF)

  • public mrpt::bayes::CParticleFilterData< mrpt::math::TPoint3Df >

  • public mrpt::bayes::CParticleFilterDataImpl< CPointPDFParticles, mrpt::bayes::CParticleFilterData< mrpt::math::TPoint3Df >::CParticleList >

Class Documentation

class CPointPDFParticles : public mrpt::poses::CPointPDF, public mrpt::bayes::CParticleFilterData<mrpt::math::TPoint3Df>, public mrpt::bayes::CParticleFilterDataImpl<CPointPDFParticles, mrpt::bayes::CParticleFilterData<mrpt::math::TPoint3Df>::CParticleList>

A probability distribution of a 2D/3D point, represented as a set of random samples (particles).

See also

CPointPDF

Public Functions

CPointPDFParticles(size_t numParticles = 1)

Default constructor

void clear()

Clear all the particles (free memory)

void setSize(size_t numberParticles, const mrpt::math::TPoint3Df &defaultValue = mrpt::math::TPoint3Df{0, 0, 0})

Erase all the previous particles and change the number of particles, with a given initial value

inline size_t size() const

Returns the number of particles

void getMean(CPoint3D &mean_point) const override
std::tuple<cov_mat_t, type_value> getCovarianceAndMean() const override
virtual void copyFrom(const CPointPDF &o) override

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

bool saveToTextFile(const std::string &file) const override

Save PDF’s particles to a text file, where each line is: X Y Z LOG_W

virtual void changeCoordinatesReference(const CPose3D &newReferenceBase) override

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. Both the mean value and the covariance matrix are updated correctly.

double computeKurtosis()

Compute the kurtosis of the distribution

void drawSingleSample(CPoint3D &outSample) const override

Draw a sample from the pdf

virtual void bayesianFusion(const CPointPDF &p1, const CPointPDF &p2, const double minMahalanobisDistToDrop = 0) override

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.