Main MRPT website > C++ reference for MRPT 1.5.6
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 {
22 
23  /** Declares a class that represents a Probability Distribution
24  * function (PDF) of a 3D point (x,y,z).
25  * This class is just the base class for unifying many diferent
26  * ways this PDF can be implemented.
27  *
28  * For convenience, a pose composition is also defined for any
29  * PDF derived class, changeCoordinatesReference, in the form of a method rather than an operator.
30  *
31  * For a similar class for 6D poses (a 3D point with attitude), see CPose3DPDF
32  *
33  * See also the tutorial on <a href="http://www.mrpt.org/Probability_Density_Distributions_Over_Spatial_Representations">probabilistic spatial representations in the MRPT</a>.
34  *
35  * \sa CPoint3D
36  * \ingroup poses_pdf_grp
37  */
38  class BASE_IMPEXP CPointPDF : public mrpt::utils::CSerializable, public mrpt::utils::CProbabilityDensityFunction<CPoint3D,3>
39  {
41 
42  public:
43  /** Copy operator, translating if necesary (for example, between particles and gaussian representations)
44  */
45  virtual void copyFrom(const CPointPDF &o) = 0;
46 
47 
48  /** 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!)
49  * \param p1 The first distribution to fuse
50  * \param p2 The second distribution to fuse
51  * \param minMahalanobisDistToDrop If set to different of 0, the result of very separate Gaussian modes (that will result in negligible components) in SOGs will be dropped to reduce the number of modes in the output.
52  */
53  virtual void bayesianFusion( const CPointPDF &p1, const CPointPDF &p2, const double &minMahalanobisDistToDrop = 0) = 0 ;
54 
55  enum { is_3D_val = 1 };
56  static inline bool is_3D() { return is_3D_val!=0; }
57  enum { is_PDF_val = 1 };
58  static inline bool is_PDF() { return is_PDF_val!=0; }
59 
60  /** Returns a 3D representation of this PDF (it doesn't clear the current contents of out_obj, but append new OpenGL objects to that list)
61  * \note Needs the mrpt-opengl library, and using mrpt::opengl::CSetOfObjectsPtr as template argument.
62  * \note By default, ellipsoids for the confidence intervals of "q=3" are drawn; for more mathematical details, see CGeneralizedEllipsoidTemplate::setQuantiles()
63  */
64  template <class OPENGL_SETOFOBJECTSPTR>
65  inline void getAs3DObject(OPENGL_SETOFOBJECTSPTR &out_obj) const {
66  typedef typename OPENGL_SETOFOBJECTSPTR::value_type SETOFOBJECTS;
67  out_obj->insertCollection( *SETOFOBJECTS::posePDF2opengl(*this) );
68  }
69 
70  /** Returns a 3D representation of this PDF.
71  * \note Needs the mrpt-opengl library, and using mrpt::opengl::CSetOfObjectsPtr as template argument.
72  */
73  template <class OPENGL_SETOFOBJECTSPTR,class OPENGL_SETOFOBJECTS>
74  inline OPENGL_SETOFOBJECTSPTR getAs3DObject() const {
75  typedef typename OPENGL_SETOFOBJECTSPTR::value_type SETOFOBJECTS;
76  return SETOFOBJECTS::posePDF2opengl(*this);
77  }
78 
79  }; // End of class def.
81 
82 
83  } // End of namespace
84 } // End of namespace
85 
86 #endif
DEFINE_SERIALIZABLE_POST_CUSTOM_BASE(CPose3DPDFGaussianInf, CPose3DPDF)
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:39
#define DEFINE_VIRTUAL_SERIALIZABLE(class_name)
This declaration must be inserted in virtual CSerializable classes definition:
static bool is_3D()
Definition: CPointPDF.h:56
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:65
#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 class used to store a 3D point.
Definition: CPoint3D.h:32
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
OPENGL_SETOFOBJECTSPTR getAs3DObject() const
Returns a 3D representation of this PDF.
Definition: CPointPDF.h:74
static bool is_PDF()
Definition: CPointPDF.h:58
Declares a class that represents a Probability Distribution function (PDF) of a 3D point (x...
Definition: CPointPDF.h:38
CSetOfObjectsPtr 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:23



Page generated by Doxygen 1.8.14 for MRPT 1.5.6 Git: 4c65e8431 Tue Apr 24 08:18:17 2018 +0200 at lun oct 28 01:35:26 CET 2019