9 #ifndef CPose3DPDFSOG_H
10 #define CPose3DPDFSOG_H
79 size_t size()
const {
return m_modes.size(); }
80 bool empty()
const {
return m_modes.empty(); }
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE(class_name, base_name)
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE(class_name, base_name)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
A numeric matrix of compile-time fixed size.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Declares a class that represents a Probability Density function (PDF) of a 3D pose .
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(6D) pose .
void saveToTextFile(const std::string &file) const MRPT_OVERRIDE
Save the density to a text file, with the following format: There is one row per Gaussian "mode",...
void assureSymmetry()
Assures the symmetry of the covariance matrix (eventually certain operations in the math-coprocessor ...
void copyFrom(const CPose3DPDF &o) MRPT_OVERRIDE
Copy operator, translating if necesary (for example, between particles and gaussian representations)
void getCovarianceAndMean(mrpt::math::CMatrixDouble66 &cov, CPose3D &mean_point) const MRPT_OVERRIDE
Returns an estimate of the pose covariance matrix (6x6 cov matrix) and the mean, both at once.
TModesList::iterator iterator
const_iterator begin() const
void clear()
Clear all the gaussian modes.
void bayesianFusion(const CPose3DPDF &p1, const CPose3DPDF &p2) MRPT_OVERRIDE
Bayesian fusion of two pose distributions, then save the result in this object (WARNING: Currently p1...
void resize(const size_t N)
Set the number of SOG modes.
TModesList::const_iterator const_iterator
void normalizeWeights()
Normalize the weights in m_modes such as the maximum log-weight is 0.
CPose3DPDFSOG(size_t nModes=1)
Default constructor.
const_iterator end() const
bool empty() const
Return whether there is any Gaussian mode.
TModesList m_modes
Access directly to this array for modify the modes as desired.
void inverse(CPose3DPDF &o) const MRPT_OVERRIDE
Returns a new PDF such as: NEW_PDF = (0,0,0) - THIS_PDF.
mrpt::aligned_containers< TGaussianMode >::vector_t TModesList
void getMostLikelyMode(CPose3DPDFGaussian &outVal) const
Return the Gaussian mode with the highest likelihood (or an empty Gaussian if there are no modes in t...
void drawSingleSample(CPose3D &outPart) const MRPT_OVERRIDE
Draws a single sample from the distribution.
void changeCoordinatesReference(const CPose3D &newReferenceBase) MRPT_OVERRIDE
this = p (+) this.
void drawManySamples(size_t N, std::vector< mrpt::math::CVectorDouble > &outSamples) const MRPT_OVERRIDE
Draws a number of samples from the distribution, and saves as a list of 1x6 vectors,...
void getMean(CPose3D &mean_pose) const MRPT_OVERRIDE
Returns an estimate of the pose, (the mean, or mathematical expectation of the PDF),...
void appendFrom(const CPose3DPDFSOG &o)
Append the Gaussian modes from "o" to the current set of modes of "this" density.
size_t size() const
Return the number of Gaussian modes.
const Scalar * const_iterator
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
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,...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
std::vector< TYPE1, Eigen::aligned_allocator< TYPE1 > > vector_t
The struct for each mode:
double log_w
The log-weight.