Skip to content

dotbot/calibration: fix a spin calibration to the floor with anchor robots - #325

Merged
geonnave merged 4 commits into
DotBots:mainfrom
geonnave:lh2-multi-anchors
Oct 16, 2026
Merged

geonnave merged 4 commits into
DotBots:mainfrom
geonnave:lh2-multi-anchors

Conversation

@geonnave

@geonnave geonnave commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Based on main (#324 merged): this PR is its four commits.

A spin calibration is free mode by default: metric through the spin radius, but placed by the rectangle around the robots. When a true site frame is wanted, robots spinning with their pivot on known points can fix it for every station at once.

dotbot swarm calibrate-lh2 collect --spin --anchor ADDRESS=X,Y (repeatable, two or more) marks those robots. The joint solve runs exactly as without anchors, then the whole solution is moved by the one rigid motion that best puts the anchors' spin centres on their known points. The fit is rigid only: the spin radius keeps setting scale, and a consistent disagreement (radius wrong, slip bias, floor not flat) shows up as the reported anchor scale ratio instead of being absorbed. Each anchor's residual is reported, rectangles and the error map are recomputed in the site frame, stations are saved as conics-anchored with the site's own anchor (so site init --from-calibration and --append, which are for free mode, refuse them).

An anchor address that is not among the robots ready to spin is refused before anything spins, rather than after the 90 s capture; anchor points that would put a station's rectangle below the site's zero are refused by name, since positions are unsigned on the robot.

Anchors bunched together fix position but hold yaw over a short baseline, so a warning fires when they span less than half the fence's diagonal.

Validation, host only: four anchors at the far corners of a two-station synthetic floor (two under each station) put both stations within 2 mm rms of the true floor at 1 mm noise, with no alignment at all; four clustered anchors raise the warning; marks 1 % further apart than the circles report scale ratio 1.01; fewer than two anchors, or one no station kept, are refused; an anchor robot that would not spin is refused before the spin; anchors that put a station below zero are refused; collect --spin --anchor runs end to end over a faked swarm. Full suite: 1752 passed; pre-commit clean.

File + -
dotbot/calibration/multi_station.py +157 -9
dotbot/cli/swarm_lh2.py +65 -9
dotbot/tests/test_calibration_multi_station.py +97 -0
dotbot/tests/test_calibration_spin.py +50 -0
1 small file: dotbot/calibration/conics.py +9 -3
Total, 5 files (this PR's own commits) +378 -21

@codecov

codecov Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.13043% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.46%. Comparing base (44e0d17) to head (6f940e5).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
dotbot/cli/swarm_lh2.py 95.23% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #325      +/-   ##
==========================================
+ Coverage   88.43%   88.46%   +0.02%     
==========================================
  Files         230      230              
  Lines       37022    37135     +113     
  Branches     2323     2323              
==========================================
+ Hits        32739    32850     +111     
- Misses       4279     4281       +2     
  Partials        4        4              
Flag Coverage Δ
console 81.99% <ø> (ø)
python 91.39% <99.13%> (+0.03%) ⬆️

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

Files with missing lines Coverage Δ
dotbot/tests/test_calibration_multi_station.py 99.75% <100.00%> (+0.04%) ⬆️
dotbot/tests/test_calibration_spin.py 100.00% <100.00%> (ø)
dotbot/cli/swarm_lh2.py 82.87% <95.23%> (+0.59%) ⬆️

... 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 merged commit ba3cbf7 into DotBots:main Oct 16, 2026
13 checks passed
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