Repository navigation
swarmit/testbed: carry LH2 stations by mask in calibration and device info - #175
Merged
Merged
Conversation
… info Breaking, cross-repo: matches a bootloader and net core that store stations by mask (device info 4, 179 bytes) and PyDotBot's schema 4 calibration files; robots below device info 4 read as firmware to reflash, and schema 3 files are refused. AI-assisted: Claude Opus 5.5
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #175 +/- ##
==========================================
- Coverage 91.30% 91.04% -0.27%
==========================================
Files 27 27
Lines 5082 5124 +42
==========================================
+ Hits 4640 4665 +25
- Misses 442 459 +17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AI-assisted: Claude Opus 5.5
geonnave
force-pushed
the
lh2-multi-host
branch
from
October 2, 2026 12:52
5e9262f to
8019e7a
Compare
This was referenced Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The host half of storing LH2 stations by a 16-bit mask instead of a dense count, so a robot can hold the stations on, say, channels 3 and 9 without anything in slots 0 to 7. Today
send_lh2_calibrationrefuses anything but stations 0 to N-1, and device info reports a count.Wire, as the new bootloader and net core expect it (byte-for-byte with PyDotBot's packer):
u32 station_mask(bit i = station i, bits 16-31 zero) at 0,u32 station_indexat 4, the float32 matrix at 8, this station's ownu32 valid_mm[4]at 44, site name at 60, calibration id at 76. One message per station in index order; the mask, site and id are identical across a push.lh2_homography_count(u8) becomeslh2_station_mask(u16) at offset 152, solh2_flagsmoves to 154.Host behaviour.
send_lh2_calibrationchecks a push is one push: a mask naming 1 to 16 stations below 16, messages carrying exactly the mask's stations once each in index order, a non-empty rectangle in each, the same mask, site and id in every message.helpers.read_lh2_calibration_payloadreads calibration schema 4 (each station's ownvalid_mmis required), builds the mask from the station indices, and refuses an index outside 0 to 15 or a duplicate. Schema 3 files are refused.DeviceInfo.lh2_summarynames stations by index and channel, e.g.stations 2, 8 (channels 3, 9; valid, from flash); the fleet table's cell lists the indices. Robots below device info 4 read as firmware to reflash.Flash together. This only talks to a bootloader and net core built for the station mask (config page magic SWRP); those come by cable, both images on every robot in one visit, and nothing should be pushed over the air to a robot that has not been reflashed. Install this host first: an old host would send the old count format, which the new net core cannot commit. PyDotBot's matching change (schema 4 files, mask messages, the baked page) is in DotBots/PyDotBot#322 and the PRs stacked on it.
Validation. Host only: 240 passed (
pytest swarmit/tests), including the shared wire fixture pinned in both repos (stations 2 and 8 with different rectangles, so keying by position or sending the union in every message fails it), an empty rectangle refused, stations 2 and 8 going out under mask 0x0104, the refusals above, the device-info layout at offsets 152-155, and an emulated node's mask surviving the round trip. The calibration files PyDotBot writes produce identical bytes through both packers. Dashboard frontend builds;pre-commitclean.swarmit/testbed/controller.pyswarmit/testbed/helpers.pyswarmit/testbed/protocol.pyswarmit/tests/lh2_wire_fixture.pyswarmit/tests/test_controller.pyswarmit/tests/test_helpers.pyswarmit/tests/test_protocol.pyswarmit/cli/main.py,dashboard/frontend/src/App.tsx,tests/test_client.py,tests/test_webserver.py,tests/utils.py