Go to the documentation of this file.
36 :
mean(init_Mean),
cov(init_Cov)
81 cov =
c.cast<
double>();
96 if (
this == &o)
return;
109 if (!f)
return false;
123 const CPose3D& newReferenceBase)
149 x1(0, 0) = p1.
mean.
x();
150 x1(1, 0) = p1.
mean.
y();
151 x1(2, 0) = p1.
mean.z();
152 x2(0, 0) = p2.
mean.
x();
153 x2(1, 0) = p2.
mean.
y();
154 x2(2, 0) = p2.
mean.z();
156 C = (C1_inv + C2_inv).
inv();
159 x = C * (C1_inv * x1 + C2_inv * x2);
191 MU.get_unsafe(0, 0) =
mean.
x() -
p.mean.x();
192 MU.get_unsafe(1, 0) =
mean.
y() -
p.mean.y();
193 MU.get_unsafe(2, 0) =
mean.z() -
p.mean.z();
196 exp(-0.5 * MU.multiply_HtCH_scalar(C_inv));
216 C +=
p.cov.block(0, 0, 2, 2);
222 MU.get_unsafe(0, 0) =
mean.
x() -
p.mean.x();
223 MU.get_unsafe(1, 0) =
mean.
y() -
p.mean.y();
226 (1.0 / std::sqrt(C.det())) *
227 exp(-0.5 * MU.multiply_HtCH_scalar(C_inv));
261 outSample.
x(
mean.
x() + vec[0]);
262 outSample.
y(
mean.
y() + vec[1]);
263 outSample.z(
mean.z() + vec[2]);
273 const double minMahalanobisDistToDrop)
295 deltaX.get_unsafe(0, 0) = other.
mean.
x() -
mean.
x();
296 deltaX.get_unsafe(0, 1) = other.
mean.
y() -
mean.
y();
297 deltaX.get_unsafe(0, 2) = other.
mean.z() -
mean.z();
307 return sqrt(deltaX.multiply_HCHt_scalar(COV_inv));
315 return std::sqrt(deltaX2.multiply_HCHt_scalar(COV_inv));
void copyFrom(const CPointPDF &o) override
Copy operator, translating if necesary (for example, between particles and gaussian representations)
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,...
int void fclose(FILE *f)
An OS-independent version of fclose.
mrpt::math::CMatrixDouble33 cov
The 3x3 covariance matrix.
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction.
A gaussian distribution for 3D points.
double productIntegralNormalizedWith2D(const CPointPDFGaussian &p) const
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the int...
virtual const mrpt::rtti::TRuntimeClassId * GetRuntimeClass() const override
Returns information about the class of an object in runtime.
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.
double productIntegralWith2D(const CPointPDFGaussian &p) const
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the int...
CMatrixFixedNumeric< double, 3, 3 > CMatrixDouble33
void getRotationMatrix(mrpt::math::CMatrixDouble33 &ROT) const
Get the 3x3 rotation matrix.
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...
#define THROW_EXCEPTION(msg)
#define ASSERT_(f)
Defines an assertion mechanism.
T square(const T x)
Inline function for the square of a number.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
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,...
Virtual base class for "archives": classes abstracting I/O streams.
void bayesianFusion(const CPointPDFGaussian &p1, const CPointPDFGaussian &p2)
Bayesian fusion of two points gauss.
void drawSingleSample(CPoint3D &outSample) const override
Draw a sample from the pdf.
This class is a "CSerializable" wrapper for "CMatrixFloat".
double x() const
Common members of all points & poses classes.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
static const 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).
void getMean(CPoint3D &p) const override
Returns an estimate of the point, (the mean, or mathematical expectation of the PDF)
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
void changeCoordinatesReference(const CPose3D &newReferenceBase) override
this = p (+) this.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
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.
double productIntegralWith(const CPointPDFGaussian &p) const
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the int...
double productIntegralNormalizedWith(const CPointPDFGaussian &p) const
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the int...
int fprintf(FILE *fil, const char *format,...) noexcept MRPT_printf_format_check(2
An OS-independent version of fprintf.
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
#define CLASS_ID(T)
Access to runtime class ID for a defined class name.
CRandomGenerator & getRandomGenerator()
A static instance of a CRandomGenerator class, for use in single-thread applications.
void getCovarianceAndMean(mrpt::math::CMatrixDouble33 &cov, CPoint3D &mean_point) const override
Returns an estimate of the point covariance matrix (3x3 cov matrix) and the mean, both at once.
EIGEN_STRONG_INLINE double mean() const
Computes the mean of the entire matrix.
EIGEN_STRONG_INLINE PlainObject inv() const
This base provides a set of functions for maths stuff.
FILE * fopen(const char *fileName, const char *mode) noexcept
An OS-independent version of fopen.
GLsizei const GLchar ** string
A namespace of pseudo-random numbers generators of diferent distributions.
Declares a class that represents a Probability Distribution function (PDF) of a 3D point (x,...
A class used to store a 3D point.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
CPoint3D mean
The mean value.
double mahalanobisDistanceTo(const CPointPDFGaussian &other, bool only_2D=false) const
Returns the Mahalanobis distance from this PDF to another PDF, that is, it's evaluation at (0,...
CPointPDFGaussian()
Default constructor.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |