class mrpt::slam::CMetricMapsAlignmentAlgorithm

Overview

A base class for any algorithm able of maps alignment.

There are two methods depending on an PDF or a single 2D Pose value is available as initial guess for the methods.

See also:

CPointsMap

#include <mrpt/slam/CMetricMapsAlignmentAlgorithm.h>

class CMetricMapsAlignmentAlgorithm: public mrpt::system::COutputLogger
{
public:
    // construction

    CMetricMapsAlignmentAlgorithm();

    // methods

    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);

    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;

    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);

    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;
};

// direct descendants

class CICP;

Inherited Members

public:
    // structs

    struct TMsg;

    // fields

    bool logging_enable_console_output {true};
    bool logging_enable_keep_record {false};

    // methods

    void logStr(const VerbosityLevel level, std::string_view msg_str) const;
    void logFmt(const VerbosityLevel level, const char* fmt, ...) const;
    void void logCond(const VerbosityLevel level, bool cond, const std::string& msg_str) const;
    void setLoggerName(const std::string& name);
    std::string getLoggerName() const;
    void setVerbosityLevel(const VerbosityLevel level);
    void setVerbosityLevelForCallbacks(const VerbosityLevel level);
    void setMinLoggingLevel(const VerbosityLevel level);
    VerbosityLevel getMinLoggingLevel() const;
    VerbosityLevel getMinLoggingLevelForCallbacks() const;
    bool isLoggingLevelVisible(VerbosityLevel level) const;
    void getLogAsString(std::string& log_contents) const;
    std::string getLogAsString() const;
    void writeLogToFile(const std::optional<std::string>& fname_in = std::nullopt) const;
    void dumpLogToConsole() const;
    std::string getLoggerLastMsg() const;
    void getLoggerLastMsg(std::string& msg_str) const;
    void loggerReset();
    void logRegisterCallback(output_logger_callback_t userFunc);
    bool logDeregisterCallback(output_logger_callback_t userFunc);
    COutputLogger& operator = (const COutputLogger&);
    COutputLogger& operator = (COutputLogger&&);
    static std::array<mrpt::system::ConsoleForegroundColor, NUMBER_OF_VERBOSITY_LEVELS>& logging_levels_to_colors();
    static const std::array<const char*, NUMBER_OF_VERBOSITY_LEVELS>& logging_levels_to_names();

Methods

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