# Calibration and spatial alignment

> Put every camera in your robot's base frame, check the error, and keep calibration in sync with each run.

Source: https://rayform.world/docs/engine/calibration
Last updated: 2026-10-19
Status: Rayform is in private preview. The edge engine is in development with preview teams, and commands, formats and APIs described here may change before general availability.

Training on multi-camera data assumes you know where each camera is. Hand-tuned extrinsics drift as mounts get bumped, and the model sees the error as noise. Rayform keeps calibration as data: measured, versioned, checked and attached to every run.

## Calibrate

Static cameras are calibrated against a ChArUco board; wrist cameras with a hand-eye routine while the arm moves through a set of poses.

```bash
rayform calibrate intrinsics --camera front
rayform calibrate extrinsics --rig rig.toml --board charuco_7x5_40mm
rayform calibrate hand-eye --rig rig.toml --camera wrist_left --poses 20
```

Each command writes a new calibration version and prints its residual error:

```text
front      → base_link   reprojection 0.31 px · 3D residual 1.6 mm
wrist_left → tool0       reprojection 0.42 px · 3D residual 2.1 mm
```

Accuracy depends on your cameras, board and setup; the residual is reported so you can decide whether it is good enough rather than assume it.

## Check for drift

```bash
rayform calibrate verify --rig rig.toml
```

Verification compares the current views with the stored calibration and flags cameras that have moved. `rayform check` also warns when a run's depth disagrees with the calibration more than usual.

## Using calibration

- Every run stores the calibration version it was captured with.
- `rayform export --frame base` writes camera poses and, on request, point clouds in the base frame.
- Recalibrating never rewrites old runs; export a run again to apply a newer calibration.
