Skip to main content
Version: dev-latest

Plex Command Overview

Usage

Plex - CLI Example
metrical plex <SUBCOMMAND> [OPTIONS]

Purpose

The metrical plex command is a suite of tools for working with Plex files at every stage of a calibration workflow. A Plex is MetriCal's core data model — an undirected acyclic graph that describes your sensor system's components (cameras, IMUs, LiDARs, etc.) and the spatial and temporal constraints between them.

metrical plex subcommands can be composed together via pipes or chained in a manifest, making it easy to build up, inspect, modify, and transform Plexes in a scriptable way. Most subcommands read a Plex from a file path or from stdin, and write the result to a file path or to stdout.

Replacing Init Mode for Plex Creation

The metrical plex learn and metrical plex new subcommands supersede the metrical init command for plex creation and initialization from datasets. Init mode is still available, but is now soft-deprecated. New workflows should prefer the plex subcommands.

Subcommands

Subcommand
Purpose
newConstruct a new, default, empty Plex.
learnLearn components and constraints from a dataset and/or system specification.
addAdd a default component, spatial constraint, temporal constraint, or formation to a Plex.
copyCopy a Plex, optionally regenerating UUIDs or renaming component topics.
filterKeep only the specified components (and their associated constraints/formations) in a Plex.
focusConvert a Plex into a hub-and-spoke Plex, with all components connected to one focus component.
getPretty-print a specific component, spatial constraint, or temporal constraint from a Plex.
listList components, spatial constraints, temporal constraints, or formations in a Plex.
mergeMerge two Plexes together via union, intersection, or complement.
mstConvert a Plex into its Minimum Spanning Tree representation.

Common I/O Conventions

All metrical plex subcommands that accept an input Plex support reading from either a file path or stdin. Likewise, all subcommands that produce an output Plex support writing to either a file path (via -o/--output) or stdout. This makes it easy to compose subcommands using pipes:

# Filter to only camera components, then focus around a specific camera
metrical plex filter -c /camera/1 -c /camera/2 input.json \
| metrical plex focus /camera/1 -o focused.json

When used in a manifest, each subcommand's input and output paths are specified explicitly in the stage configuration (see each subcommand's page for the manifest example).

Component Identifiers

Many metrical plex subcommands accept a component identifier, which can be either:

  • A topic name string (e.g., /camera/1, imu_left)
  • A UUID string (e.g., 77776666-0000-0000-0000-000000000000)