dotbot: send waypoint poses, batch ids and max speed, and read the waypoint report - #301
Merged
Merged
Conversation
This was referenced Sep 24, 2026
Merged
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #301 +/- ##
==========================================
+ Coverage 84.98% 85.36% +0.37%
==========================================
Files 206 206
Lines 26002 26650 +648
Branches 1836 1836
==========================================
+ Hits 22098 22749 +651
+ Misses 3897 3894 -3
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This was referenced Sep 24, 2026
The waypoints trailer, the advertisement's report and the max speed command mirror DotBot-libs drv/protocol.h and dotbot-next's parser; keep the layouts in step. AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
…eeds up A resend fired after a direct command, a stop to the default speed, or another controller's newer batch would bring the old command back, a stop included. The max speed confirmation now rounds half up as the firmware's lroundf does, so 445 mm/s is confirmed by 45. AI-assisted: Claude Opus 5.5
Breaking: a waypoints request with more than 16 points, a threshold outside 0 to 65535, or a heading that is not a finite number is now refused with 422, where it used to be truncated by the robot, fail with 500, or lose its heading. AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
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.
Sits directly on
mainnow that #298 has merged, so the diff below is this PR alone. The robot side is DotBots/DotBot-libs#35 and DotBots/DotBot-firmware#428, both merged; the console gesture for poses is stacked on this one as #302.The host side of onboard waypoint batches: waypoints can carry a heading, the controller sends the new wire trailer and a max speed, reads the robot's waypoint report, and resends a batch until the robot shows it has it.
What a waypoint means
Every waypoint is a position for the robot's centre, the axle midpoint, with or without a heading. A point with
heading_degis a pose: the robot stops there, turns in place to face it, then goes on. Thedotbot-nextfirmware app drives the axle there; the olderdotbotapps still steer their LH2 photodiode onto the point, since they have no estimator. The waypoint echo in the controller now starts at the robot's axle, its own estimate when it advertises one, else the body pose expanded from its fix when that has a heading, else the fix.Approach
dotbot/protocol.py, mirroringdrv/protocol.h):LH2_WAYPOINTScarries a trailer after the points:batch_idu8,heading_tol_degu8,pass_mmu16, then oneheading_cdegi16 per point (0.01 degree, 0 facing +y, clockwise positive like the advertiseddirection; 0x7FFF = none). 7 + 10n bytes, 167 for 16 points. A trailer, rather than headings interleaved with points, so the older apps still read threshold, count, points and ignore the rest.waypoint_idx: status, reason, batch id, max speed in 10 mm/s, axle x and y. The shorter legacy shapes still parse.CMD_MAX_SPEED(0x11),max_speed_mm_su16.DotBotLH2Waypointaddsheading_deg, normalised to [0, 360). The waypoints request gainsintermediate_threshold(the pass radius, mm) andheading_tolerance(degrees); None leaves the firmware default (20 mm, 3 degrees).DotBotModelgainswaypoints_status(NONE, IN_PROGRESS, ARRIVED, FAILED, ABORTED),waypoints_reason(the reason's name),waypoint_index,max_speed(mm/s) andaxle_position, all null for apps that send no report. They reach the console through the usual update notification.DB_MAX_WAYPOINTS, beyond which it drops them), a threshold outside 0 to 65535, or a heading that is not a finite number. A point whose heading fails validation is refused rather than taken as a point without one.PUT /controller/dotbots/{address}/{application}/max_speedtakesmax_speed_mm_s(0 to 700; 0 restores the default). Onlydotbot-nextacts on it, clamped to 20 to 700.send_max_speedis confirmed by the advertised max speed, rounded half up as the firmware rounds it.Validation
pytest: the protocol round-trips (trailer, report, legacy shapes, a 16-point batch at 167 bytes); REST headings reaching the wire as centidegrees;intermediate_thresholdandheading_tolerancepassing through; the max speed route (valid, default, out of range, unknown robot); the echo starting at the axle; the controller's report handling and resend logic (confirmed, lost and resent, giving up after 5 tries, sending once to apps without a report, max speed confirmation and its half-way rounding, not repeating another controller's id, not resending over another controller's batch or a direct command, a second lost batch still resent); the request bounds (17 points, threshold, NaN heading, pass radius and tolerance out of range). The suite gives 933 passed and 5 failed; the 5 fail the same way without this PR, on dotbot: add the wheel velocity command and set the v3 wheel to 43 mm on a 51:1 gearbox #298's branch as it was before merging (a local config file and a bound port in the simulator test).check custom control loopincluded.Known limits and follow-ups
dotbotapps are kept only for the old-against-new comparison; they get each batch once and report nothing.mainsends a 60 mm terminal radius, and the robot stops at the edge of it; dotbot/console-web: place pose waypoints and show the waypoint report in the dock #302 makes it 10 mm by default.Merge chain
Merged on 2026-09-25: DotBots/DotBot-libs#32, #298, DotBots/DotBot-firmware#425, DotBots/DotBot-libs#33, DotBots/DotBot-firmware#426, DotBots/DotBot-libs#34, DotBots/DotBot-firmware#427, DotBots/DotBot-libs#35 and DotBots/DotBot-firmware#428. The rest go one PR at a time, in this order: this PR, #302, DotBots/DotBot-libs#36, DotBots/DotBot-firmware#429, #303. Next to merge overall: #301, then #302, which complete the waypoint batches; then the cut-over, DotBots/DotBot-libs#36, DotBots/DotBot-firmware#429 and #303. Next after this one: #302. Each firmware PR gets a final
dotbot-libs: bump to ... merge on maincommit, moving its submodule to its libs PR's merge commit on DotBot-libsmain, before it merges, as DotBots/DotBot-firmware#425 to DotBots/DotBot-firmware#428 did. The next firmware PR then conflicts on that submodule line, so it is rebased ontomainwhen its turn comes.dotbot/tests/test_controller.pydotbot/controller.pydotbot/tests/test_server.pydotbot/protocol.pydotbot/tests/test_protocol.pydotbot/models.pydotbot/server.pydoc/conf.py