34 m_fastdraw_gauss_Z3(),
35 m_fastdraw_gauss_Z6(),
36 m_fastdraw_gauss_M_2D(),
37 m_fastdraw_gauss_M_3D()
63 if (
this == &o)
return *
this;
95 if (
this == &o)
return *
this;
153 D = D.array().sqrt().matrix();
198 D = D.array().sqrt().matrix();
241 else THROW_EXCEPTION(
"No associated pdf: setPosePDF must be called first.");
258 p.setFromValues(
q.x(),
q.y(),0,
q.phi(),0,0);
264 else THROW_EXCEPTION(
"No associated pdf: setPosePDF must be called first.");
287 for (
size_t i=0;i<3;i++)
290 for (
size_t d=0;d<3;d++)
338 for (
size_t i=0;i<6;i++)
341 for (
size_t d=0;d<6;d++)
A namespace of pseudo-random numbers genrators of diferent distributions.
CPose2D & getSamplingMean2D(CPose2D &out_mean) const
If the object has been loaded with setPosePDF this method returns the 2D pose mean samples will be dr...
double x() const
Common members of all points & poses classes.
~CPoseRandomSampler()
Dtor.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
CPose2D mean
The mean value.
CPose3D mean
The mean value.
Declares a class that represents a Probability Density function (PDF) of a 2D pose ...
void copyFrom(const CPose3DPDF &o) MRPT_OVERRIDE
Copy operator, translating if necesary (for example, between particles and gaussian representations) ...
CPoseRandomSampler()
Ctor.
#define THROW_EXCEPTION(msg)
GLdouble GLdouble GLdouble GLdouble q
BASE_IMPEXP CRandomGenerator randomGenerator
A static instance of a CRandomGenerator class, for use in single-thread applications.
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
Declares a class that represents a Probability Density function (PDF) of a 3D(6D) pose ...
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction...
double pitch() const
Get the PITCH angle (in radians)
double yaw() const
Get the YAW angle (in radians)
CPosePDF * m_pdf2D
A local copy of the PDF.
void getCovariance(mrpt::math::CMatrixDouble &cov) const
Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix) ...
bool isPrepared() const
Return true if samples can be generated, which only requires a previous call to setPosePDF.
mrpt::math::CMatrixDouble33 cov
The 3x3 covariance matrix.
double drawGaussian1D_normalized(double *likelihood=NULL)
Generate a normalized (mean=0, std=1) normally distributed sample.
void getOriginalPDFCov3D(mrpt::math::CMatrixDouble66 &cov6x6) const
Retrieves the 6x6 covariance of the original PDF in .
This base provides a set of functions for maths stuff.
virtual const mrpt::utils::TRuntimeClassId * GetRuntimeClass() const
Returns information about the class of an object in runtime.
CPose3D & getSamplingMean3D(CPose3D &out_mean) const
If the object has been loaded with setPosePDF this method returns the 3D pose mean samples will be dr...
void do_sample_3D(CPose3D &p) const
Used internally: sample from m_pdf3D.
Declares a class that represents a Probability Density function (PDF) of a 2D pose ...
void clear()
Clear internal pdf.
void setPosePDF(const CPosePDF *pdf)
This method must be called to select the PDF from which to draw samples.
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 getOriginalPDFCov2D(mrpt::math::CMatrixDouble33 &cov3x3) const
Retrieves the 3x3 covariance of the original PDF in .
void do_sample_2D(CPose2D &p) const
Used internally: sample from m_pdf2D.
CPose3D m_fastdraw_gauss_M_3D
mrpt::math::CMatrixDouble33 m_fastdraw_gauss_Z3
void drawSingleSample(CPose3D &outPart) const MRPT_OVERRIDE
Draws a single sample from the distribution (WARNING: weights are assumed to be normalized!) ...
Declares a class that represents a Probability Density Function (PDF) over a 2D pose (x...
Declares a class that represents a probability density function (pdf) of a 2D pose (x...
CPose3DPDF * m_pdf3D
A local copy of the PDF.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
double roll() const
Get the ROLL angle (in radians)
mrpt::math::CMatrixDouble66 cov
The 6x6 covariance matrix.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
virtual CObject * duplicate() const =0
Returns a copy of the object, indepently of its class.
void delete_safe(T *&ptr)
Calls "delete" to free an object only if the pointer is not NULL, then set the pointer to NULL...
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).
const double & phi() const
Get the phi angle of the 2D pose (in radians)
#define IS_CLASS(ptrObj, class_name)
Evaluates to true if the given pointer to an object (derived from mrpt::utils::CSerializable) is of t...
CPoseRandomSampler & operator=(const CPoseRandomSampler &o)
Declares a class that represents a Probability Density function (PDF) of a 3D pose ...
CPose2D m_fastdraw_gauss_M_2D
CPose2D & drawSample(CPose2D &p) const
Generate a new sample from the selected PDF.
mrpt::math::CMatrixDouble66 m_fastdraw_gauss_Z6
An efficient generator of random samples drawn from a given 2D (CPosePDF) or 3D (CPose3DPDF) pose pro...
Declares a class that represents a Probability Density Function (PDF) of a 3D pose (6D actually)...
Declares a class that represents a Probability Density function (PDF) of a 3D pose.
void copyFrom(const CPosePDF &o) MRPT_OVERRIDE
Copy operator, translating if necesary (for example, between particles and gaussian representations) ...
void drawSingleSample(CPose2D &outPart) const MRPT_OVERRIDE
Draws a single sample from the distribution (WARNING: weights are assumed to be normalized!) ...
virtual const mrpt::utils::TRuntimeClassId * GetRuntimeClass() const
Returns information about the class of an object in runtime.