Class CPosePDF

Inheritance Relationships

Base Types

  • public mrpt::serialization::CSerializable

  • public mrpt::math::CProbabilityDensityFunction< CPose2D, 3 >

  • public mrpt::Stringifyable

Derived Types

Class Documentation

class CPosePDF : public mrpt::serialization::CSerializable, public mrpt::math::CProbabilityDensityFunction<CPose2D, 3>, public mrpt::Stringifyable

Declares a class that represents a probability density function (pdf) of a 2D pose (x,y,phi). This class is just the base class for unifying many different ways this pdf can be implemented.

For convenience, a pose composition is also defined for any pdf derived class, changeCoordinatesReference, in the form of a method rather than an operator.

See also: probabilistic spatial representations

Subclassed by mrpt::poses::CPosePDFGaussian, mrpt::poses::CPosePDFGaussianInf, mrpt::poses::CPosePDFGrid, mrpt::poses::CPosePDFParticles, mrpt::poses::CPosePDFSOG

Public Types

enum [anonymous]

Values:

enumerator is_3D_val
enum [anonymous]

Values:

enumerator is_PDF_val

Public Functions

virtual void printTo(std::ostream &out) const = 0

Write a human-readable description of this PDF to the given stream. Derived classes must override this method.

virtual std::string asString() const override

Returns a human-readable string representation of this PDF.

virtual void copyFrom(const CPosePDF &o) = 0

Copy operator, translating if necessary (for example, between particles and gaussian representations)

virtual void bayesianFusion(const CPosePDF &p1, const CPosePDF &p2, double minMahalanobisDistToDrop = 0) = 0

Bayesian fusion of two pose 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 mixed!)

Parameters:
  • p1 – The first distribution to fuse

  • p2 – The second distribution to fuse

  • 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.

virtual void inverse(CPosePDF &o) const = 0

Returns a new PDF such as: NEW_PDF = (0,0,0) - THIS_PDF

virtual void changeCoordinatesReference(const CPose3D &newReferenceBase) = 0
template<class OPENGL_SETOFOBJECTSPTR>
inline void getAs3DObject(OPENGL_SETOFOBJECTSPTR &out_obj) const

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)

Note

Needs the mrpt-opengl library, and using mrpt::viz::CSetOfObjects::Ptr as template argument.

Note

By default, ellipsoids for the confidence intervals of “q=3” are drawn; for more mathematical details, see CGeneralizedEllipsoidTemplate::setQuantiles()

template<class OPENGL_SETOFOBJECTSPTR>
inline OPENGL_SETOFOBJECTSPTR getAs3DObject() const

Returns a 3D representation of this PDF.

Note

Needs the mrpt-opengl library, and using mrpt::viz::CSetOfObjects::Ptr as template argument.

Public Static Functions

static void jacobiansPoseComposition(const CPose2D &x, const CPose2D &u, mrpt::math::CMatrixDouble33 &df_dx, mrpt::math::CMatrixDouble33 &df_du, bool compute_df_dx = true, bool compute_df_du = true)

This static method computes the pose composition Jacobians, with these formulas:

df_dx =
[ 1, 0, -sin(phi_x)*x_u-cos(phi_x)*y_u ]
[ 0, 1,  cos(phi_x)*x_u-sin(phi_x)*y_u ]
[ 0, 0,                              1 ]

df_du =
[ cos(phi_x) , -sin(phi_x) ,  0  ]
[ sin(phi_x) ,  cos(phi_x) ,  0  ]
[         0  ,          0  ,  1  ]

static void jacobiansPoseComposition(const CPosePDFGaussian &x, const CPosePDFGaussian &u, mrpt::math::CMatrixDouble33 &df_dx, mrpt::math::CMatrixDouble33 &df_du)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

static inline constexpr bool is_3D()
static inline constexpr bool is_PDF()