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



Page generated by Doxygen 1.9.4 for MRPT 1.4.0 SVN: at Thu Aug 4 01:35:14 UTC 2022