Fix go() not moving the robot: use DRIVE_DIRECT instead of radius DRIVE#3
Fix go() not moving the robot: use DRIVE_DIRECT instead of radius DRIVE#3fedenanni wants to merge 1 commit into
Conversation
The radius-based DRIVE command (opcode 137) was not reliably honored by the robot: in-place turns (turn/spin) and straight legs (forward/back/move, and scripts/drive_until_bump.sh via 'go <speed> 0') left the wheels at idle while the daemon still reported success. The robot 'thought' it was moving but stayed put. Reimplement protocol::go() in terms of DRIVE_DIRECT (opcode 145, independent wheel velocities), which drives the motors reliably: - straight: drive_direct(v, v) - CCW (+deg): drive_direct(+wheel, -wheel) - CW (-deg): drive_direct(-wheel, +wheel) Wheel-speed/angular-rate calibration (WHEEL_SPAN_MM) is unchanged, so the existing turn/spin/move durations still yield the intended angles/distances. Updated the affected unit tests. Verified on hardware: turn now produces a real rotation in both directions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
SummaryAll motion convenience commands ( On this robot, opcode 137 is not reliably honored: the wheels stayed at idle (motor current never rose above baseline) while the daemon still returned FixReimplemented
The wheel-speed ↔ angular-rate calibration ( Testing
Note: the running daemon must be restarted to pick up the rebuilt binary. |
No description provided.