Plex Command Overview
Usage
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.
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 |
|---|---|
new | Construct a new, default, empty Plex. |
learn | Learn components and constraints from a dataset and/or system specification. |
add | Add a default component, spatial constraint, temporal constraint, or formation to a Plex. |
copy | Copy a Plex, optionally regenerating UUIDs or renaming component topics. |
filter | Keep only the specified components (and their associated constraints/formations) in a Plex. |
focus | Convert a Plex into a hub-and-spoke Plex, with all components connected to one focus component. |
get | Pretty-print a specific component, spatial constraint, or temporal constraint from a Plex. |
list | List components, spatial constraints, temporal constraints, or formations in a Plex. |
merge | Merge two Plexes together via union, intersection, or complement. |
mst | Convert 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)