Skip to content

RFC-0034: Onboarding a robot (commissioning), calibration procedures that write its error budget into the profile

Status: Accepted by the operator on 2026-12-03, as revised ("accepted revisited 034"); steps 1 and 2 wait for the assessment on the challenges 29 to 31 baseline (docs/wip/OBSERVATORY-ROADMAP.md) Date: 2026-12-03 Revised: 2026-12-03, after ADR-0030 and its floor were built; the operator's three decisions (the terms' shape, their names, the floor's basis) and what else changed are in section 9. Builds on: RFC-0020 (one profile per robot, a variant per environment, every measured number with measured and why), RFC-0012 §2.3 (each robot's calibration supplies the numbers, the error budget among them), libs/runner/CONTRACT.md 1.3 (the navigator API's calibration.*), ADR-0027 (simulator first), ADR-0030 (scenes from the error budget). Asked by the operator, 2026-12-03: "we have an opportunity to develop a little methodology on how to onboard a robot ... how do we materialize the results of these learnings? I feel it should be part of the profile ... we have to have 2 calibration sets per robot, once in sim, once in the physical world." Evidence: read at 1c8b548: robots/duck/profile.json, libs/runfile/src/runfile/profile.py (validate_profile, merge_variant), robots/duck/src/duck_lab/nav/calibration.py, CONTRACT.md 1.3. What I did not verify is in section 8.

1. Motivation

What the lab has learned about the duck's errors since 2026-11-14 sits in three places: some numbers in the profile with their measured text (odometry, the pivot's in-place rotation drift per full turn, the depth sensor's mount), most in docs/wip/LEARNING-ARC-FINDINGS.md prose, and the scripts that measured them in session scratchpads. ADR-0030 needs those numbers to set which scenes gate milestone A, and a hand-copied number in an ADR goes stale the day a term shrinks. A second robot, or the real duck, would start from nothing: no list of what to measure, in what order, or against what reference.

2. What exists

Piece Where State
One profile, a variant per environment profile.json variants: {sim, real}, merge_variant built; real is empty
A strict validator runfile.profile: unknown fields are errors at every level; a number a variant changes needs measured and why in its block built
The error_budget block profile.json (base): 14 derived margins and rings (cliff_stop_m, corridor_m, drop_lethal_m, ...) built; RFC-0020 meant them "derived from" the following error, localization error p95, in-place rotation drift and corner cutting, and those measured terms never landed in it
Calibration motions navigator API calibration.* (nav/calibration.py STEPS) built; one motion, odometry_scale
The reference the runner adds the host's ground truth ({by, distance_m, from, to}, a distance); on a real robot the operator's tape built for odometry_scale only
Keeping a value Mission Control's keep: the operator keeps or discards, and it saves a new profile version (profiles.save) built for odometry_scale; it does not change the committed profile.json, whose variants.sim numbers are edited by hand
The error terms ADR-0030 uses variants.sim.error_budget.terms (built 2026-12-03): the floor and three measured terms as plain numbers, one measured and one why for all four; observatory clearance gives the normal and cross-track errors (pooled over ticks) and each run's plan loss, but not the plan loss's statistic, the p95 over runs of each run's p95 (computed outside the tool) built, in a flat shape; the floor kept by the operator as the terms' value, not measured. Since step 2 (2026-12-03): a record per term (section 3.1).
The scene generator reading the floor labrunner.challenges.floor_clearance_m (the sim variant), challenges 29 to 31 drawn from it built (step 5)

The shape is right: a procedure measures, a reference gives the ground truth, the operator keeps it, the value lands in the variant. What is missing is one shape for a term with its own source, the terms not measured yet, the characterization tests that measure a term over many runs rather than one calibration motion as committed tools, the order, and which store the physical robot's kept values go to (open question 2; the simulator's is answered).

3. Proposal

3.1 The measured terms, inside error_budget

error_budget keeps its 14 derived margins, unchanged (ADR-0030 decision 3), and its sub-block terms holds the measured quantities the margins and the floor are compared with: one shape for every term, so a reader needs no per-term code, and each term with its own source, so re-measuring one shows which others predate a change (section 3.5). The simulator's variant, abridged:

"variants": {"sim": {"error_budget": {"terms": {
  "plan_loss_m": {"value": 0.113, "stat": "p95 over runs of each run's p95, ticks within 0.30 m; n runs",
                  "n": 192, "procedure": "clearance", "measured": "2026-12-03, ...", "why": "..."},
  "min_passage_width_m": {"value": 0.46,
                          "stat": "derived: 2 x (footprint.reach_m + plan_loss_m), to the nearest 0.01 m",
                          "n": null, "procedure": null, "measured": "kept by the operator ...",
                          "why": "..."},
  "rotation_drift_m": {"value": null, "stat": null, "n": null, "procedure": "rotation_drift",
                       "measured": "not measured", "why": "..."}
}}}}
  • value is a number or null (not measured); stat says which statistic it is (p95, mean, max, a procedure's own rule) and what n counts (runs, or ticks when pooled), or, for a derived term, derived:, its formula over other profile paths and its rounding; n that count (null when derived or not measured); procedure which one measures it (null when derived).
  • A term is a schema sub-block in runfile.profile, not a leaf kind: the validator then walks into it, so its fields are checked by kind (value and n optional numbers; stat and procedure optional strings, a kind _leaf does not have yet) and a variant's changed value needs measured and why in the term itself, not in the terms block. The validator's present rule (a number a variant changes needs both) does not reach a null value or the base block, so step 1 adds a rule of its own: every term, in the base or a variant, has its own measured and why, and every one of its four fields, null or not. A variant's term is then always whole, so merging it field by field over a base term cannot leave the base's stat or n under the variant's value.
  • The shape is profile_version 2. Version 1's block (a number per term, one measured and why for all) turns each number leaf into a sub-block, which runfile.profile says needs a version (removing a field does): MIGRATIONS[1] turns each number into a term with that value, the block's measured and why copied into each and then removed from the block, and stat, n and procedure null. A stored version-1 file keeps its identity (the checksum is of the file as stored, the operator's decision b). Superseded (the operator, 2026-12-03, ADR-0034): only version 2 is read. The old files were converted once (none had a terms block, so the number alone changed); upgrade and MIGRATIONS are removed. The step 1 notes below describe what was built first.
  • Terms are named after the statistic actually computed (the operator, 2026-12-03): plan_loss_m (the plan's clearance less the ground truth's, per tick near an obstacle), normal_error_m (the belief's clearance less the truth's: the localization error normal to the nearest obstacle, the part a door reads), cross_track_m (the belief's distance from the plan in force, the path-tracking error); not measured yet, map_discretization_m (the occupancy grid's discretization error) and rotation_drift_m (in-place rotation drift). The plan loss contains the map's and the localization's error; it is not their sum. No measured term is derived from another; the floor is (below). The lateral localization error was measured too (0.097 m p95, pooled, docs/wip/LEARNING-ARC-FINDINGS.md) but is not a term: a door reads the part normal to the obstacle, normal_error_m.
  • The base block has no terms (the real duck has none measured); variants.sim carries the simulator's, variants.real none until the physical round. Numbers already elsewhere (the circumscribed radius walking, footprint.reach_m; the odometry scale) are named in a formula, not copied.
  • The floor, min_passage_width_m, is recorded as derived (the operator, 2026-12-03): twice the reach plus the plan loss, 0.461 m, kept as 0.46 m. The traversability sweep passed 12 of 12 at every gap down to 0.40 m, so it placed no edge (ADR-0030, "Built"). The floor becomes measured when a sweep finds a gap under 9 of 12; it is then compared with the terms, and a measured floor well above the derived one names a rule that does not read width. Until then the floor is the terms' value, not the robot's measured limit.

3.2 Two kinds of procedure

  • Calibration motions: one scripted motion, one number, through calibration.*. One exists. A new one is not free: rotation_drift measures a lateral offset, not a distance, so it needs a step list in the navigator (STEPS), a rule in Mission Control (RULES), and a reference the runner pairs for an offset (CONTRACT 1.3 defines a distance only).
  • Characterization tests (new): a batch of challenge runs on a named calibration course, then an analysis over their records that writes one term. Each names its course (challenge, seeds, a set parameter such as --gap-m), its run count, its statistic, its rule for a sound batch (rtf, ground truth paired), and the term it writes. ADR-0030's sweep was the first run of one, by hand: traversability, challenge 24 with its gap set, 12 seeds a gap. It wrote nothing (every gap passed, section 3.1); it writes min_passage_width_m once it places the edge.

A characterization test runs under the simulator lock (today a script around lab-challenge); its analysis is a committed tool with a test on recorded runs, not a scratchpad script. Its result goes to the operator as a proposed change to the profile with the numbers behind it.

3.3 The commissioning ladder

In order; each step's procedure assumes the ones before it:

  1. Body: footprint, circumscribed radius (walking), overhead clearance (from the model's meshes in the simulator; a tape on the real robot).
  2. Odometry scale (odometry_scale, calibration motion; built).
  3. In-place rotation drift (rotation_drift, calibration motion).
  4. Depth sensor mount: pitch offset and range kind (today sim/probes/floor_fit.py; becomes a characterization test on flat floor).
  5. Map discretization error (map_discretization_m, characterization test; not measured): the map's room against the ground truth's beside known walls.
  6. The plan loss and the localization error near obstacles (plan_loss_m, normal_error_m, characterization test clearance): over runs, ticks within 0.30 m of an obstacle. Measured once, over baseline A's runs, not on a named course: the normal error by observatory clearance, the plan loss's statistic outside it (section 2).
  7. Cross-track error (cross_track_m, the same test): the belief against the plan in force.
  8. Traversability (traversability, characterization test): the floor (minimum passage width). Derived today (section 3.1); measured once a sweep places the edge, then compared with steps 1 and 5 to 7 (ADR-0030).

Then the robot's gating scenes (those inside its operational design domain, ODD) are drawn from its floor, and its milestones are run on them.

3.4 Two rounds: the simulator, then the physical robot

The ladder runs first in the simulator into variants.sim (ADR-0027), then on the physical robot into variants.real. The procedures and analyses are the same; the reference differs. In the simulator it is the host's ground truth. On a physical robot step 1 and the distance of step 2 can use the operator's tape (CONTRACT 1.3 allows it for a distance); steps 3 to 8 need the robot's true pose, which no physical host has today. That is open question 1.

3.5 When to calibrate again

A term is re-measured when what it depends on changes: the localiser or mapd's settings (5, 6), the follower (7), the locomotion plugin or the walker's policy (2, 3, 7), the body or the sensor's mount (1, 4). Each term's measured names the commit it ran at, so a review can see which terms predate a change. A derived floor is recomputed when a term in its formula moves. Its formula holds the plan loss, which contains the map's and the localization's error, so a shrink in either (ADR-0030 decision 7) moves the floor once the plan loss is measured again; the normal error alone does not. A measured floor is re-run after any term moves.

4. Steps, each with its test

  1. The schema: profile_version 2, the term as a schema sub-block with its own rule (section 3.1), and MIGRATIONS[1]; challenges.floor_clearance_m, the one reader in code, reads the term's value. Tests: the base and both variants validate; a variant's term is whole and replaces the base's; a term without measured, why or one of its fields is refused, a null one included; a version-1 profile with the flat block migrates and keeps its checksum; the committed floor equals its formula to its rounding. Tests and docs that read the path change with it: robots/duck/tests/test_profile.py (the version-2 refusal at its version check, the floor's value, the table of every profile number, which then lists each term's value and n), robots/duck/tests/test_challenge.py (the floor read as a number), and libs/runfile/tests/test_profile_schema.py, whose pretend version 2 clears MIGRATIONS in its finally without restoring it: with a real MIGRATIONS[1] that would break every later check in the process, so it is rewritten. docs/guides/command-line.md and docs/wip/PLATFORM-ROADMAP.md name the path. A version's diff (profilestore.diff) then shows n as a changed number. Done (2026-12-03): the terms are runfile.profile.TERM records under Terms, the six names of section 3.1 known; the terms block has no measured or why of its own; a version-1 block with none migrates with each term saying so (read, never refused). Two readers took a profile's checksum after migrating it, which would have changed the identity a run records of every version-1 file: duck_lab.profile.load and Mission Control's read_profile now hash the file as stored, and profile_of checks a profile about to be saved as migrated; profilestore.diff compares two versions as migrated, so a version-1 file and its migration differ in nothing. The committed profile.json stays at version 1 until step 2 rewrites its terms, so it is read through the migration meanwhile. Correction: test_profile_schema's finally did restore MIGRATIONS; it pretends version 3 now. New: libs/runfile/tests/test_profile_terms.py. After the advisor's review: a term's value is any number or null (it was refused at 0 or below), and its fields must agree (not measured: no stat or n; derived: no n or procedure).
  2. variants.sim.error_budget.terms rewritten as terms from the measurements already made: the shared measured split per term, each with its statistic, its count (192 runs for the plan loss; ticks for the pooled normal and cross-track errors) and commits; the floor derived; map_discretization_m and rotation_drift_m null. Done (2026-12-03): profile.json is version 2. The plan loss 0.113 (0.1127) over 192 runs, the normal error 0.089 (0.0893) and the cross-track error 0.060 (0.0597) each over 26,699 near ticks, all clearance; the floor derived: with its formula; rotation_drift_m names its procedure, map_discretization_m none (its test is not named). The counts are from a rerun of observatory clearance over baseline A's 211 runs, which now reports each error's own count (<kind>_n): every near tick had a plan in force, so the cross-track error and the plan loss are over all 26,699. The rerun's per-run figures equal the first run's. Found on the way: the pooled runs counted the 19 runs with no near tick (211, not 192); fixed.
  3. The characterization-test runner and the traversability analysis, tested on the sweep's records; observatory clearance named as the clearance test for steps 6 and 7, with the plan loss's statistic (the p95 over runs of each run's p95) added to it.
  4. Done differently (2026-12-03): the floor was written by the operator's keep to the committed profile.json (open question 2, the simulator's answer), as the terms' value, not from the sweep.
  5. Done (2026-12-03): the scene generator reads the floor (challenges.floor_clearance_m, the sim variant); challenges 29 to 31 are drawn from it. A physical robot's scenes are built on a floor, not generated.
  6. rotation_drift as a calibration motion: the navigator's steps, Mission Control's rule, the offset reference.
  7. The remaining characterization tests (steps 4 to 7 of the ladder), one at a time, each replacing a findings number.

5. Alternatives considered

  • Keep the numbers in the findings. Rejected: nothing reads them, they go stale, and a second robot inherits prose.
  • A new top-level block beside error_budget. Rejected: RFC-0020 already put the terms in error_budget ("the margins and rings are derived from it"); a second block would split what belongs together.
  • Keep item 6's flat block (a number per term, one measured and why for all). Rejected by the operator (2026-12-03): a term re-measured alone could not say so, and its statistic, run count and commits stay in a shared paragraph.
  • A separate calibration file per environment. Rejected: RFC-0020 replaced calibration/<robot>.json with the profile's variants for this reason.
  • Calibrate only on the physical robot. Rejected: the simulator round is where the procedures and analyses are made and tested, at no risk to hardware (ADR-0027).

6. Open questions

  1. The physical robot's reference for steps 3 to 8. Options: a measured course with taped marks and known box positions (positions only at the marks); an overhead camera with fiducials (whole runs; new hardware and a dependency); motion capture (costly). Not decided here; it matters when the physical round starts.
  2. Which store a kept value goes to. Mission Control saves profile versions; the repo's profile.json is edited by hand. Answered for the simulator: the committed profile.json (the operator kept the floor there, 2026-12-03), reviewed and versioned with the code it measured. Still open for the physical robot; recommendation: Mission Control's versions, until one path writes both.
  3. Do characterization tests go through Mission Control like calibration motions? Recommendation: yes, the operator keeps or discards every profile change, as for odometry_scale.
  4. One floor, or one per scene kind (a door, clutter)? One: challenges 29 to 31 (a door, a lattice, a box by a door) are drawn from the one floor (ADR-0030). It stands until a sweep on a second layout disagrees with the first by more than a bin.

7. What this does not change

The 14 derived margins in error_budget and the rules that use them (ADR-0030 decision 3), the calibration API's existing methods, and how a variant is chosen (the host's kind).

8. Not covered

  • The optional-string kind for a term's stat and procedure (_leaf in runfile.profile has none yet; step 1 adds it).
  • The plan loss's 0.113 m was computed outside any committed tool; observatory clearance gives each run's p95 and the pooled p95 (0.096 m), not the p95 over runs. Step 3 adds it; until then the number is not reproducible by a command.
  • How Mission Control would show a characterization test's result; its calibration page was not read.
  • The real duck's circumscribed radius, pivot and sensor: none measured (profile.json says so per number).
  • The cost of steps 4 to 7 in simulator hours.
  • Stores on other machines: this machine's was empty on 2026-12-03 and nothing was converted there. A store elsewhere with a version-1 file is refused by its reader until converted (ADR-0034).
  • The validator does not check a derived term's formula; step 1's test checks it on the committed profile only.

9. Revision (2026-12-03)

The RFC was written before ADR-0030's floor was built. Since then:

  • The terms' shape (the operator: per-term records). Item 6 wrote the terms as plain numbers with one shared measured and why; they become records under profile_version 2, with a migration (section 3.1, step 1).
  • The terms' names (the operator: the measured ones). plan_loss_m and normal_error_m are in the profile; the lateral localization error was measured (0.097 m p95, pooled) but is not the part a door reads, so localization_lateral_m is not a term. The RFC takes the profile's names and keeps map_discretization_m and rotation_drift_m as not measured (sections 3.1, 3.3).
  • The floor's basis (the operator: recorded as derived). The sweep placed no edge, and the operator kept 0.46 m as twice the reach plus the plan loss; the floor's record says so, and it becomes measured when a sweep finds a failing gap (section 3.1). ADR-0030 decisions 1, 2 and 7 carry notes to the same effect.
  • Steps 4 and 5 are done (section 4), and open questions 2 (for the simulator) and 4 are answered (section 6).