dotbot: add the wheel velocity command and set the v3 wheel to 43 mm on a 51:1 gearbox - #298
Merged
Merged
Conversation
This was referenced Sep 23, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #298 +/- ##
==========================================
+ Coverage 84.98% 85.12% +0.13%
==========================================
Files 206 206
Lines 26002 26190 +188
Branches 1836 1836
==========================================
+ Hits 22098 22294 +196
+ Misses 3897 3889 -8
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
geonnave
force-pushed
the
wheel-control
branch
from
September 24, 2026 06:13
6213a1c to
1a0c4e5
Compare
AI-assisted: Claude Opus 5
Mirrors DotBot-libs drv/geometry.h on its wheel-control branch. The geometry pin test builds against DotBot-libs main in CI, so it fails until that header change lands there. AI-assisted: Claude Opus 5.5
Mirrors the DotBot-libs drv/geometry.h change on its wheel-control branch. The geometry pin test builds against DotBot-libs main in CI, so it fails until that header change lands there. AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
The bound mirrors the dotbot-next wheel speed cap, which is lowered to 700 mm/s to keep encoder headroom; keep the two in step. AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
geonnave
force-pushed
the
wheel-control
branch
from
September 24, 2026 07:14
1a0c4e5 to
2ad1971
Compare
This was referenced Sep 24, 2026
Merged
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.
Adds the host side of the DotBot per-wheel speed loop: a
WHEEL_VELOCITYpayload and a REST route to send it, simulator support for the command, and corrects the v3 geometry record to the measured wheel and gearbox.Problem
The firmware now closes a speed loop on each wheel (DotBot-libs DotBots/DotBot-libs#32, DotBot-firmware DotBots/DotBot-firmware#425), commanded in signed mm/s per wheel. The only direct drive command on the host was
MOVE_RAW, which is motor duty, and the v3 geometry record carried a 44 mm wheel and a 50:1 gearbox that bench measurement has since corrected.Approach
PayloadType.CMD_WHEEL_VELOCITY = 0x0FwithPayloadCommandWheelVelocity(left_mm_s, right_mm_s), two signed 16-bit fields, matching the C struct.PUT /controller/dotbots/{address}/{application}/wheel_velocitytakesDotBotWheelVelocityCommandModel, validated to +/-700 mm/s per wheel (matching the firmware cap, which is being lowered from 800 to 700 in the firmware PRs to keep encoder headroom), andRestClient.send_wheel_velocity_command()calls it. mm/s like every other length the controller exposes. The controller treats the payload as a command, likeMOVE_RAW, and does not parse it as an uplink.dotbot-nextapp acts on the command, and every other app accepts the frame and ignores it.dotbot-nextstops the wheels about 500 ms after the last command, so a caller must resend faster than 2 Hz.dotbot-nextdoes. It drives the simulated wheels at the commanded mm/s (the onboard loop closes on the encoders, so the simulated motor error does not apply), and stops them about 500 ms after the last command, like the firmware. AMOVE_RAWcommand or a set of waypoints takes control back. Payload types the simulator does not handle are now logged as a warning instead of being dropped silently.mm_per_countbecomes pi x 43 / (28 x 51) = 0.0946 mm, down from 0.0987. The gearbox is sold as 50:1; a hand recount found 51, and 28 x 51 = 1428 matches the 1430 +/- 1.5 counts per wheel turn measured by hand within 0.14 per cent, and 0.0948 +/- 0.001 mm per count from 24 lighthouse-measured straight legs within 0.3 per cent. The pins intest_robots.pymove with it.Validation
pytest: the new server (including the +/-700 bounds, out-of-range values on both wheels, a non-integer and a missing field), protocol (encode and decode), REST client and controller tests pass, the four simulator tests (wheels driven at the commanded speed, the stop after the timeout,MOVE_RAWtaking over, the unhandled-payload warning) pass, andtest_robots.pyplustest_control_loop_geometry.pypass against the control-loop library built from the DotBot-libs branch. The full suite gives 850 passed, 5 failed; the 5 fail identically onmain(four intest_cli_helpers, one intest_controller_dotbot_simulator).Merge order
control_loopCI job builds the geometry check against DotBot-libsmain, so it fails here until the libs PR merges (the pinnedmm_per_countdisagrees with the 0.0987 on current libsmain).dotbot/tests/test_server.pydotbot/dotbot_simulator.pydotbot/tests/test_dotbot_simulator.pydoc/reference/rest.md,dotbot/controller.py,dotbot/models.py,dotbot/protocol.py,dotbot/rest.py,dotbot/robots.py,dotbot/server.py,dotbot/tests/test_controller.py,dotbot/tests/test_protocol.py,dotbot/tests/test_rest.py,dotbot/tests/test_robots.pyMerge chain
One PR at a time, in this order: DotBots/DotBot-libs#32, this PR, DotBots/DotBot-firmware#425, DotBots/DotBot-libs#33, DotBots/DotBot-firmware#426, DotBots/DotBot-libs#34, DotBots/DotBot-firmware#427, DotBots/DotBot-libs#35, DotBots/DotBot-firmware#428, #301, #302. Next after this one: DotBots/DotBot-firmware#425. Rebase and squash merges both give the DotBot-libs commits new ids, so each firmware PR's
dotbot-libssubmodule has to be re-bumped to the merged libsmaincommit before it merges.