class mrpt::poses::CPoint2DPDF

Overview

Declares a class that represents a Probability Distribution function (PDF) of a 2D point (x,y).

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.

For a similar class for 6D poses (a 3D point with attitude), see CPose3DPDF

See also: probabilistic spatial representations

See also:

CPoint2D, CPointPDF

#include <mrpt/poses/CPoint2DPDF.h>

class CPoint2DPDF:
    public mrpt::serialization::CSerializable,
    public mrpt::math::CProbabilityDensityFunction
{
public:
    // typedefs

    typedef std::shared_ptr<CPoint2DPDF> Ptr;
    typedef std::shared_ptr<const CPoint2DPDF> ConstPtr;

    // construction

    CPoint2DPDF();
    CPoint2DPDF(const CPoint2DPDF&);
    CPoint2DPDF(CPoint2DPDF&&);

    // methods

    virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const;
    static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic();
    CPoint2DPDF& operator = (const CPoint2DPDF&);
    CPoint2DPDF& operator = (CPoint2DPDF&&);
    virtual void copyFrom(const CPoint2DPDF& o) = 0;
    virtual void changeCoordinatesReference(const CPose3D& newReferenceBase) = 0;

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

    virtual std::tuple<cov_mat_t, type_value> getCovarianceAndMean() const = 0;
    virtual bool saveToTextFile(const std::string& file) const = 0;
};

// direct descendants

class CPoint2DPDFGaussian;

Inherited Members

public:
    // typedefs

    typedef std::shared_ptr<CObject> Ptr;
    typedef std::shared_ptr<const CObject> ConstPtr;
    typedef std::shared_ptr<CSerializable> Ptr;
    typedef std::shared_ptr<const CSerializable> ConstPtr;
    typedef CProbabilityDensityFunction<TDATA, STATE_LEN> self_t;

    // methods

    static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic();
    virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const;
    virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const;
    static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic();
    CProbabilityDensityFunction& operator = (const CProbabilityDensityFunction&);
    CProbabilityDensityFunction& operator = (CProbabilityDensityFunction&&);

Methods

virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const

Returns information about the class of an object in runtime.

virtual void copyFrom(const CPoint2DPDF& o) = 0

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

virtual void bayesianFusion(
    const CPoint2DPDF& p1,
    const CPoint2DPDF& 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!)

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 std::tuple<cov_mat_t, type_value> getCovarianceAndMean() const = 0

Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean, both at once.

See also:

getMean, getInformationMatrix

virtual bool saveToTextFile(const std::string& file) const = 0

Save PDF’s particles to a text file.

See derived classes for more information about the format of generated files.

Returns:

false on error