9 #ifndef CPosePDFParticles_H 10 #define CPosePDFParticles_H 34 mrpt::math::TPose2D, mrpt::bayes::particle_storage_mode::VALUE>,
37 mrpt::bayes::CParticleFilterData<
39 mrpt::bayes::particle_storage_mode::VALUE>::CParticleList>
75 const double x_min,
const double x_max,
const double y_min,
76 const double y_max,
const double phi_min = -
M_PI,
96 const std::vector<mrpt::math::TPose2D>& list_poses,
97 const size_t num_particles_per_pose,
const double spread_x,
98 const double spread_y,
const double spread_phi_rad);
158 const double minMahalanobisDistToDrop = 0)
override;
165 const double x,
const double y,
const double phi,
166 const double stdXY,
const double stdPhi)
const;
173 const char* fileName,
const double x_min,
const double x_max,
174 const double y_min,
const double y_max,
const double phi,
175 const double stepSizeXY,
const double stdXY,
const double stdPhi)
const;
bool saveToTextFile(const std::string &file) const override
Save PDF's m_particles to a text file.
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.
CParticleList m_particles
The array of particles.
CPosePDFParticles(size_t M=1)
Constructor.
void inverse(CPosePDF &o) const override
Returns a new PDF such as: NEW_PDF = (0,0,0) - THIS_PDF.
void operator+=(const mrpt::math::TPose2D &Ap)
Appends (pose-composition) a given pose "p" to each particle.
void getCovarianceAndMean(mrpt::math::CMatrixDouble33 &cov, CPose2D &mean_point) const override
Returns an estimate of the pose covariance matrix (3x3 cov matrix) and the mean, both at once...
void clear()
Free all the memory associated to m_particles, and set the number of parts = 0.
void resetDeterministic(const mrpt::math::TPose2D &location, size_t particlesCount=0)
Reset the PDF to a single point: All m_particles will be set exactly to the supplied pose...
size_t particlesCount() const override
void drawSingleSample(CPose2D &outPart) const override
Draws a single sample from the distribution (WARNING: weights are assumed to be normalized!) ...
void getMean(CPose2D &mean_pose) const override
Returns an estimate of the pose, (the mean, or mathematical expectation of the PDF).
void copyFrom(const CPosePDF &o) override
Copy operator, translating if necesary (for example, between m_particles and gaussian representations...
mrpt::math::TPose2D getMostLikelyParticle() const
Returns the particle with the highest weight.
void saveParzenPDFToTextFile(const char *fileName, const double x_min, const double x_max, const double y_min, const double y_max, const double phi, const double stepSizeXY, const double stdXY, const double stdPhi) const
Save a text file (compatible with matlab) representing the 2D evaluation of the PDF as reconstructed ...
Declares a class that represents a Probability Density Function (PDF) over a 2D pose (x...
double evaluatePDF_parzen(const double x, const double y, const double phi, const double stdXY, const double stdPhi) const
Evaluates the PDF at a given arbitrary point as reconstructed by a Parzen window. ...
GLsizei const GLchar ** string
This template class declares the array of particles and its internal data, managing some memory-relat...
Declares a class that represents a probability density function (pdf) of a 2D pose (x...
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
void resetAroundSetOfPoses(const std::vector< mrpt::math::TPose2D > &list_poses, const size_t num_particles_per_pose, const double spread_x, const double spread_y, const double spread_phi_rad)
Reset the PDF to a multimodal distribution over a set of "spots" (x,y,phi) The total number of partic...
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
size_t size() const
Get the m_particles count (equivalent to "particlesCount")
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
mrpt::math::TPose2D getParticlePose(size_t i) const
Returns the pose of the i'th particle.
void append(CPosePDFParticles &o)
Appends (add to the list) a set of m_particles to the existing ones, and then normalize weights...
void bayesianFusion(const CPosePDF &p1, const CPosePDF &p2, const double minMahalanobisDistToDrop=0) override
Bayesian fusion.
Eigen::Matrix< typename MATRIX::Scalar, MATRIX::ColsAtCompileTime, MATRIX::ColsAtCompileTime > cov(const MATRIX &v)
Computes the covariance matrix from a list of samples in an NxM matrix, where each row is a sample...
void changeCoordinatesReference(const CPose3D &newReferenceBase) override
this = p (+) this.
A curiously recurring template pattern (CRTP) approach to providing the basic functionality of any CP...