Main MRPT website > C++ reference for MRPT 1.9.9
CPointPDF.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #ifndef CPointPDF_H
10 #define CPointPDF_H
11 
14 #include <mrpt/poses/CPoint3D.h>
15 #include <mrpt/poses/CPosePDF.h>
16 
17 namespace mrpt
18 {
19 namespace poses
20 {
21 /** Declares a class that represents a Probability Distribution
22  * function (PDF) of a 3D point (x,y,z).
23  * This class is just the base class for unifying many diferent
24  * ways this PDF can be implemented.
25  *
26  * For convenience, a pose composition is also defined for any
27  * PDF derived class, changeCoordinatesReference, in the form of a method
28  * rather than an operator.
29  *
30  * For a similar class for 6D poses (a 3D point with attitude), see CPose3DPDF
31  *
32  * See also the tutorial on <a
33  * href="http://www.mrpt.org/Probability_Density_Distributions_Over_Spatial_Representations">probabilistic
34  * spatial representations in the MRPT</a>.
35  *
36  * \sa CPoint3D
37  * \ingroup poses_pdf_grp
38  */
40  public mrpt::math::CProbabilityDensityFunction<CPoint3D, 3>
41 {
43 
44  public:
45  /** Copy operator, translating if necesary (for example, between particles
46  * and gaussian representations)
47  */
48  virtual void copyFrom(const CPointPDF& o) = 0;
49 
50  /** Bayesian fusion of two point distributions (product of two
51  * distributions->new distribution), then save the result in this object
52  * (WARNING: See implementing classes to see classes that can and cannot be
53  * mixtured!)
54  * \param p1 The first distribution to fuse
55  * \param p2 The second distribution to fuse
56  * \param minMahalanobisDistToDrop If set to different of 0, the result of
57  * very separate Gaussian modes (that will result in negligible components)
58  * in SOGs will be dropped to reduce the number of modes in the output.
59  */
60  virtual void bayesianFusion(
61  const CPointPDF& p1, const CPointPDF& p2,
62  const double minMahalanobisDistToDrop = 0) = 0;
63 
64  virtual void changeCoordinatesReference(
65  const CPose3D& newReferenceBase) = 0;
66 
67  enum
68  {
70  };
71  static inline bool is_3D() { return is_3D_val != 0; }
72  enum
73  {
75  };
76  static inline bool is_PDF() { return is_PDF_val != 0; }
77  /** Returns a 3D representation of this PDF (it doesn't clear the current
78  * contents of out_obj, but append new OpenGL objects to that list)
79  * \note Needs the mrpt-opengl library, and using
80  * mrpt::opengl::CSetOfObjects::Ptr as template argument.
81  * \note By default, ellipsoids for the confidence intervals of "q=3" are
82  * drawn; for more mathematical details, see
83  * CGeneralizedEllipsoidTemplate::setQuantiles()
84  */
85  template <class OPENGL_SETOFOBJECTSPTR>
86  inline void getAs3DObject(OPENGL_SETOFOBJECTSPTR& out_obj) const
87  {
88  using SETOFOBJECTS = typename OPENGL_SETOFOBJECTSPTR::element_type;
89  out_obj->insertCollection(*SETOFOBJECTS::posePDF2opengl(*this));
90  }
91 
92  /** Returns a 3D representation of this PDF.
93  * \note Needs the mrpt-opengl library, and using
94  * mrpt::opengl::CSetOfObjects::Ptr as template argument.
95  */
96  template <class OPENGL_SETOFOBJECTSPTR, class OPENGL_SETOFOBJECTS>
97  inline OPENGL_SETOFOBJECTSPTR getAs3DObject() const
98  {
99  using SETOFOBJECTS = typename OPENGL_SETOFOBJECTSPTR::value_type;
100  return SETOFOBJECTS::posePDF2opengl(*this);
101  }
102 
103 }; // End of class def.
104 } // End of namespace
105 } // End of namespace
106 
107 #endif
virtual void bayesianFusion(const CPointPDF &p1, const CPointPDF &p2, const double minMahalanobisDistToDrop=0)=0
Bayesian fusion of two point distributions (product of two distributions->new distribution), then save the result in this object (WARNING: See implementing classes to see classes that can and cannot be mixtured!)
#define DEFINE_VIRTUAL_SERIALIZABLE(class_name)
This declaration must be inserted in virtual CSerializable classes definition:
static bool is_3D()
Definition: CPointPDF.h:71
void getAs3DObject(OPENGL_SETOFOBJECTSPTR &out_obj) const
Returns a 3D representation of this PDF (it doesn&#39;t clear the current contents of out_obj...
Definition: CPointPDF.h:86
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
CSetOfObjects::Ptr posePDF2opengl(const POSE_PDF &o)
Returns a representation of a the PDF - this is just an auxiliary function, it&#39;s more natural to call...
Definition: pose_pdfs.h:24
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
OPENGL_SETOFOBJECTSPTR getAs3DObject() const
Returns a 3D representation of this PDF.
Definition: CPointPDF.h:97
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:32
virtual void changeCoordinatesReference(const CPose3D &newReferenceBase)=0
static bool is_PDF()
Definition: CPointPDF.h:76
virtual void copyFrom(const CPointPDF &o)=0
Copy operator, translating if necesary (for example, between particles and gaussian representations) ...
Declares a class that represents a Probability Distribution function (PDF) of a 3D point (x...
Definition: CPointPDF.h:39
A generic template for probability density distributions (PDFs).



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019