class mrpt::poses::CPose3DQuatPDFGaussianInf

Overview

Declares a class that represents a Probability Density function (PDF) of a 3D pose using a quaternion \(p(\mathbf{x}) = [x ~ y ~ z ~ qr ~ qx ~ qy ~ qz]^\top\).

This class implements that PDF using a mono-modal Gaussian distribution storing the information matrix instead of its inverse, the covariance matrix. See mrpt::poses::CPose3DQuatPDF for more details, or mrpt::poses::CPose3DPDF for classes based on Euler angles instead.

Uncertainty of pose composition operations (\(y = x \oplus u\)) is implemented in the methods “CPose3DQuatPDFGaussianInf::operator+=” and “CPose3DQuatPDF::jacobiansPoseComposition”.

Read also: “A tutorial on SE(3) transformation parameterizations and on-manifold optimization”, in [5]

See also:

CPose3DQuat, CPose3DQuatPDF, CPose3DPDF, CPose3DQuatPDFGaussian

#include <mrpt/poses/CPose3DQuatPDFGaussianInf.h>

class CPose3DQuatPDFGaussianInf: public mrpt::poses::CPose3DQuatPDF
{
public:
    // fields

    CPose3DQuat mean;
    mrpt::math::CMatrixDouble77 cov_inv;

    // construction

    CPose3DQuatPDFGaussianInf();
    CPose3DQuatPDFGaussianInf(mrpt::math::TConstructorFlags_Quaternions constructor_dummy_param);
    CPose3DQuatPDFGaussianInf(const CPose3DQuat& init_Mean);
    CPose3DQuatPDFGaussianInf(const CPose3DQuat& init_Mean, const mrpt::math::CMatrixDouble77& init_CovInv);

    // methods

    const CPose3DQuat& getPoseMean() const;
    CPose3DQuat& getPoseMean();
    void getMean(CPose3DQuat& mean_pose) const;
    virtual bool isInfType() const;
    virtual std::tuple<cov_mat_t, type_value> getCovarianceAndMean() const;
    void getInformationMatrix(mrpt::math::CMatrixDouble77& inf) const;
    virtual void copyFrom(const CPose3DQuatPDF& o);
    virtual bool saveToTextFile(const std::string& file) const;
    void changeCoordinatesReference(const CPose3DQuat& newReferenceBase);
    virtual void changeCoordinatesReference(const CPose3D& newReferenceBase);
    void drawSingleSample(CPose3DQuat& outPart) const;
    virtual void drawManySamples(size_t N, std::vector<mrpt::math::CVectorDouble>& outSamples) const;
    virtual void inverse(CPose3DQuatPDF& o) const;
    CPose3DQuatPDFGaussianInf operator - () const;
    void operator += (const CPose3DQuat& Ap);
    void operator += (const CPose3DQuatPDFGaussianInf& Ap);
    void operator -= (const CPose3DQuatPDFGaussianInf& Ap);
    double evaluatePDF(const CPose3DQuat& x) const;
    double evaluateNormalizedPDF(const CPose3DQuat& x) const;
};

Inherited Members

public:
    // typedefs

    typedef CProbabilityDensityFunction<TDATA, STATE_LEN> self_t;

    // methods

    virtual void copyFrom(const CPose3DQuatPDF& o) = 0;
    virtual void inverse(CPose3DQuatPDF& o) const = 0;
    virtual void changeCoordinatesReference(const CPose3D& newReferenceBase) = 0;

    template <class OPENGL_SETOFOBJECTSPTR>
    void getAs3DObject(OPENGL_SETOFOBJECTSPTR& out_obj) const;

    template <class OPENGL_SETOFOBJECTSPTR>
    OPENGL_SETOFOBJECTSPTR getAs3DObject() const;

    static CPose3DQuatPDF::Ptr createFrom2D(const CPosePDF& o);
    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);

Fields

CPose3DQuat mean

The mean value.

mrpt::math::CMatrixDouble77 cov_inv

The 7x7 information matrix (the inverse of the covariance)

Construction

CPose3DQuatPDFGaussianInf()

Default constructor - set all values to zero.

CPose3DQuatPDFGaussianInf(mrpt::math::TConstructorFlags_Quaternions constructor_dummy_param)

Constructor which left all the member uninitialized, for using when speed is critical - as argument, use UNINITIALIZED_QUATERNION.

CPose3DQuatPDFGaussianInf(const CPose3DQuat& init_Mean)

Constructor from a default mean value, information matrix equals to zero.

Constructor from a default mean value, covariance equals to zero.

CPose3DQuatPDFGaussianInf(const CPose3DQuat& init_Mean, const mrpt::math::CMatrixDouble77& init_CovInv)

Constructor with mean and inverse covariance (information matrix).

Constructor with mean and covariance.

Methods

virtual bool isInfType() const

Returns whether the class instance holds the uncertainty in covariance or information form.

By default this is going to be covariance form. *Inf classes (e.g. CPosePDFGaussianInf) store it in information form.

See also:

mrpt::traits::is_inf_type

virtual std::tuple<cov_mat_t, type_value> getCovarianceAndMean() const

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

See also:

getMean, getInformationMatrix

void getInformationMatrix(mrpt::math::CMatrixDouble77& inf) const

Returns the information (inverse covariance) matrix (a STATE_LEN x STATE_LEN matrix)

See also:

getMean, getCovarianceAndMean

virtual void copyFrom(const CPose3DQuatPDF& o)

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

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

Save the PDF to a text file, containing the 3D pose in the first line (x y z qr qx qy qz), then the information matrix in the next 7 lines.

void changeCoordinatesReference(const CPose3DQuat& newReferenceBase)

this = p (+) this.

This can be used to convert a PDF from local coordinates to global, providing the point (newReferenceBase) from which “to project” the current pdf. Result PDF substituted the currently stored one in the object.

virtual void changeCoordinatesReference(const CPose3D& newReferenceBase)

this = p (+) this.

This can be used to convert a PDF from local coordinates to global, providing the point (newReferenceBase) from which “to project” the current pdf. Result PDF substituted the currently stored one in the object.

void drawSingleSample(CPose3DQuat& outPart) const

Draws a single sample from the distribution.

virtual void drawManySamples(size_t N, std::vector<mrpt::math::CVectorDouble>& outSamples) const

Draws a number of samples from the distribution, and saves as a list of 1x7 vectors, where each row contains a (x,y,z,qr,qx,qy,qz) datum.

virtual void inverse(CPose3DQuatPDF& o) const

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

CPose3DQuatPDFGaussianInf operator - () const

Unary - operator, returns the PDF of the inverse pose.

void operator += (const CPose3DQuat& Ap)

Makes: thisPDF = thisPDF + Ap, where “+” is pose composition (both the mean, and the covariance matrix are updated).

void operator += (const CPose3DQuatPDFGaussianInf& Ap)

Makes: thisPDF = thisPDF + Ap, where “+” is pose composition (both the mean, and the covariance matrix are updated) (see formulas in jacobiansPoseComposition ).

void operator -= (const CPose3DQuatPDFGaussianInf& Ap)

Makes: thisPDF = thisPDF - Ap, where “-” is pose inverse composition (both the mean, and the covariance matrix are updated).

double evaluatePDF(const CPose3DQuat& x) const

Evaluates the PDF at a given point.

double evaluateNormalizedPDF(const CPose3DQuat& x) const

Evaluates the ratio PDF(x) / PDF(MEAN), that is, the normalized PDF in the range [0,1].