Application: sm2mm

Convert a *.simplemap file into a *.mm metric map using a pipeline configuration.

Synopsis

The sm2mm command-line tool is a utility from the mp2p_icp project designed to transform a “simple map” file - a key-frame map typically generated by a SLAM system with the .simplemap extension - into a “metric map” file (.mm extension). Recall that metric maps in mp2p_icp can have multiple map layers. This conversion is performed by applying a user-defined processing pipeline, specified in a configuration file, to the simple map data.

This tool is for post-processing SLAM outputs, enabling the generation of detailed and structured metric representations of the environment suitable for various applications, such as navigation, visualization, or further geometric analysis.

Note

Pipeline files are explained in this page, together with examples.

Geo-referencing support

If a geo-referencing file is supplied via --georef, sm2mm will transform every robot pose into the ENU (East-North-Up) frame before passing it to the generators. Concretely, if T_enu_to_map is the SE(3) transformation read from the georef file, the effective pose used for each keyframe is:

\[\mathbf{p}_\text{ENU} = T\_\text{enu\_to\_map} \oplus \mathbf{p}_\text{local}\]

The output .mm file is then tagged with the same georeferencing metadata, except that T_enu_to_map is reset to the identity pose (the covariance is preserved), because the map points are already expressed in ENU coordinates and no further correction is required at query time. The geodetic reference point (geo_coord) is copied verbatim from the input file.

The georef file can be:

  • A binary *.georef file (MRPT serialization + gzip), as produced by mm-georef --extract-from-map.

  • A YAML file (*.yaml / *.yml), also compatible with the mm-georef tool.

Typical workflow:

# 1. Build the map in ENU coordinates directly:
sm2mm -i my_slam_result.simplemap -o my_map_enu.mm \
      -p pipeline.yaml --georef my_map.georef

# 2. Inspect the result - the stored T_enu_to_map will be Identity:
mm-info my_map_enu.mm

CLI Reference

USAGE:

sm2mm  [--decimate-max <N>] [--decimate-nth <N>] [--to-index <0>]
        [--from-index <0>] [--permit-missing-externals] [--profiler]
        [--no-progress-bar] [--externals-dir <<ExternalsDirectory>>]
        [--compression-method <METHOD>] [-v <INFO>] [-p <pipeline.yaml>]
        [-l <foobar.so>] [-g <(myMap.georef|myMap.yaml)>]
        -o <out.mm> -i <map.simplemap> [--] [--version] [-h]


Where:

-g <(myMap.georef|myMap.yaml)>,  --georef <(myMap.georef|myMap.yaml)>
    Optional geo-referencing file (binary ``*.georef`` or YAML
    ``*.yaml``/``*.yml``) providing the SE(3) transformation
    T_enu_to_map and the geodetic reference coordinates. When supplied,
    robot poses are expressed in the ENU (East-North-Up) frame before
    being passed to the generators, and the output .mm file is tagged
    with the georeferencing metadata (T_enu_to_map set to identity,
    since the map is already in ENU coordinates).

--decimate-max <N>
    Try to evenly pick at most N frames

--decimate-nth <N>
    Only process every N-th frame

--to-index <0>
    If provided, the simplemap keyframes will be processed up to this
    index only.

--from-index <0>
    If provided, the simplemap keyframes until this index will be
    discarded and it will start at this point.

--permit-missing-externals
    If set, missing external files will generate a warning instead of an
    exception stopping the processing.

--profiler
    Enables profiler.

--no-progress-bar
    Disables the progress bar. Useful for cleaner output when using DEBUG
    verbosity level.

--externals-dir <<ExternalsDirectory>>
    Lazy-load base directory for datasets with externally-stored
    observations

--compression-method <METHOD>
    Compression method to use in the output metric map .mm file. Options:
    CompressionType::None|CompressionType::Gzip|CompressionType::Zstd.
    (Default: CompressionType::Zstd)

-v <INFO>,  --verbosity <INFO>
    Verbosity level: ERROR|WARN|INFO|DEBUG (Default: INFO)

-p <pipeline.yaml>,  --pipeline <pipeline.yaml>
    YAML file with the mp2p_icp_filters pipeline to load. It can
    optionally contain a ``filters:``, a ``generators:``, and a
    ``final_filters:`` sections. If this argument is not provided, the
    default generator will be used and no filtering will be applied, which
    might be ok in some cases. See the app README for examples:

    https://github.com/MOLAorg/mp2p_icp/tree/develop/apps/sm2mm

-l <foobar.so>,  --load-plugins <foobar.so>
    One or more (comma separated) ``*.so`` files to load as plugins, e.g.
    defining new CMetricMap classes

-o <out.mm>,  --output <out.mm>
    (required)  Output .mm file to write to

-i <map.simplemap>,  --input <map.simplemap>
    (required)  Input .simplemap file

--,  --ignore_rest
    Ignores the rest of the labeled arguments following this flag.

--version
    Displays version information and exits.

-h,  --help
    Displays usage information and exits.