Skip to main content
MCAP episodes place each camera in the transform tree. Without a camera calibration, those positions come from CAD. Calibrate cameras measures where the head camera and each wrist camera sit on your Axol, and how far some arm joints read from their true angle. It saves the result, and episodes use it from the next episode on. Calibrate after you fit the Camera Kit, and after the arms are zeroed. Calibrate again after you move, remount or replace a camera, or after an arm is re-zeroed. Each calibration records which joint zeroing each arm was on. When an arm is re-zeroed later, its episodes still use the calibration, but their metadata and axol mcap.check say the arm was re-zeroed.

What you need

  • Axol with the Camera Kit, with the head and wrist cameras assigned in the control panel’s camera layout.
  • A calibration board (see below).
  • A clear table in front of Axol, in view of the head camera.
  • About 30 minutes.

The board

Use a bought ChArUco board on a rigid, flat plate: Give the board’s ID when you calibrate, for example --board.id CB-0042. Use the ID printed on the board, or one you write on it. Each calibration records it. Replace a board that is warped or damaged. When you calibrate, pick the board in Board. For a board of another size, pick Other size and enter Squares across, Squares down, Square size (mm) and Marker size (mm). On the command line, use --board.squares_x, --board.squares_y, --board.square_mm and --board.marker_mm. To try the tool before your board arrives, download a board and print it at 100% (actual size): Check that one square measures 30 mm, then glue the page flat onto something stiff. Write an ID on it for Board ID. Don’t use a printed board for a calibration your episodes rely on: paper bends and printers scale. To print a board of another size, run axol calibration.cameras --print_board ~/calibration_board.pdf on the robot with --board.paper (letter, a4 or a3) and the size options.

Calibrate

The session makes two separate recordings, both recorded like Collect data, with the same cameras, image mode and encoder:
  • Recording A is for fitting.
  • Recording B is for testing. It repeats the same kinds of motion with different poses and a different board placement.
Each recording has two parts. First you move the board in front of the head camera. Then the board lies on the table while each arm moves its wrist camera around it on its own. The arms only move on their own above the table. You lift them above it by hand at the start and lower them at the end. In between, every part of each arm keeps at least 10 cm from the table and from the robot’s head. Between views, an arm goes up, across and down. The run doesn’t know about other objects, so keep people and objects clear of the arms, and keep a hand near the E-Stop.
  1. Park the base, and leave the lift or the Ox Cart’s height where it is for the whole session.
  2. In the control panel, open Diagnostics, then Tests and helpers, and click Calibrate cameras. Type the board’s ID in Board ID, pick the board in Board and press Run.
  3. Lay the board flat on the table, about 40 cm in front of the robot, with nothing else near it. Leave the arms where they are and press Continue. The head camera measures the table and checks the board’s size.
  4. The arms float. Lift both arms by hand until each gripper is at least 20 cm above the table, clear of the board and away from the robot’s head. They stay where you leave them. Press Continue. The run checks that they are clear, then moves them to a raised pose.
  5. Hold the board in front of the head camera, 40 to 80 cm away, and press Start. Move it slowly to every part of the camera’s view, near and far, and tilt it toward the camera from each side. Pause about a second at each spot. The run panel shows how many spots the head camera has and what it still needs, such as tilts from more sides or the board farther out on the robot’s left. It says when there are enough.
  6. When the run asks, lay the board flat on the table in front of the robot and press Continue. The run finds it with the head camera, then moves the left arm, then the right arm, through poses around it. If a wrist camera hasn’t seen the board in enough parts of its image, that arm adds a few poses aimed at the parts it missed.
  7. Recording A asks for a second spot on the table. Put the board somewhere else, at another angle, and press Continue.
  8. Recording B repeats steps 5 and 6 with one board spot.
  9. The arms float. Lower them to the rest pose by hand, then press Turn off arms. The run checks the recordings and prints the result.
Keep your hands and body out of the head camera’s view of the board while the arms move. When the run stops early, the arms float before they turn off: Nothing is saved when the run stops early. If the run ends after both recordings but before the result, you can check the recordings again without redoing them. The run prints the folder they’re in (“Both recordings are saved in …”). On the robot, run this with that folder and the same board settings as the run:
For Other size, give the four sizes instead of --board.size: --board.squares_x, --board.squares_y, --board.square_mm and --board.marker_mm. It saves the calibration when every check passes, as the run does. --recordings also takes a finished run’s evidence package folder, for example to check a run again with a changed limit. That package keeps its recordings, and the new package shares them without using more disk space. On the command line, run axol calibration.cameras --board.id <your board's ID> on the robot. Each step then asks you to press Enter.

Read the result

The camera positions are fitted on Recording A only, then locked. Recording B is checked with those values held fixed. B is also fitted on its own, to check the result repeats. Each camera’s lens and the head camera’s stereo transform are the cameras’ factory values. A calibration passes only if every check passes: The wrist cameras’ views are predicted through the arm’s joint angles, so their error includes how closely the arm reaches each pose, not only the lens. That is why their limits are wider. Their corners within 3 px and outer-image error are reported but not judged. The factory intrinsics check holds every lens, the wrist cameras’ included, to 0.5 px. The factory intrinsics check must pass too. Change a limit with --checks.<name>, for example --checks.wrist_median_px 1.5. The reprojection RMS and the head camera’s epipolar residual are reported but not judged. So is the arm accuracy check, unless you set its limits. When every check passes, the tool saves the calibration to ~/.almond/camera_calibration.json. When a check fails, nothing is saved, and the previous calibration stays in use:

Joint offsets

A joint can read a degree or so away from its true angle, even right after it is zeroed. At the wrist, that moves the camera by millimetres, and by a different amount in every arm pose. So the calibration also measures a zero offset for shoulder 2, shoulder 3, the elbow, wrist 1 and wrist 2 of each arm. Shoulder 1 and wrist 3 get no offset, because the board views can’t tell their offsets apart from where the board or the camera sits. The offsets are fitted on Recording A together with the camera positions, then checked on Recording B the same way. The result lists each one as joint offset, with the value Recording B gives on its own. An offset over 5 degrees fails the calibration, because it means the joint was zeroed in the wrong place.

Factory intrinsics check

Each camera’s lens values and the head camera’s stereo transform come from the cameras’ factory calibration. Each calibration checks them on Recording B, with the factory values held fixed:
  • For each view, the board’s position is fitted to that view alone. The error then tests the lens, not the joint angles or the camera mounts.
  • The head camera’s eyes are checked against each other through the factory stereo transform.
The numbers and PASS or FAIL are saved as intrinsics_validation in package.json and in the calibration file. Episodes record the result in their calibration metadata.

Arm accuracy check

Each calibration checks how well the joints place each gripper’s tool point (left_tcp and right_tcp). It uses Recording B, with the values from Recording A held fixed:
  • The head camera’s two eyes find where the board lies on the table. The arms play no part in this.
  • Each wrist camera’s view of the board gives where that camera is. The camera’s fitted mount then gives where the tool point is.
  • The joints give the tool point too: the joint readings plus the joint offsets, through the URDF.
The check compares the two tool poses in the root frame, over every wrist view in Recording B. It reports the errors without a limit. To judge them, set the limits your application needs. For example, --checks.arm_translation_rmse_mm 10 --checks.arm_rotation_rmse_deg 5 fails a calibration when an arm’s tool point is more than 10 mm or 5 degrees RMS off, or has fewer than 10 wrist views (--checks.arm_samples). The numbers are saved as arm_accuracy in package.json and in the calibration file. Each arm’s entry lists the frame, the tool point, the number of views, and the RMS, 95th percentile and largest errors. The result is MEASURED without limits, or PASS or FAIL with them. Episodes record the result in their calibration metadata. Each calibration gets an ID of the form <robot serial>-<date>-<run>, such as E66138528F2B3F2A-20261201-01. Its evidence package is a folder named by the ID, in ~/.almond/camera_calibration/. The package is kept whether the calibration passed or failed. It holds: Keep each package with the episodes recorded under that calibration.

How episodes use the calibration

At the start of every episode, Collect data reads ~/.almond/camera_calibration.json. It uses the file only when it passed and names this robot. The robot is named by its Axol hub serial.
  • Each measured camera is placed from the file. A lookup between the two frames in the file gives the file’s values.
  • The file’s joint offsets are added to every arm joint position the episode writes: /joint_states, the arm joints on /tf, and /ee_pose. Commands are written as they were sent. The joint_offsets_rad metadata lists the offsets, so you can recover the raw readings.
  • A camera that was swapped after calibrating keeps its CAD position until you calibrate again.
  • A calibration stays in use until you replace it. To make calibrations expire, for example to enforce a recalibration schedule, run axol calibration.cameras with --valid_days. The file then gets a due_at time, and after it episodes use the CAD positions until you calibrate again.
  • Without a usable file, episodes use the CAD positions. When you start Collect data, it says why the file isn’t used.
The episode’s calibration metadata says which calibration was used and where each transform came from. See Camera mounts.

Try the procedure in the sim

axol calibration.cameras --sim true runs the whole procedure on the sim’s robot, with no robot attached. The sim’s cameras sit a few millimetres from CAD, and the result says how close the calibration came to their true positions. Its packages are in ~/.almond/camera_calibration/sim/. Nothing is saved as this robot’s calibration. The sim run takes about 40 minutes on an 8-core computer, most of it rendering video. --sim_workers sets how many processes render.

Quick check by hand

axol calibration.cameras --hand_guided true is a shorter session without the two recordings or an evidence package. The arms go limp, and you move each wrist camera around the board by hand. It saves a calibration when every camera passes its own checks: enough views, an average error of 3 px or less, and within 25 mm and 6 degrees of CAD. Every run keeps a report folder, ~/.almond/camera_calibration/run-<time>/, and --from_report <folder> solves a saved run again without the robot.

Use your own calibration

You can measure the cameras another way, for example with motion capture, and write the file yourself. Collect data reads any file in this form:
  • robot_serial is the robot’s Axol hub serial, the robot.serial value in any MCAP episode it recorded.
  • Each transform gives the child frame’s pose in the parent frame: the translation in metres and a unit quaternion in x, y, z, w order.
  • The parent must be fixed to the child, with no moving joint between them.
  • camera_serial is optional. When it is set, the transform applies only while that camera is fitted.
  • due_at is optional. When it is set, the file isn’t used after that time.
  • joint_offsets_rad is optional. It gives a zero offset in radians for any arm joint, by its /joint_states name. Episodes add it to that joint’s position. Each offset must be 10 degrees or less.
  • Frame names can be the defaults below or the names you set in MCAP frame names.
  • List only the frames you measured. Every other frame comes from the URDF.
Optical frames have z forward out of the lens, x to the right and y down in the image. The right head eye follows the left eye by the head camera’s factory stereo calibration, unless the file also lists head_camera_right_optical.