Skip to main content
Version: dev-latest

My First Workflow

Users can find workflow scripts and sample datasets in the MetriCal Sensor Calibration Utilities repo on GitLab:
https://gitlab.com/tangram-vision/platform/metrical/-/tree/main/examples

0: Measure Your Objects

MetriCal relies on fiducials to calibrate your system, things like markerboards and circular targets. These objects must be measured (in meters!) and described accurately in your object space JSON before kicking off any calibrations.

Learn more about how to describe object spaces at the object space overview. If you're confused about what a key means in the object space JSON, every fiducial is lovingly described at the fiducials overview.

1: Initialize MetriCal

A plex is a virtual snapshot of your system's calibration at a point in time. Init creates a raw input plex by inferring it from the data it is given. We'll optimize this plex, and this data, using Calibrate later.

metrical init \
--topic-to-model *cam*:opencv_radtan \ # Every topic with "camera" string gets the RadTan model
--topic-to-model *lidar*:no_offset \ # Every topic with "lidar" string gets no model
--topic-to-model *imu*:scale_shear \ # Every topic with "imu" string gets Scale-Shear model
$DATA \ # Provide our data
$INIT_PLEX # Our output: a fresh plex!

More on...

2: Calibrate the Initial Plex

The actual calibration! This refines the plex, giving you accurate calibation values. We'll visualize detections by passing the --render flag. Make sure you have a Rerun instance running!

metrical calibrate            \
--render \ # Render the calibration process using Rerun
--output-json $OUTPUT \ # Write the results to $OUTPUT
$DATA \ # Our input calibration dataset
$INIT_PLEX \ # Our fresh plex from Step 1
$OBJ \ # Our object space file describing fiducials and targets

More on...

3: Render the Results

Display mode shows us what the calibration looks like when applied to a dataset. Usually, you'll just apply it to the same dataset you used for calibration, but you can pass in any dataset that uses the same topic names. Make sure you have a Rerun instance running!

metrical display $DATA $OUTPUT

4: Shape the Plex Output

This shapes the calibration output into something more useful for our system. In this case, we want to create a stereo rectification for our system.

metrical shape       \
$OUTPUT \ # Use the calibration output we derived from Step 2
$OUTPUT_DIR \ # Write the results to $OUTPUT_DIR
stereo-lut \ # Create a pair of stereo rectification lookup tables
--dominant ir_one \ # The dominant eye in this stereo pair
--secondary ir_two \ # The secondary eye in this stereo pair

More on...