mp2p_icp_map library

Overview

Core data structures and utilities for mp2p_icp

// typedefs

typedef std::string mp2p_icp::layer_name_t;

// enums

enum mp2p_icp::Coordinate;

// structs

struct mp2p_icp::PointCloudEigen;
struct mp2p_icp::color_mode_t;
struct mp2p_icp::pairings_render_params_t;
struct mp2p_icp::plane_patch_t;
struct mp2p_icp::pointcloud_bitfield_t;
struct mp2p_icp::render_params_lines_t;
struct mp2p_icp::render_params_pairings_pt2ln_t;
struct mp2p_icp::render_params_pairings_pt2pl_t;
struct mp2p_icp::render_params_pairings_pt2pt_t;
struct mp2p_icp::render_params_planes_t;
struct mp2p_icp::render_params_point_layer_t;
struct mp2p_icp::render_params_points_t;
struct mp2p_icp::render_params_t;

// classes

class mp2p_icp::ParameterSource;
class mp2p_icp::Parameterizable;
class mp2p_icp::metric_map_t;

// global functions

PointCloudEigen mp2p_icp::estimate_points_eigen(
    const float* xs,
    const float* ys,
    const float* zs,
    mrpt::optional_ref<const std::vector<size_t>> indices,
    std::optional<size_t> totalCount = std::nullopt
    );

mrpt::maps::CSimplePointsMap::Ptr mp2p_icp::load_xyz_file(const std::string& fil);
const mrpt::maps::CPointsMap* mp2p_icp::MapToPointsMap(const mrpt::maps::CMetricMap& map);
mrpt::maps::CPointsMap* mp2p_icp::MapToPointsMap(mrpt::maps::CMetricMap& map);

const mrpt::maps::NearestNeighborsCapable* mp2p_icp::MapToNN(
    const mrpt::maps::CMetricMap& map,
    bool throwIfNotImplemented
    );

Global Functions

PointCloudEigen mp2p_icp::estimate_points_eigen(
    const float* xs,
    const float* ys,
    const float* zs,
    mrpt::optional_ref<const std::vector<size_t>> indices,
    std::optional<size_t> totalCount = std::nullopt
    )

Calculate mean, covariance, eigenvectors, and eigenvalues from a set of points.

It is mandatory to provide one and only one of these two parameters:

  • indices : only the points with these indices will be considered.

  • totalCount : all points will be used, ignoring indices.

Parameters:

xs[in]

Input x coordinate vector.

ys[in]

Input y coordinate vector.

zs[in]

Input z coordinate vector.

indices[in]

0-based indices of points to consider from the vectors.

totalCount[in]

Total number of points in the vectors.

std::exception

If less than 3 points are provided.

mrpt::maps::CSimplePointsMap::Ptr mp2p_icp::load_xyz_file(const std::string& fil)

Loads a pointcloud from an ASCII “XYZ file”, storing an Nx3 matrix (each row is a point). If the filename extension ends in “.gz”, it is uncompressed automatically.

const mrpt::maps::CPointsMap* mp2p_icp::MapToPointsMap(const mrpt::maps::CMetricMap& map)

Function to extract the CPointsMap for any kind of CMetricMap, if there exists a conversion that makes sense for matching against it. Typically:

  • Any derived type of mrpt::maps::CPointsMap: just does a dynamic_cast.

  • An mrpt::maps::CVoxelMap: gets the equivalent points map with cached occupied voxels (requires MRPT >=2.11.0).

Returns an empty shared_ptr if conversion is not possible.

The use of raw pointers here imply the lifetime of the input “map” must be longer than that of its use within the Matcher.

const mrpt::maps::NearestNeighborsCapable* mp2p_icp::MapToNN(
    const mrpt::maps::CMetricMap& map,
    bool throwIfNotImplemented
    )

Returns the dynamic_cast<> of the metric map as a mrpt::maps::NearestNeighborsCapable. If the interface is not implemented it returns nullptr, or throws an exception if it throwIfNotImplemented is true.