Skip to content

Chained straights run on; the first action starts the route; a route runs from its start (4.18.0) - #521

Merged
1e0ng merged 1 commit into
mainfrom
route-chained-moves
Sep 23, 2026
Merged

1e0ng merged 1 commit into
mainfrom
route-chained-moves

Conversation

@1e0ng

@1e0ng 1e0ng commented Sep 23, 2026

Copy link
Copy Markdown
Owner

What users reported, and what was behind it

  1. "If you enable continue on a straight it still stops." The engine chains moves correctly (a carrying move ends at cruise; the next straight or curve starts from the current speed). The planner was the problem: two straights clicked roughly in line differ by a degree or two, so the program inserted robot.turn(2.3) between them, and a turn in place stops. Now a straight's end clicked within 7.5° of the heading the robot arrives with lands exactly on that heading, in the rubber band and when placed. Shift keeps any angle.

  2. "Show the program also shows the program of going there." With the chassis at the map's spawn and the route drawn elsewhere, the program opened with # to its start: the drive there plus a turn and a long straight. Now the first action placed on an empty route starts it: the chassis goes to where that action begins, facing its way. Dragging the chassis afterwards still sets another start, and the drive there is inserted as before.

  3. Found while reproducing: the run server runs a script from wherever the robot stands, so a second ▶ Run route set off from where the first run ended. Run route now places the chassis at the route's start first.

Tests

  • route.rs: the heading snap (ahead, a real angle, any heading, behind, on the spot) and a program of two snapped straights with no turn.
  • simulate.rs: chained placement through clicks (the rubber band's label, the placed end, then=Stop.NONE followed directly by the next straight, a real angle kept, shift keeping any angle), the first action placing the chassis and not when it begins at the chassis, and the run sending place before run.
  • app.rs: shift in the map view sets the flag.

Full sim suite green locally, fmt and clippy clean. Docs updated and offline-docs.zip rebuilt (source hash matches). Version 4.18.0.

The third report, "the curve is hard to control", is not in this PR; see the session summary for what I found and the options.

🤖 Generated with Claude Code

https://claude.ai/code/session_016higr4k4yNohYeKod1f1HY

…runs from its start (4.18.0)

Three fixes from users of the route planner.

A straight clicked roughly ahead lands exactly on the heading the
robot arrives with (within 7.5°, route::snap_heading; shift keeps any
angle via SimulateTab.free), in the rubber band and when placed. Two
straights that were only roughly collinear got a one-degree
robot.turn inserted between them, and that turn stopped the robot, so
a "continuous" straight looked as if it still stopped. The engine
itself chains fine: a carrying move ends at cruise and the next
straight or curve starts from the current speed.

The first action placed on an empty route starts it: the chassis goes
to where that action begins, facing its way, so the program no longer
opens with a drive from the map's spawn to the route ("the program of
going there"). Dragging the chassis afterwards still sets another
start, with the drive there inserted as before.

Run route puts the chassis at the route's start before running: the
server runs a script from wherever the robot stands, so a second run
used to set off from where the first ended.

Tests: the heading snap (ahead, a real angle, any heading, behind, on
the spot) and a program of two snapped straights with no turn; the
tab's chained placement (the rubber band's label, the placed end, the
program with then=Stop.NONE and no turn, a real angle kept, shift
keeping any angle), the first action placing the chassis (and not when
it begins there), the run's place before run; the harness's shift
wiring.

Docs: the route paragraph; offline-docs.zip rebuilt. Version 4.18.0.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016higr4k4yNohYeKod1f1HY
@codecov

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.29730% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.41%. Comparing base (21f744c) to head (7019f64).
⚠️ Report is 182 commits behind head on main.

Files with missing lines Patch % Lines
tools/sim/src/simulate.rs 95.87% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #521      +/-   ##
==========================================
+ Coverage   95.72%   96.41%   +0.68%     
==========================================
  Files          50       81      +31     
  Lines        5192    23920   +18728     
==========================================
+ Hits         4970    23062   +18092     
- Misses        222      858     +636     
Flag Coverage Δ
c-core 97.53% <ø> (+2.02%) ⬆️
openbricks-dev 99.77% <100.00%> (+0.74%) ⬆️
openbricks-py 97.03% <100.00%> (+1.27%) ⬆️
openbricks-sim 96.25% <ø> (+3.08%) ⬆️
sim-rs 95.67% <97.26%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@1e0ng
1e0ng merged commit 38cd741 into main Sep 23, 2026
35 of 36 checks passed
@1e0ng
1e0ng deleted the route-chained-moves branch September 23, 2026 14:47
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