Main MRPT website > C++ reference for MRPT 1.9.9
CPose3DQuatPDF.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 CPose3DQuatPDF_H
10 #define CPose3DQuatPDF_H
11 
12 #include <mrpt/poses/CPose3D.h>
13 #include <mrpt/poses/CPose3DQuat.h>
14 #include <mrpt/math/CMatrixD.h>
16 
17 namespace mrpt
18 {
19 namespace poses
20 {
21 class CPosePDF;
22 class CPose3DPDF;
23 
24 /** Declares a class that represents a Probability Density Function (PDF) of a
25  * 3D pose (6D actually), by means of a 7-vector with a translation [x y z] and
26  * a quaternion [qr qx qy qz].
27  * This class is just the base class for unifying many diferent ways this PDF
28  * can be implemented.
29  *
30  * For convenience, a pose composition is also defined for any
31  * PDF derived class, changeCoordinatesReference, in the form of a method
32  * rather than an operator.
33  *
34  * - For a similar class for 3D points (without attitude), see CPointPDF.
35  * - For a similar class for 3D poses (with Euler angles instead of
36  * quaternions), see CPose3DPDF.
37  *
38  *
39  * See also the tutorial on <a
40  * href="http://www.mrpt.org/Probability_Density_Distributions_Over_Spatial_Representations"
41  * >probabilistic spatial representations in the MRPT</a>.
42  *
43  * \sa CPose3DQuatPDF, CPose3DPDF
44  * \ingroup poses_pdf_grp
45  */
48  public mrpt::math::CProbabilityDensityFunction<CPose3DQuat, 7>
49 {
51 
52  public:
53  /** Copy operator, translating if necesary (for example, between particles
54  * and gaussian representations)
55  * \sa createFrom2D
56  */
57  virtual void copyFrom(const CPose3DQuatPDF& o) = 0;
58 
59  /** This is a static transformation method from 2D poses to 3D PDFs,
60  * preserving the representation type (particles->particles,
61  * Gaussians->Gaussians,etc)
62  * It returns a new object of any of the derived classes of
63  * CPose3DQuatPDF. This object must be deleted by the user when not required
64  * anymore.
65  * \sa copyFrom
66  */
67  static CPose3DQuatPDF* createFrom2D(const CPosePDF& o);
68 
69  /** Returns a new PDF such as: NEW_PDF = (0,0,0) - THIS_PDF */
70  virtual void inverse(CPose3DQuatPDF& o) const = 0;
71 
72  virtual void changeCoordinatesReference(
73  const CPose3D& newReferenceBase) = 0;
74 
75  /** This static method computes the two Jacobians of a pose composition
76  * operation $f(x,u)= x \oplus u$
77  * \param out_x_oplus_u If set to !=nullptr, the result of "x+u" will be
78  * stored here (it will be computed internally anyway).
79  * To see the mathematical derivation of the formulas, refer to the
80  * technical report here:
81  * -
82  * http://www.mrpt.org/Probability_Density_Distributions_Over_Spatial_Representations
83  */
84  static void jacobiansPoseComposition(
85  const CPose3DQuat& x, const CPose3DQuat& u,
87  CPose3DQuat* out_x_oplus_u = nullptr);
88 
89  /** Returns a 3D representation of this PDF (it doesn't clear the current
90  * contents of out_obj, but append new OpenGL objects to that list)
91  * \note Needs the mrpt-opengl library, and using
92  * mrpt::opengl::CSetOfObjects::Ptr as template argument.
93  * \note By default, ellipsoids for the confidence intervals of "q=3" are
94  * drawn; for more mathematical details, see
95  * CGeneralizedEllipsoidTemplate::setQuantiles()
96  */
97  template <class OPENGL_SETOFOBJECTSPTR>
98  inline void getAs3DObject(OPENGL_SETOFOBJECTSPTR& out_obj) const
99  {
100  using SETOFOBJECTS = typename OPENGL_SETOFOBJECTSPTR::value_type;
101  out_obj->insertCollection(*SETOFOBJECTS::posePDF2opengl(*this));
102  }
103 
104  /** Returns a 3D representation of this PDF.
105  * \note Needs the mrpt-opengl library, and using
106  * mrpt::opengl::CSetOfObjects::Ptr as template argument.
107  */
108  template <class OPENGL_SETOFOBJECTSPTR>
109  inline OPENGL_SETOFOBJECTSPTR getAs3DObject() const
110  {
111  using SETOFOBJECTS = typename OPENGL_SETOFOBJECTSPTR::value_type;
112  return SETOFOBJECTS::posePDF2opengl(*this);
113  }
114 
115 }; // End of class def.
116 } // End of namespace
117 } // End of namespace
118 
119 #endif
mrpt::poses::CPose3DQuatPDF
Declares a class that represents a Probability Density Function (PDF) of a 3D pose (6D actually),...
Definition: CPose3DQuatPDF.h:46
CProbabilityDensityFunction.h
mrpt::poses::CPose3DQuatPDF::copyFrom
virtual void copyFrom(const CPose3DQuatPDF &o)=0
Copy operator, translating if necesary (for example, between particles and gaussian representations)
mrpt::poses::CPose3DQuatPDF::changeCoordinatesReference
virtual void changeCoordinatesReference(const CPose3D &newReferenceBase)=0
mrpt::math::CProbabilityDensityFunction
A generic template for probability density distributions (PDFs).
Definition: CProbabilityDensityFunction.h:28
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::poses::CPose3DQuat
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,...
Definition: CPose3DQuat.h:48
mrpt::opengl::posePDF2opengl
CSetOfObjects::Ptr posePDF2opengl(const POSE_PDF &o)
Returns a representation of a the PDF - this is just an auxiliary function, it's more natural to call...
Definition: pose_pdfs.h:24
mrpt::poses::CPose3DQuatPDF::inverse
virtual void inverse(CPose3DQuatPDF &o) const =0
Returns a new PDF such as: NEW_PDF = (0,0,0) - THIS_PDF.
mrpt::poses::CPose3DQuatPDF::jacobiansPoseComposition
static void jacobiansPoseComposition(const CPose3DQuat &x, const CPose3DQuat &u, mrpt::math::CMatrixDouble77 &df_dx, mrpt::math::CMatrixDouble77 &df_du, CPose3DQuat *out_x_oplus_u=nullptr)
This static method computes the two Jacobians of a pose composition operation $f(x,...
Definition: CPose3DQuatPDF.cpp:41
mrpt::poses::CPose3DQuatPDF::createFrom2D
static CPose3DQuatPDF * createFrom2D(const CPosePDF &o)
This is a static transformation method from 2D poses to 3D PDFs, preserving the representation type (...
Definition: CPose3DQuatPDF.cpp:26
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
CPose3DQuat.h
mrpt::poses::CPose3DQuatPDF::getAs3DObject
void getAs3DObject(OPENGL_SETOFOBJECTSPTR &out_obj) const
Returns a 3D representation of this PDF (it doesn't clear the current contents of out_obj,...
Definition: CPose3DQuatPDF.h:98
mrpt::serialization::CSerializable
The virtual base class which provides a unified interface for all persistent objects in MRPT.
Definition: CSerializable.h:32
CMatrixD.h
DEFINE_VIRTUAL_SERIALIZABLE
#define DEFINE_VIRTUAL_SERIALIZABLE(class_name)
This declaration must be inserted in virtual CSerializable classes definition:
Definition: CSerializable.h:119
mrpt::math::CMatrixFixedNumeric
A numeric matrix of compile-time fixed size.
Definition: CMatrixFixedNumeric.h:40
CPose3D.h
mrpt::poses::CPosePDF
Declares a class that represents a probability density function (pdf) of a 2D pose (x,...
Definition: CPosePDF.h:41
mrpt::poses::CPose3DQuatPDF::getAs3DObject
OPENGL_SETOFOBJECTSPTR getAs3DObject() const
Returns a 3D representation of this PDF.
Definition: CPose3DQuatPDF.h:109
x
GLenum GLint x
Definition: glext.h:3538



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST