100 in >>
c;
cov =
c.cast<
double>();
115 if (
this == &o)
return;
171 x1(0,0) = p1.
mean.
x(); x1(1,0) = p1.
mean.
y(); x1(2,0) = p1.
mean.z();
172 x2(0,0) = p2.
mean.
x(); x2(1,0) = p2.
mean.
y(); x2(2,0) = p2.
mean.z();
175 C = (C1_inv + C2_inv).
inv();
178 x = C * ( C1_inv*x1 + C2_inv*x2 );
209 MU.get_unsafe(0,0) =
mean.
x() -
p.mean.x();
210 MU.get_unsafe(1,0) =
mean.
y() -
p.mean.y();
211 MU.get_unsafe(2,0) =
mean.z() -
p.mean.z();
214 * (1.0/std::sqrt( C.det() ))
215 * exp( -0.5* MU.multiply_HtCH_scalar(C_inv) );
234 C+=
p.cov.block(0,0,2,2);
240 MU.get_unsafe(0,0) =
mean.
x() -
p.mean.x();
241 MU.get_unsafe(1,0) =
mean.
y() -
p.mean.y();
244 * (1.0/std::sqrt( C.det() ))
245 * exp( -0.5* MU.multiply_HtCH_scalar(C_inv) );
277 outSample.
x(
mean.
x() + vec[0] );
278 outSample.
y(
mean.
y() + vec[1] );
279 outSample.z(
mean.z() + vec[2] );
308 deltaX.get_unsafe(0,0) = other.
mean.
x() -
mean.
x();
309 deltaX.get_unsafe(0,1) = other.
mean.
y() -
mean.
y();
310 deltaX.get_unsafe(0,2) = other.
mean.z() -
mean.z();
320 return sqrt( deltaX.multiply_HCHt_scalar(COV_inv) );
328 return std::sqrt( deltaX2.multiply_HCHt_scalar(COV_inv) );
A namespace of pseudo-random numbers genrators of diferent distributions.
double x() const
Common members of all points & poses classes.
FILE BASE_IMPEXP * fopen(const char *fileName, const char *mode) MRPT_NO_THROWS
An OS-independent version of fopen.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation...
int BASE_IMPEXP void BASE_IMPEXP fclose(FILE *f)
An OS-independent version of fclose.
void saveToTextFile(const std::string &file) const MRPT_OVERRIDE
Save PDF's particles to a text file, containing the 2D pose in the first line, then the covariance ma...
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
CPoint3D mean
The mean value.
#define THROW_EXCEPTION(msg)
BASE_IMPEXP CRandomGenerator randomGenerator
A static instance of a CRandomGenerator class, for use in single-thread applications.
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction...
int BASE_IMPEXP fprintf(FILE *fil, const char *format,...) MRPT_NO_THROWS MRPT_printf_format_check(2
An OS-independent version of fprintf.
void copyFrom(const CPointPDF &o) MRPT_OVERRIDE
Copy operator, translating if necesary (for example, between particles and gaussian representations) ...
T square(const T x)
Inline function for the square of a number.
void bayesianFusion(const CPointPDFGaussian &p1, const CPointPDFGaussian &p2)
Bayesian fusion of two points gauss.
void readFromStream(mrpt::utils::CStream &in, int version)
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
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.
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
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...
double productIntegralNormalizedWith(const CPointPDFGaussian &p) const
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the int...
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
mrpt::math::CMatrixDouble33 cov
The 3x3 covariance matrix.
void getCovarianceAndMean(mrpt::math::CMatrixDouble33 &cov, CPoint3D &mean_point) const MRPT_OVERRIDE
Returns an estimate of the point covariance matrix (3x3 cov matrix) and the mean, both at once...
CMatrixFixedNumeric< double, 3, 3 > CMatrixDouble33
GLsizei const GLchar ** string
A class used to store a 3D point.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
#define CLASS_ID(class_name)
Access to runtime class ID for a defined class name.
double productIntegralNormalizedWith2D(const CPointPDFGaussian &p) const
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the int...
void getMean(CPoint3D &p) const MRPT_OVERRIDE
Returns an estimate of the point, (the mean, or mathematical expectation of the PDF) ...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
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...
This file implements matrix/vector text and binary serialization.
double productIntegralWith(const CPointPDFGaussian &p) const
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the int...
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const
Introduces a pure virtual method responsible for writing to a CStream.
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)...
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...
void drawSingleSample(CPoint3D &outSample) const MRPT_OVERRIDE
Draw a sample from the pdf.
void drawGaussianMultivariate(std::vector< T > &out_result, const mrpt::math::CMatrixTemplateNumeric< T > &cov, const std::vector< T > *mean=NULL)
Generate multidimensional random samples according to a given covariance matrix.
void getRotationMatrix(mrpt::math::CMatrixDouble33 &ROT) const
Get the 3x3 rotation matrix.
This class is a "CSerializable" wrapper for "CMatrixFloat".
Declares a class that represents a Probability Distribution function (PDF) of a 3D point (x...
CPointPDFGaussian()
Default constructor.
void changeCoordinatesReference(const CPose3D &newReferenceBase) MRPT_OVERRIDE
this = p (+) this.
double productIntegralWith2D(const CPointPDFGaussian &p) const
Computes the "correspondence likelihood" of this PDF with another one: This is implemented as the int...
EIGEN_STRONG_INLINE double mean() const
Computes the mean of the entire matrix.
A gaussian distribution for 3D points.
EIGEN_STRONG_INLINE PlainObject inv() const