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-2017, 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  */
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  enum
65  {
67  };
68  static inline bool is_3D() { return is_3D_val != 0; }
69  enum
70  {
72  };
73  static inline bool is_PDF() { return is_PDF_val != 0; }
74  /** Returns a 3D representation of this PDF (it doesn't clear the current
75  * contents of out_obj, but append new OpenGL objects to that list)
76  * \note Needs the mrpt-opengl library, and using
77  * mrpt::opengl::CSetOfObjects::Ptr as template argument.
78  * \note By default, ellipsoids for the confidence intervals of "q=3" are
79  * drawn; for more mathematical details, see
80  * CGeneralizedEllipsoidTemplate::setQuantiles()
81  */
82  template <class OPENGL_SETOFOBJECTSPTR>
83  inline void getAs3DObject(OPENGL_SETOFOBJECTSPTR& out_obj) const
84  {
85  typedef typename OPENGL_SETOFOBJECTSPTR::element_type SETOFOBJECTS;
86  out_obj->insertCollection(*SETOFOBJECTS::posePDF2opengl(*this));
87  }
88 
89  /** Returns a 3D representation of this PDF.
90  * \note Needs the mrpt-opengl library, and using
91  * mrpt::opengl::CSetOfObjects::Ptr as template argument.
92  */
93  template <class OPENGL_SETOFOBJECTSPTR, class OPENGL_SETOFOBJECTS>
94  inline OPENGL_SETOFOBJECTSPTR getAs3DObject() const
95  {
96  typedef typename OPENGL_SETOFOBJECTSPTR::value_type SETOFOBJECTS;
97  return SETOFOBJECTS::posePDF2opengl(*this);
98  }
99 
100 }; // End of class def.
101 } // End of namespace
102 } // End of namespace
103 
104 #endif
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:44
#define DEFINE_VIRTUAL_SERIALIZABLE(class_name)
This declaration must be inserted in virtual CSerializable classes definition:
static bool is_3D()
Definition: CPointPDF.h:68
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:83
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!)
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
OPENGL_SETOFOBJECTSPTR getAs3DObject() const
Returns a 3D representation of this PDF.
Definition: CPointPDF.h:94
static bool is_PDF()
Definition: CPointPDF.h:73
virtual void copyFrom(const CPointPDF &o)=0
Copy operator, translating if necesary (for example, between particles and gaussian representations) ...
A generic template for probability density distributions (PDFs).
Declares a class that represents a Probability Distribution function (PDF) of a 3D point (x...
Definition: CPointPDF.h:39



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019