9 #ifndef CPosePDFParticles_H 10 #define CPosePDFParticles_H 36 mrpt::bayes::CParticleFilterData<CPose2D>::CParticleList>
71 const double& x_min,
const double& x_max,
const double& y_min,
72 const double& y_max,
const double& phi_min = -
M_PI,
92 const std::vector<mrpt::math::TPose2D>& list_poses,
93 const size_t num_particles_per_pose,
const double spread_x,
94 const double spread_y,
const double spread_phi_rad);
154 const double& minMahalanobisDistToDrop = 0)
override;
161 const double&
x,
const double&
y,
const double& phi,
162 const double& stdXY,
const double& stdPhi)
const;
169 const char* fileName,
const double& x_min,
const double& x_max,
170 const double& y_min,
const double& y_max,
const double& phi,
171 const double& stepSizeXY,
const double& stdXY,
172 const double& stdPhi)
const;
CPose2D getParticlePose(size_t i) const
Returns the pose of the i'th particle.
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 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 bayesianFusion(const CPosePDF &p1, const CPosePDF &p2, const double &minMahalanobisDistToDrop=0) override
Bayesian fusion.
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 ...
void clear()
Free all the memory associated to m_particles, and set the number of parts = 0.
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!) ...
CParticleList m_particles
The array of particles.
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...
void operator+=(const CPose2D &Ap)
Appends (pose-composition) a given pose "p" to each particle.
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.
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. ...
Declares a class that represents a Probability Density Function (PDF) over a 2D pose (x...
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...
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...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#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).
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...
void append(CPosePDFParticles &o)
Appends (add to the list) a set of m_particles to the existing ones, and then normalize weights...
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...
CPose2D getMostLikelyParticle() const
Returns the particle with the highest weight.
void saveToTextFile(const std::string &file) const override
Save PDF's m_particles to a text file.
void changeCoordinatesReference(const CPose3D &newReferenceBase) override
this = p (+) this.
A curiously recurring template pattern (CRTP) approach to providing the basic functionality of any CP...