70 void assureSymmetry();
81 size_t size()
const {
return m_modes.size(); }
82 bool empty()
const {
return m_modes.empty(); }
111 m_modes.push_back(m);
114 iterator
begin() {
return m_modes.begin(); }
115 iterator
end() {
return m_modes.end(); }
116 const_iterator
begin()
const {
return m_modes.begin(); }
117 const_iterator
end()
const {
return m_modes.end(); }
119 iterator
erase(iterator i) {
return m_modes.erase(i); }
121 void resize(
const size_t N);
129 void mergeModes(
double max_KLd = 0.5,
bool verbose =
false );
134 void getMean(
CPose2D &mean_pose)
const;
148 void normalizeWeights();
152 void copyFrom(
const CPosePDF &o);
173 void changeCoordinatesReference(
const CPose3D &newReferenceBase );
177 void rotateAllCovariances(
const double &ang);
181 void drawSingleSample(
CPose2D &outPart )
const;
185 void drawManySamples(
size_t N, std::vector<mrpt::math::CVectorDouble> & outSamples )
const;
189 void inverse(CPosePDF &o)
const;
205 void evaluatePDFInArea(
206 const double & x_min,
207 const double & x_max,
208 const double & y_min,
209 const double & y_max,
210 const double & resolutionXY,
213 bool sumOverAllPhis =
false );
217 void bayesianFusion(
const CPosePDF &p1,
const CPosePDF &p2,
const double &minMahalanobisDistToDrop=0 );
bool empty() const
Return whether there is any Gaussian mode.
This class is a "CSerializable" wrapper for "CMatrixTemplateNumeric".
const_iterator end() const
The struct for each mode:
Declares a class that represents a Probability Density function (PDF) of a 2D pose ...
#define MRPT_MAKE_ALIGNED_OPERATOR_NEW
void saveToTextFile(const std::string &file, mrpt::math::TMatrixTextFileFormat fileFormat=mrpt::math::MATRIX_FORMAT_ENG, bool appendMRPTHeader=false, const std::string &userHeader=std::string()) const
Save matrix to a text file, compatible with MATLAB text format (see also the methods of matrix classe...
const_iterator begin() const
mrpt::aligned_containers< TGaussianMode >::vector_t CListGaussianModes
const Scalar * const_iterator
void push_back(const TGaussianMode &m)
Inserts a copy of the given mode into the SOG.
A numeric matrix of compile-time fixed size.
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...
std::vector< T1 > & operator+=(std::vector< T1 > &a, const std::vector< T2 > &b)
a+=b (element-wise sum)
mrpt::math::CMatrixDouble33 cov
Eigen::Matrix< dataType, 4, 4 > inverse(Eigen::Matrix< dataType, 4, 4 > &pose)
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE(class_name, base_name)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
Declares a class that represents a probability density function (pdf) of a 2D pose (x...
size_t size() const
Return the number of Gaussian modes.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
iterator erase(iterator i)
A class used to store a 2D pose.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE(class_name, base_name)
CListGaussianModes::iterator iterator
EIGEN_STRONG_INLINE double mean() const
Computes the mean of the entire matrix.
double log_w
The log-weight.
std::vector< TYPE1, Eigen::aligned_allocator< TYPE1 > > vector_t
CListGaussianModes::const_iterator const_iterator
CListGaussianModes m_modes
The list of SOG modes.