Skip to content

dotbot/calibration: name the spin calibration to append to instead of a placed one - #343

Open
geonnave wants to merge 2 commits into
DotBots:mainfrom
geonnave:spin-append-placed-hint
Open

geonnave wants to merge 2 commits into
DotBots:mainfrom
geonnave:spin-append-placed-hint

Conversation

@geonnave

@geonnave geonnave commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Based on main. #344 (place --to-calibration) stacks on this one.

Problem

calibrate-lh2 collect --spin --append ID rightly refuses a calibration already placed on a site (its frame is the site's, and a re-solve would not keep it), but the error only said "append to the spin calibration it was made from", leaving the operator to find which one. On the bench that meant reading anchors by hand, and the anchor can mislead: a calibration aligned into a site init site carries that site's anchor, which names the site's original spin calibration, not the one it was actually moved from.

Change

  • A placed calibration records placed_from = "<id>" in [metadata]: the full id of the free-frame calibration it came from. site init sets it. It is outside the id hash, like tag, since it moves no position.
  • The refusal now names that calibration and, when its file is found under any site, the flags to use: ...: it was placed from spin calibration 4414d748, so append to that one (--append 4414d748 --site virmond-rooms).
  • Files written before this have no placed_from; for those the self-defined from spin calibration <id8> anchor that site init writes is the fallback, worded as "its site was defined from spin calibration ..." since that is all it proves.
  • show --next-round shares the check, so it gets the same message.

Validation

Unit, both through the CLI with a faked swarm: a site init-placed calibration refused with the source id and --site c405, and nothing sent to the robots; the same file with placed_from stripped falls back to the anchor. Full suite: 1789 passed, 2 failed that fail identically on the base commit in this environment (test_camera_service::test_a_registration_without_controls_warns_about_nothing, and test_controller_dotbot_simulator, which could not bind its port). Not run on hardware. Formatting is deferred to the pass after review.

File + -
dotbot/tests/test_calibration_spin.py +41 -0
dotbot/calibration/multi_station.py +20 -4
dotbot/calibration/lighthouse2.py +14 -0
dotbot/calibration/conics.py +4 -1
Total, 4 files +79 -5

@codecov

codecov Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.57%. Comparing base (7a76840) to head (9ddf837).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #343      +/-   ##
==========================================
+ Coverage   88.56%   88.57%   +0.01%     
==========================================
  Files         230      230              
  Lines       37623    37650      +27     
  Branches     2367     2367              
==========================================
+ Hits        33319    33347      +28     
+ Misses       4300     4299       -1     
  Partials        4        4              
Flag Coverage Δ
console 82.18% <ø> (ø)
python 91.45% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
dotbot/tests/test_calibration_spin.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@geonnave
geonnave force-pushed the spin-append-placed-hint branch from 018521f to 9ddf837 Compare October 16, 2026 14:38

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant