38 :
mean(init_Mean),
cov(init_Cov)
72 if (
this == &o)
return;
102 const CPose3D& newReferenceBase)
112 cov = M *
cov * M.transpose();
134 const Eigen::Vector2d x1{p1.
mean.
x(), p1.
mean.
y()};
135 const Eigen::Vector2d x2{p2.
mean.
x(), p2.
mean.
y()};
138 mean.
x(
x.get_unsafe(0, 0));
139 mean.
y(
x.get_unsafe(1, 0));
163 MU.get_unsafe(0, 0) =
mean.
x() -
p.mean.x();
164 MU.get_unsafe(1, 0) =
mean.
y() -
p.mean.y();
167 exp(-0.5 * MU.multiply_HtCH_scalar(C_inv));
194 outSample.
x(
mean.
x() + vec[0]);
195 outSample.
y(
mean.
y() + vec[1]);
205 const double minMahalanobisDistToDrop)
226 Eigen::Matrix<double, 2, 1> deltaX;
232 deltaX.multiply_HtCH_scalar((other.
cov + this->cov).inverse()));
237 const double x,
const double y)
const
240 Eigen::Matrix<double, 2, 1> deltaX;
245 return std::sqrt(deltaX.multiply_HtCH_scalar(this->cov.inverse()));
#define CLASS_ID(T)
Access to runtime class ID for a defined class name.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
A numeric matrix of compile-time fixed size.
virtual void getCovarianceAndMean(mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &cov, TDATA &mean_point) const =0
Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean,...
static constexpr size_t state_length
The length of the variable, for example, 3 for a 3D point, 6 for a 3D pose (x y z yaw pitch roll).
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction.
A class used to store a 2D point.
A gaussian distribution for 2D points.
CPoint2DPDFGaussian()
Default constructor.
void changeCoordinatesReference(const CPose3D &newReferenceBase) override
this = p (+) this.
void bayesianFusion(const CPoint2DPDFGaussian &p1, const CPoint2DPDFGaussian &p2)
Bayesian fusion of two points gauss.
double productIntegralWith(const CPoint2DPDFGaussian &p) const
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the int...
void drawSingleSample(CPoint2D &outSample) const override
Draw a sample from the pdf.
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
CPoint2D mean
The mean value.
double mahalanobisDistanceTo(const CPoint2DPDFGaussian &other) const
Returns the Mahalanobis distance from this PDF to another PDF, that is, it's evaluation at (0,...
mrpt::math::CMatrixDouble22 cov
The 2x2 covariance matrix.
void copyFrom(const CPoint2DPDF &o) override
Copy operator, translating if necesary (for example, between particles and gaussian representations)
double mahalanobisDistanceToPoint(const double x, const double y) const
Returns the Mahalanobis distance from this PDF to some point.
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
bool saveToTextFile(const std::string &file) const override
Save PDF's particles to a text file, containing the 2D pose in the first line, then the covariance ma...
double productIntegralNormalizedWith(const CPoint2DPDFGaussian &p) const
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the int...
Declares a class that represents a Probability Distribution function (PDF) of a 2D point (x,...
virtual const mrpt::rtti::TRuntimeClassId * GetRuntimeClass() const override
Returns information about the class of an object in runtime.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
void getRotationMatrix(mrpt::math::CMatrixDouble33 &ROT) const
Get the 3x3 rotation matrix.
double x() const
Common members of all points & poses classes.
void drawGaussianMultivariate(std::vector< T > &out_result, const MATRIX &cov, const std::vector< T > *mean=nullptr)
Generate multidimensional random samples according to a given covariance matrix.
Virtual base class for "archives": classes abstracting I/O streams.
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.
EIGEN_STRONG_INLINE double mean() const
Computes the mean of the entire matrix.
#define ASSERT_(f)
Defines an assertion mechanism.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
#define THROW_EXCEPTION(msg)
GLsizei const GLchar ** string
int void fclose(FILE *f)
An OS-independent version of fclose.
FILE * fopen(const char *fileName, const char *mode) noexcept
An OS-independent version of fopen.
int fprintf(FILE *fil, const char *format,...) noexcept MRPT_printf_format_check(2
An OS-independent version of fprintf.
This file implements matrix/vector text and binary serialization.
This base provides a set of functions for maths stuff.
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,...
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
A namespace of pseudo-random numbers generators of diferent distributions.
CRandomGenerator & getRandomGenerator()
A static instance of a CRandomGenerator class, for use in single-thread applications.
T square(const T x)
Inline function for the square of a number.