9#ifndef CPosePDFParticles_H
10#define CPosePDFParticles_H
73 size_t particlesCount = 0);
84 const double & phi_min = -
M_PI,
85 const double & phi_max =
M_PI,
86 const int &particlesCount = -1);
108 inline size_t size()
const {
return m_particles.size(); }
142 double evaluatePDF_parzen(
146 const
double & stdXY,
147 const
double & stdPhi ) const;
152 void saveParzenPDFToTextFile(
153 const
char *fileName,
154 const
double & x_min,
155 const
double & x_max,
156 const
double & y_min,
157 const
double & y_max,
159 const
double & stepSizeXY,
160 const
double & stdXY,
161 const
double & stdPhi ) const;
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE(class_name, base_name)
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE(class_name, base_name)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
std::deque< CParticleData > CParticleList
Use this type to refer to the list of particles m_particles.
A numeric matrix of compile-time fixed size.
A class used to store a 2D pose.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Declares a class that represents a probability density function (pdf) of a 2D pose (x,...
Declares a class that represents a Probability Density Function (PDF) over a 2D pose (x,...
void append(CPosePDFParticles &o)
Appends (add to the list) a set of m_particles to the existing ones, and then normalize weights.
void drawSingleSample(CPose2D &outPart) const MRPT_OVERRIDE
Draws a single sample from the distribution (WARNING: weights are assumed to be normalized!...
CPosePDFParticles(size_t M=1)
Constructor.
void copyFrom(const CPosePDF &o) MRPT_OVERRIDE
Copy operator, translating if necesary (for example, between m_particles and gaussian representations...
void inverse(CPosePDF &o) const MRPT_OVERRIDE
Returns a new PDF such as: NEW_PDF = (0,0,0) - THIS_PDF.
void resetDeterministic(const CPose2D &location, size_t particlesCount=0)
Reset the PDF to a single point: All m_particles will be set exactly to the supplied pose.
CPose2D getMostLikelyParticle() const
Returns the particle with the highest weight.
void saveToTextFile(const std::string &file) const MRPT_OVERRIDE
Save PDF's m_particles to a text file.
CPosePDFParticles(const CPosePDFParticles &obj)
Copy constructor:
void bayesianFusion(const CPosePDF &p1, const CPosePDF &p2, const double &minMahalanobisDistToDrop=0) MRPT_OVERRIDE
Bayesian fusion.
CPose2D getParticlePose(size_t i) const
Returns the pose of the i'th particle.
virtual ~CPosePDFParticles()
Destructor.
void clear()
Free all the memory associated to m_particles, and set the number of parts = 0.
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.
size_t size() const
Get the m_particles count (equivalent to "particlesCount")
void changeCoordinatesReference(const CPose3D &newReferenceBase) MRPT_OVERRIDE
this = p (+) this.
void getMean(CPose2D &mean_pose) const MRPT_OVERRIDE
Returns an estimate of the pose, (the mean, or mathematical expectation of the PDF).
void resetUniform(const double &x_min, const double &x_max, const double &y_min, const double &y_max, const double &phi_min=-M_PI, const double &phi_max=M_PI, const int &particlesCount=-1)
Reset the PDF to an uniformly distributed one, inside of the defined cube.
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.