Skip to content

dotbot/cli: add calibrate-lh2 place --to-calibration - #344

Open
geonnave wants to merge 4 commits into
DotBots:mainfrom
geonnave:spin-place-to-calibration
Open

geonnave wants to merge 4 commits into
DotBots:mainfrom
geonnave:spin-place-to-calibration

Conversation

@geonnave

@geonnave geonnave commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #343 (spin-append-placed-hint at 9ddf837, itself based on main), for the placed_from field. Review the top two commits.

Problem

Strengthening a site's spin calibration means collecting more rounds in a free frame (in the site the spins were first collected in), then moving the result onto the site already in use, through a station both calibrations solved. That move was done with a scratch script: fit the turn and shift that map the new calibration's station-0 circle centres onto the old calibration's, apply it to every station, write the file.

Change

dotbot swarm calibrate-lh2 place SOURCE --to-calibration TARGET [--station N ...] [--tag T]

  • Every source circle a chosen shared station saw is mapped through that station's homography in each calibration (same raw reads, two frames); the mean of each circle's points gives one correspondence, and a least-squares rigid fit (Kabsch, no scale: both frames are metric through the spin radius) gives the move. It is applied to every source station.
  • The new file lands in TARGET's site with TARGET's anchor and fence as every station's rectangle, placed_from = SOURCE, tag <source tag>-<site> unless --tag.
  • It prints the turn, the shift and the residual over the circles, rms and max.
  • Refused: a SOURCE not in its own free frame, a free-frame TARGET, no shared station, a --station not in both, fewer than 3 circles. With several shared stations --station is required rather than picking all of them: a weakly tied station in TARGET would pull the fit, which is usually the reason for re-collecting in the first place.

Naming: place is the word the site editor uses for moving a spin calibration onto a site (#326), --to-calibration mirrors site init --from-calibration, and --station takes an index like --drop-station. It lives under swarm calibrate-lh2 beside show and reframe, which also only read and write files, and like them refuses dotbot swarm -d. #326's place_calibration does the same move from the console with a hand-set transform; once both land, the two can share one mover.

Validation

  • Unit: two synthetic stations, a spin calibration placed with site init, a second free-frame one from other robots, place through station 0: residual under 1 mm rms, a non-trivial move, and both stations then put every floor point in the overlap within 2 mm of the target's. Refusals covered too. Full suite: 1791 passed, the same 2 environment failures as on the base.
  • Bench data, read-only (copies of the files): place 05aea267 --to-calibration 04707621 --station 0 gives turn 89.216 deg, shift (3105.0, 2029.6) mm, 9 circles, rms 2.99 mm, max 6.07 mm, the same move as the script that produced e0897cfb. The homographies agree with e0897cfb to 1e-12; the id differs only through those last float bits. Through both stations the rms is 9.35 mm, which is why --station is required.
  • Not run on hardware. Formatting is deferred to the pass after review.
File + -
dotbot/calibration/conics.py +165 -8
dotbot/tests/test_calibration_spin.py +82 -0
dotbot/cli/swarm_lh2.py +65 -0
Total, 3 files +312 -8

@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.56%. Comparing base (7a76840) to head (8aeadc9).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #344   +/-   ##
=======================================
  Coverage   88.56%   88.56%           
=======================================
  Files         230      230           
  Lines       37623    37623           
  Branches     2367     2368    +1     
=======================================
  Hits        33319    33319           
  Misses       4300     4300           
  Partials        4        4           
Flag Coverage Δ
console 82.18% <ø> (ø)

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

Files with missing lines Coverage Δ
dotbot/cli/swarm_lh2.py 83.25% <ø> (ø)
dotbot/tests/test_calibration_spin.py 100.00% <ø> (ø)
🚀 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-place-to-calibration branch 5 times, most recently from 2d8ddf5 to 62ebd24 Compare October 16, 2026 14:07
@geonnave
geonnave force-pushed the spin-place-to-calibration branch from 62ebd24 to 8aeadc9 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