Skip to content

One commander path: a computer commander takes a seat like a person - #131

Open
ptescher wants to merge 3 commits into
actors-planfrom
actors-seats
Open

ptescher wants to merge 3 commits into
actors-planfrom
actors-seats

Conversation

@ptescher

@ptescher ptescher commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Step 3 of plans/actors.md: one commander path.

What changed

  • recreation_towers_ground now holds the seat client (seat), the station (station: the team's Ground over the air ports, the map from telemetry, Tally for the server's report) and the computer commander (commander::run(addr, team, Brain::Play|Idle, tally, &stop)), plus the binary towers_commander --team blue|red [--host H] [--port P] [--idle]. The commander app uses the same seat/station (its files re-export them).
  • Seat protocol additions (existing shapes untouched): Join::Compute(Team), Join::commands(), ToSeat::Orders(Vec<(Option<Order>, bool)>) sent once after the welcome of a seat that commands.
  • towers_server: the in-process commanders and the truth-based Ground are gone; the server decides and sends no plan. For a computer (or nobody, which gives no orders) team it starts commander::run in a thread that joins over loopback. Kept in the server: light-quad sticks from stored orders, take-off, referee, air. New flag --on-leave computer|wait (default computer); documented in the server's header and domains/recreation/README.md. A crash now prints a detail line (time, order, low/high, jammed, silent, nearest flying drone).
  • Handover: a person (Join::Command) relieves a computer (Join::Compute) holder (it is sent Refused("relieved...") and disconnected) and starts from the orders the drones have; when a person leaves, a computer takes the seat after 1 s unless the person is back. Two people (one per team) can join.

Tests

  • cargo test --release -p recreation_towers -p recreation_towers_ground: pass (includes tests/commander.rs: a commander against a fake server gives orders from umpire + sites alone, leaves when relieved).

  • cargo test --release -p recreation_towers_server --bins: 29 pass, including the Gate A tests in seats.rs (same message kinds for person and computer seats; a Red scout in the open is in the spectator's truth and not on the map built from a seat's messages; takeover; computer takes a freed seat; two people).

  • cargo build --release -p teleoperation_command, cargo fmt, clippy on the changed crates: clean. expectation check expectations: 0 errors.

  • Gate B (real ArduPlane SITL, acceptance test): fails on "No drone crashes in a game" for plain actors-plan too (0 to 7 crashes per game here), so neither path passes it reliably. Every other expectation passes (10 in AGENT, 0 refused, 0 fog leaks, towers taken). Crashes per game, 4 games per batch at --speedup 10, one at a time, new path against plain actors-plan interleaved:

    Batch Path Crashes per game Total
    1 new, first version 1, 2, 3, 3 9
    1 actors-plan 0, 3, 0, 0 3
    2 new + AGENT only after the transition, clock cap in wall time 3, 0, 2, 4 9
    2 actors-plan 1, 1, 0, 5 7
    3 new + dead reckoning of reports 1, 1, 0, 0 2
    3 actors-plan 4, 7, 4, 2 17

    Defects of the new path found and fixed: AGENT was asked for in the middle of the take-off transition (two games lost a drone at its base at t = 10 s); the station clock was capped at one game second past the last map (plans slowed at 10x); plans came from the position of the last report (now carried on by its velocity). Apart from those take-off crashes (and one on actors-plan) no crash had another drone within 30 m, so the loss of true enemy traffic does not show; the rest are tree strikes while taking a tower, in both paths.

Not done

  • No new .expect steps: handover is covered by Rust tests with seat clients; the arduplane driver only plays computer vs computer (text added to its feature).
  • The Orders echo is the server's record of what the drones last heard, not read from telemetry.
  • No GUI check of a takeover.

🤖 Generated with Claude Code

ptescher and others added 3 commits November 14, 2026 08:34
The seat client and the station move from the commander app into recreation_towers_ground, with
a headless computer commander (commander::run, binary towers_commander). The server no longer
decides or sends plans: it starts a computer commander as a seat client for a computer team.
A seat changes hands during a game: a person relieves a computer, and a computer takes a seat a
person leaves. Two people can play.

Co-Authored-By: Claude <noreply@anthropic.com>
…d reckoning; crash log lines

Measured on SITL: the first version asked for AGENT in the middle of the take-off transition (two
games lost a drone at its base), held its clock to one game second past the last map (slow plans at
10x) and planned from the position of the last report. The server prints what a crashed drone was
doing and who was near.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>

This branch has not been deployed

No deployments
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