class mp2p_icp::ICP

Overview

Generic ICP algorithm container: builds a custom ICP pipeline by selecting algorithm and parameter for each stage.

The main API entry point is align().

A convenient way to create an ICP pipeline instance is using a YAML configuration file and calling mp2p_icp::icp_pipeline_from_yaml().

Todo Add pipeline picture.

Several solvers may exists, but the output from the first one returning true will be used. This is by design, to enable different solver algorithms depending on the ICP iteration or the type of geometric entities.

#include <ICP.h>

class ICP:
    public mrpt::system::COutputLogger,
    public mrpt::rtti::CObject
{
public:
    // structs

    struct ICP_State;
    struct QualityEvaluatorEntry;

    // methods

    void initialize_solvers(const mrpt::containers::yaml& params);
    static bool run_solvers(const solver_list_t& solvers, const Pairings& pairings, OptimalTF_Result& out, const SolverContext& sc = {});
    void initialize_quality_evaluators(const mrpt::containers::yaml& params);
    void initialize_matchers(const mrpt::containers::yaml& params);

    virtual void align(
        const metric_map_t& pcLocal,
        const metric_map_t& pcGlobal,
        const mrpt::math::TPose3D& initialGuessLocalWrtGlobal,
        const Parameters& p,
        Results& result,
        const std::optional<mrpt::poses::CPose3DPDFGaussianInf>& prior = std::nullopt,
        const mrpt::optional_ref<LogRecord>& outputDebugInfo = std::nullopt
        );

    virtual void initialize_derived(] const mrpt::containers::yaml& p);
};

// direct descendants

class ICP_LibPointmatcher;

Methods

void initialize_solvers(const mrpt::containers::yaml& params)

Create and configure one or more “Solver” modules from YAML-like config block. Config must be a sequence of one or more entries, each with a class and a params dictionary entries.

Read the comments for ICP on the possible existence of more than one solver.

Example:

- class: mp2p_icp::Solver_Horn
  params:
   # Parameters depend on the particular class
   # none

Alternatively, the objects can be directly created via solvers().

See also:

mp2p_icp::icp_pipeline_from_yaml()

static bool run_solvers(
    const solver_list_t& solvers,
    const Pairings& pairings,
    OptimalTF_Result& out,
    const SolverContext& sc = {}
    )

Runs a set of solvers.

void initialize_quality_evaluators(const mrpt::containers::yaml& params)

Create and configure one or more “QualityEvaluator” modules from YAML-like config block. Config must be a sequence of one or more entries, each with a class and a params dictionary entries.

Example:

- class: mp2p_icp::QualityEvaluator_PairedRatio
  weight: 1.0  # (Optional if only one quality evaluator is defined)
  params:
   # Parameters depend on the particular class
   # xxx: yyyy

Alternatively, the objects can be directly created via matchers().

See also:

mp2p_icp::icp_pipeline_from_yaml()

void initialize_matchers(const mrpt::containers::yaml& params)

Create and configure one or more “Match” modules from YAML-like config block. Config must be a sequence of one or more entries, each with a class and a params dictionary entries.

Example:

- class: mp2p_icp::Matcher_Points_DistanceThreshold
  params:
   # Parameters depend on the particular class
   threshold: 1.0

Alternatively, the objects can be directly created via matchers().

See also:

mp2p_icp::icp_pipeline_from_yaml()

virtual void align(
    const metric_map_t& pcLocal,
    const metric_map_t& pcGlobal,
    const mrpt::math::TPose3D& initialGuessLocalWrtGlobal,
    const Parameters& p,
    Results& result,
    const std::optional<mrpt::poses::CPose3DPDFGaussianInf>& prior = std::nullopt,
    const mrpt::optional_ref<LogRecord>& outputDebugInfo = std::nullopt
    )

Register (align) two point clouds (possibly after having been preprocessed to extract features, etc.) and returns the relative pose of pcLocal with respect to pcGlobal.

virtual void initialize_derived(] const mrpt::containers::yaml& p)

For whole-ICP overriden classes (e.g. external ICP library wrappers), initialize those external libraries with these parameters. Invoked from mp2p_icp::icp_pipeline_from_yaml().

See also:

mp2p_icp::icp_pipeline_from_yaml()