Rome
All guides
Intermediate20 min

Calibrating sensors you can trust

Raw sensor data lies a little. Learn to calibrate your camera and IMU so downstream planning has a clean world model.

Every planner is only as good as the world model it's handed. In the teleop loop guide you streamed raw telemetry — now we make it trustworthy.

Why calibration matters

An uncalibrated camera reports objects in the wrong place. An uncalibrated IMU drifts. Individually these are small errors; compounded through a planning horizon, they steer a robot into a wall.

1. Capture a calibration set

Point the robot's camera at a known target and capture frames from several angles:

rome calib capture --sensor camera --target checkerboard-9x6

Aim for at least 20 frames covering the corners of the field of view, not just the center.

2. Solve for the intrinsics

Run the solver. It estimates focal length, principal point, and distortion:

rome calib solve --sensor camera --out camera.calib.json

A good solve reports a reprojection error under one pixel. If yours is higher, capture more varied frames and try again.

3. Apply and verify

Load the calibration and confirm straight lines in the world look straight in the corrected image:

robot.sensors.camera.loadCalibration("camera.calib.json");
const frame = await robot.sensors.camera.grab({ undistort: true });

A calibration checklist

  • 20+ frames across the whole field of view
  • Reprojection error under 1px
  • Straight edges stay straight after undistortion
  • Re-run after any hardware change

With clean perception in place, you're ready to deploy to a fleet.