Skip to content

apps-sandbox/dotbot: drive the robot through drv/dotbot_control - #430

Merged
geonnave merged 5 commits into
DotBots:mainfrom
geonnave:sandbox-control-core
Sep 29, 2026
Merged

geonnave merged 5 commits into
DotBots:mainfrom
geonnave:sandbox-control-core

Conversation

@geonnave

@geonnave geonnave commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

The sandbox app's control glue now lives in DotBot-libs' hardware-free control
core (drv/dotbot_control) instead of being reimplemented inline in
apps-sandbox/dotbot/main.c. main.c drops from 1083 to 554 lines. The app
keeps its own mailbox, qdec, and localization polling via
db_control_fix_due, writes motors through out.write, sends advertisements
through out.advertise, and keeps the RGB LED command and bench hooks.

Behaviour differences from the previous inline implementation:

  • Deadman now counts scheduler ticks starting from when the mailbox applies a
    command, rather than from when the command was received.
  • Motors are written once at the end of each tick rather than incrementally
    during it.
  • The minimum tx interval is re-read per advertisement, same as before.

Submodule

The dotbot-libs submodule points at the merge commit of
DotBots/DotBot-libs#38 on main.

Bench status

Validated on 3 real robots running this build against a 1.24.0 control
baseline running on a 4th. Matching 1.24.0 behaviour: single- and
multi-point waypoints with final heading, max speed, stop/abort, deadman,
advertisements, and LED.

Not yet passing on the previous build: the LOST re-anchor step (lifting a
robot mid-batch) did not recover. The robot reseeded while still in the hand
(its braked wheels passed the "wheels still" test during a slow carry), spun
in the air, and failed with NO_HEADING. The dotbot-libs pointer now carries
three fixes from DotBot-libs #38: a LOST robot reseeds only once its fixes
hold still for 0.5 s; wheels that turn while the fixes stay put drop the pose
back to LOST, so steering brakes instead of spinning in the air; and a
NO_HEADING spin that ends without a heading rests in HOLD and retries (up to
3 times) before failing.

A second lift test on that build showed the retries spinning the wheels 3-5
times in the hand. The pointer now also carries the follow-up: a pose lost on
a free spin (wheels turning while the fix stays put) fails the batch at once,
braked, with no retry, so a held robot gives one short spin burst and stops.
The retries remain for spins that moved the fix. Before the change, the same
robot on the previous build ran 180 s of untouched laps at 150 mm/s with no
loss of tracking, which rules out a false free-spin trigger on the floor.
This build, flashed on that robot, ran 180 s of untouched laps just as
cleanly: 4 batches ARRIVED, no loss of tracking after the initial heading
spin. The lift mid-batch step itself still needs re-running at the bench.

Build: SES 7.22, sandbox-dotbot-v3 Release, 0 warnings.

File + -
apps-sandbox/dotbot/main.c +150 -679
2 small files: apps-sandbox/applications.emProject, dotbot-libs +2 -2
Total, 3 files +152 -681

The pinned commit is on the unmerged control-core branch of a fork, not
yet on DotBot-libs main; rebump to the merge once DotBots#38 lands.

AI-assisted: Claude Opus 5.5
The command deadman now counts 10 ms scheduler ticks from when the
mailbox hands a command to the core, not RTC time from its receipt in
the IPC interrupt.

AI-assisted: Claude Opus 5.5
@geonnave
geonnave marked this pull request as ready for review September 29, 2026 06:37
@geonnave
geonnave merged commit 54b4859 into DotBots:main Sep 29, 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