class mrpt::slam::CGridMapAligner

A class for aligning two multi-metric maps (with an occupancy grid maps and a points map, at least) based on features extraction and matching.

The matching pose is returned as a Sum of Gaussians (poses::CPosePDFSOG).

This class can use three methods (see options.methodSelection):

  • amCorrelation: “Brute-force” correlation of the two maps over a 2D+orientation grid of possible 2D poses.

  • amRobustMatch: Detection of features + RANSAC matching

  • amModifiedRANSAC: Detection of features + modified multi-hypothesis RANSAC matching as described in was reported in the paper https://www.mrpt.org/Paper%3AOccupancy_Grid_Matching

See CGridMapAligner::Align for more instructions.

See also:

CMetricMapsAlignmentAlgorithm

#include <mrpt/slam/CGridMapAligner.h>

class CGridMapAligner: public mrpt::slam::CMetricMapsAlignmentAlgorithm
{
public:
    // enums

    enum TAlignerMethod;

    // structs

    struct TReturnInfo;

    // classes

    class TConfigParams;

    //
fields

    mrpt::slam::CGridMapAligner::TConfigParams options;

    // construction

    CGridMapAligner();

    //
methods

    virtual mrpt::poses::CPosePDF::Ptr AlignPDF(
        const mrpt::maps::CMetricMap* m1,
        const mrpt::maps::CMetricMap* m2,
        const mrpt::poses::CPosePDFGaussian& initialEstimationPDF,
        mrpt::optional_ref<TMetricMapAlignmentResult> outInfo = std::nullopt
        );

    virtual mrpt::poses::CPose3DPDF::Ptr Align3DPDF(
        const mrpt::maps::CMetricMap* m1,
        const mrpt::maps::CMetricMap* m2,
        const mrpt::poses::CPose3DPDFGaussian& initialEstimationPDF,
        mrpt::optional_ref<TMetricMapAlignmentResult> outInfo = std::nullopt
        );

    mrpt::poses::CPosePDF::Ptr Align(const mrpt::maps::CMetricMap* m1, const mrpt::maps::CMetricMap* m2, const mrpt::poses::CPose2D& grossEst, mrpt::optional_ref<TMetricMapAlignmentResult> outInfo = std::nullopt);
    mrpt::poses::CPose3DPDF::Ptr Align3D(const mrpt::maps::CMetricMap* m1, const mrpt::maps::CMetricMap* m2, const mrpt::poses::CPose3D& grossEst, mrpt::optional_ref<TMetricMapAlignmentResult> outInfo = std::nullopt);
};

Inherited Members

public:
    // structs

    struct TMsg;

    //
methods

    virtual mrpt::poses::CPosePDF::Ptr AlignPDF(
        const mrpt::maps::CMetricMap* m1,
        const mrpt::maps::CMetricMap* m2,
        const mrpt::poses::CPosePDFGaussian& initialEstimationPDF,
        mrpt::optional_ref<TMetricMapAlignmentResult> outInfo = std::nullopt
        ) = 0;

    virtual mrpt::poses::CPose3DPDF::Ptr Align3DPDF(
        const mrpt::maps::CMetricMap* m1,
        const mrpt::maps::CMetricMap* m2,
        const mrpt::poses::CPose3DPDFGaussian& initialEstimationPDF,
        mrpt::optional_ref<TMetricMapAlignmentResult> outInfo = std::nullopt
        ) = 0;

Methods

virtual mrpt::poses::CPosePDF::Ptr AlignPDF(
    const mrpt::maps::CMetricMap* m1,
    const mrpt::maps::CMetricMap* m2,
    const mrpt::poses::CPosePDFGaussian& initialEstimationPDF,
    mrpt::optional_ref<TMetricMapAlignmentResult> outInfo = std::nullopt
    )

The method for aligning a pair of 2D points map.

The meaning of some parameters are implementation dependant, so look for derived classes for instructions. The target is to find a PDF for the pose displacement between maps, thus the pose of m2 relative to m1. This pose is returned as a PDF rather than a single value.

NOTE: This method can be configurated with “options”

The returned PDF depends on the selected alignment method:

  • “amRobustMatch”> A “poses::CPosePDFSOG” object.

  • “amCorrelation”> A “poses::CPosePDFGrid” object.

Parameters:

m1

[IN] The first map (Must be a mrpt::maps::CMultiMetricMap class)

m2

[IN] The second map (Must be a mrpt::maps::CMultiMetricMap class)

initialEstimationPDF

[IN] (IGNORED IN THIS ALGORITHM!)

runningTime

[OUT] A pointer to a container for obtaining the algorithm running time in seconds, or NULL if you don’t need it.

info

[OUT] A pointer to a TReturnInfo struct, or NULL if result information are not required.

Returns:

A smart pointer to the output estimated pose PDF.

See also:

CPointsMapAlignmentAlgorithm, options

virtual mrpt::poses::CPose3DPDF::Ptr Align3DPDF(
    const mrpt::maps::CMetricMap* m1,
    const mrpt::maps::CMetricMap* m2,
    const mrpt::poses::CPose3DPDFGaussian& initialEstimationPDF,
    mrpt::optional_ref<TMetricMapAlignmentResult> outInfo = std::nullopt
    )

Not applicable in this class, will launch an exception if used.

mrpt::poses::CPosePDF::Ptr Align(const mrpt::maps::CMetricMap* m1, const mrpt::maps::CMetricMap* m2, const mrpt::poses::CPose2D& grossEst, mrpt::optional_ref<TMetricMapAlignmentResult> outInfo = std::nullopt)

The method for aligning a pair of metric maps, for SE(2) relative poses.

The meaning of some parameters and the kind of the maps to be aligned are implementation dependant, so look at the derived classes for instructions. The target is to find a PDF for the pose displacement between maps, thus the pose of m2 relative to m1. This pose is returned as a PDF rather than a single value.

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

Parameters:

m1

[IN] The first map

m2

[IN] The second map. The pose of this map respect to m1 is to be estimated.

grossEst

[IN] An initial gross estimation for the displacement. If a given algorithm doesn’t need it, set to CPose2D(0,0,0) for example.

runningTime

[OUT] A pointer to a container for obtaining the algorithm running time in seconds, or nullptr if you don’t need it.

info

[OUT] See derived classes for details, or nullptr if it isn’t needed.

Returns:

A smart pointer to the output estimated pose PDF.

A smart pointer to the output estimated pose PDF.

See also:

CICP

CICP

mrpt::poses::CPose3DPDF::Ptr Align3D(const mrpt::maps::CMetricMap* m1, const mrpt::maps::CMetricMap* m2, const mrpt::poses::CPose3D& grossEst, mrpt::optional_ref<TMetricMapAlignmentResult> outInfo = std::nullopt)

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

Returns:

A smart pointer to the output estimated pose PDF.

See also:

CICP