Skip to content

apps-sandbox/dotbot: replace the old app with dotbot-next - #429

Merged
geonnave merged 9 commits into
DotBots:mainfrom
geonnave:cutover
Sep 25, 2026
Merged

geonnave merged 9 commits into
DotBots:mainfrom
geonnave:cutover

Conversation

@geonnave

@geonnave geonnave commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

#428 has merged (as have #427, #426 and #425), and so has DotBots/DotBot-libs#36, at c1ff6ca. This PR is next. This branch carries #427's and #428's commits as they were before their last rebase, so until it is rebased onto main this diff also shows their changes, and the PR conflicts with main on the dotbot-libs line. It is rebased onto main next, its dotbot-libs pointers are remapped from #36's pre-rebase commits to the rebased ones (b6027b3 to c11eb27, ddb10f2 to 13e6643, 6859478 to 58a3f05), since #36 was itself rebased before merging, and it gets a final dotbot-libs bump to #36's merge commit c1ff6ca. Until then the submodule points at b6027b3, #36's old tip, which retires drv/move. The host-side wording follows in DotBots/PyDotBot#303.

This is the cut-over: the rebuilt app replaces the old sandbox DotBot app, and the old one is deleted, so the sandbox has one DotBot app rather than two.

Why now

The new app was built layer by layer (wheel speed loop, pose estimator, steering, waypoint batches) in #425 to #428, and the decision to replace the old app was conditional on it beating the old one on the floor. Head to head on a 400 mm straight, E21A running the old dotbot app and 2426 running dotbot-next, parallel lanes:

Arrived Miss Path error
New, 10 mm threshold 6 of 6 axle 9.4-10.9 mm 4.6-10.2 mm
Old, 10 mm threshold 0 of 3 overshot, left its lane
Old, 20 mm threshold 2 of 3 photodiode 14.3 and 16.6 mm 38-44 mm, 134 mm on the failed run

The new app wins on reliability, miss and path error; the old one is faster on a straight when it works. That is a shortened version of the planned check (one trajectory, 3 to 6 runs per arm rather than 16 per start pose), and the maintainer accepted it as enough.

What changes

  • apps-sandbox/dotbot is now the rebuilt app, moved from apps-sandbox/dotbot-next with two lines changed (its doxygen group and one comment); the old app's main.c (365 lines, the PD heading loop on drv/control_loop) is deleted. Git shows this as a rewrite of apps-sandbox/dotbot/main.c rather than a rename, because the path already existed. The SES project dotbot-next is gone and dotbot builds the new code, so dotbot-sandbox-<board>.bin is the new app, which is what PyDotBot's dotbot swarm flash rc-car already resolves to. Breaking for anyone who relied on the old app's behaviour: waypoints are axle positions, the advertisement carries the waypoint report, and the heading is the -1000 sentinel until the robot has moved.
  • DOTBOT_CONTROL_LOOP_USE_PURE_PURSUIT is dropped from the three sandbox-*.emProject solutions: no sandbox app links drv/control_loop any more.
  • apps-sandbox/move is ported from the blocking drv/move onto the non-blocking odometric goal of drv/move: retire it for an odometric goal on the wheel speed loop DotBot-libs#36: a 200 mm square on the wheel speed loop from a 10 ms tick, then blinking, with the keep-alive from the same tick. Speeds are now mm/s (150 straight, 100 per wheel turning) instead of a duty of 60. Ticks the main loop missed are stepped as one step over the elapsed time, as in apps-sandbox/dotbot, rather than replayed one tick at a time on counts that all landed in the first, and a stalled wheel ends the square: otherwise the other wheel kept driving and the robot pivoted around the stuck one until swarm stop.
  • The app README loses its "no steering, no waypoints" section and names the previous app as such, and now describes the waypoint drive mode, its exemption from the command timeout and the steering's own timeouts that replace it, and the advertisement's waypoint fields; AGENTS.md now says which app runs which loop.

What still depends on what

  • The bare apps/dotbot stays, on the old loop. It is the documented single-robot path without SwarmIT (PyDotBot's "drive a single DotBot" guide flashes dotbot-dotbot-v3.hex with a cabled gateway), it is the ARTIFACT_PROJECTS of dotbot-v1/v2/v3 and ships in every release, and it keeps its own LH2 decoding and the 500 mm fix-to-fix outlier gate. With it, drv/control_loop stays in DotBot-libs, which PyDotBot's simulator also builds.
  • Porting the new app to the bare build is proposed, not done here. The control layers are already hardware-free (drv/wheel_control, drv/pose_estimator, drv/steering), but the app's I/O is SwarmIT's: the fix and its sequence from swarmit_localization_get_fix(), the keep-alive that runs the solve, commands from swarmit_ipc_isr(), the advertisement through the net core and its pacing from swarmit_get_min_tx_interval_us(). A bare build needs those four behind a small platform layer with a second backend: the app-side LH2 decode with homographies pushed over the radio, db_radio for commands and adverts, a fix sequence of its own, and a fixed advert period. That is a contained change but not a mechanical one, and it needs its own floor test on a cabled robot, so it is left for a follow-up rather than done half-way. dotbot-v1 (nRF52833, due for deprecation around November 2026) would be dropped from that app rather than ported.
  • apps-sandbox/dotbot-simple stays: a minimal remote-control demo (motors and LED, no position, no control loop) and a HIL check target.

Validation

  • CI: all checks pass (bare and sandbox build matrix, style, doc, readthedocs).
  • SEGGER Embedded Studio 7.22, the whole CI matrix: 12 bare targets in Debug and Release and the 3 sandbox targets in Release (every app in apps-sandbox/), 0 warnings, 0 errors. make check-format clean.
  • Floor, 2426 over the air with this branch's dotbot-sandbox-dotbot-v3.bin (plain build, no bench telemetry), in the top strip of the dev corner: flash 131/131 ok, swarm info shows the image as dotbot-sandbox-dotbot-v3.bin. A single waypoint 190 mm away from a standing start with no heading: ARRIVED in 2.5 s, reported axle 10.0 mm from the target at a 10 mm threshold. A 3-point path: the index advanced 0, 1, 2 and it ARRIVED in 4.7 s, reported axle 11.4 mm off. A stop sent mid-batch: ABORTED with reason STOP within 0.5 s. Then swarm stop (Bootloader) and swarm start (Running, report back to NONE). Battery was at 1.3 V throughout. Misses here are the robot's own advertised axle estimate, not LH2 truth.
  • apps-sandbox/move builds but was not driven on the floor.

Merge chain

Merged on 2026-09-25: DotBots/DotBot-libs#32, DotBots/PyDotBot#298, #425, DotBots/DotBot-libs#33, #426, DotBots/DotBot-libs#34, #427, DotBots/DotBot-libs#35, #428, DotBots/PyDotBot#301 and DotBots/PyDotBot#302, which completed the waypoint batches, then DotBots/DotBot-libs#36, the first PR of the cut-over (merge commit c1ff6ca). What remains, one PR at a time, in this order: this PR (after a rebase onto main and its final dotbot-libs bump), DotBots/PyDotBot#303. Next to merge overall: this PR. Next after this one: DotBots/PyDotBot#303. Each firmware PR gets a final dotbot-libs: bump to ... merge on main commit, moving its submodule to its libs PR's merge commit on DotBot-libs main, before it merges, as #425 to #428 did. The next firmware PR then conflicts on that submodule line, so it is rebased onto main when its turn comes.

Against main the changes of #427 and #428 are not a row of their own: they edit apps-sandbox/dotbot-next, which this PR moves to apps-sandbox/dotbot, so they show inside the new apps-sandbox/dotbot/main.c and drop out of this diff once this branch is rebased onto main. GitHub shows +1287 -1242 today, against an older merge base; the table is this branch against main as it is now, which is what the diff becomes after the rebase.

+ - Files
apps-sandbox/dotbot and apps-sandbox/dotbot-next +1085 -1463 4 the old app deleted, dotbot-next as on main deleted (1226 lines), the new app in its place
apps-sandbox/move +169 -21 2
AGENTS.md +27 -18 1
5 small files: apps-sandbox/applications.emProject, three sandbox-*.emProject, dotbot-libs +6 -30 5
Total against main +1287 -1532 12

Breaking change: dotbot-sandbox-<board>.bin is now the app built on the
wheel speed loop, the pose estimator and onboard waypoint steering. The
PD heading loop on drv/control_loop no longer runs in the sandbox, so
the pure-pursuit define goes with it.

AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
@geonnave
geonnave merged commit db3cdb6 into DotBots:main Sep 25, 2026
32 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