Skip to content

Towers: a unit holds a queue of instructions (actors step 1) - #132

Open
ptescher wants to merge 1 commit into
actors-planfrom
actors-queue
Open

ptescher wants to merge 1 commit into
actors-planfrom
actors-queue

Conversation

@ptescher

Copy link
Copy Markdown
Owner

Step 1 of plans/actors.md: a unit holds a queue of instructions, not one order and one standing order.

What changed

  • recreation_towers: Instruction { order, queue: Vec<Queued>, taken }, Queued { when: When, order }, When::{Silent(f32), Done, Battery(f32)}, MAX_QUEUE = 4 (a longer queue is cut, tested). Standing stays, and is the queue of one (From<Standing> for Queued, Instruction::give, Instruction::standing()). Entries are taken only out of contact, in order. The failsafe (home on a lost link or at bingo) holds for a drone with no instruction that waits for the silence and none started.
  • "Done" comes from the drone's own knowledge (edge.rs: order_done, Game::order_done): Take when its camera sees its team holding the tower, Goto within 35 m, Hold/Circle/Home never.
  • Seat protocol: ToServer::Order has queue: Vec<Queued> beside the old standing (both serde(default), an old seat still works; a queue wins over standing; tested).
  • Fast arena: Match flies the queue (Captain::queue, default from standing; Autonomy::queue). New policies Chain (persist, the nearest tower the team does not hold when done, home) and Timed (the same by the clock). denial measures them.
  • Server: World::command_queue, queue flown for drones with no wing. Commander app: only compiles (queue: vec![]).
  • Spec: expectations/09-towers/rules/17-queue.expect, glossary term Queue, vocabulary in 09-towers/section.expect, driver support. expectation check has 0 errors.

Not done

  • The flight controller still has one standing slot. The ground uploads the first Silent instruction as the standing plan, as today. cognition_plan, cognition_executor, the MAVLink encoding and ardupilot/ are untouched. The on-board queue is a later step.
  • No UI for a queue in the commander app.
  • Docs not regenerated (needs a window).
  • The suite's coverage mode runs only some expectations of the section, so acceptance.rs also has a queue module that plays each queue scenario by hand.

Results (denial, 100 seeds, both sides)

Existing rows identical before and after:

against failsafe margin error won lost dark dark(f)
persist +0.060 0.095 103 97 157s 153s
Hold after 5 s -0.441 0.095 69 131 341s 156s
Home after 5 s -0.807 0.083 48 152 175s 179s
Home after 30 s -0.272 0.095 81 119 206s 169s
chain (new) +0.060 0.095 103 97 157s 153s
timed 20 s, 60 s (new) -0.666 0.085 55 145 197s 189s
timed 30 s, 90 s (new) -0.226 0.096 85 115 211s 168s
against persist margin error won lost
chain -0.000 0.094 100 100
timed 20 s, 60 s -0.730 0.082 50 150
timed 30 s, 90 s -0.350 0.093 75 125

A longer queue does not beat persisting in the valley. chain plays exactly as persist: a drone that takes a tower ends the shadow, is in contact again, and a drone in contact takes no instruction, so "done" never starts the next one. timed pulls drones off their towers and loses.

Tests

cargo test --release -p recreation_towers -p cognition_towers -p recreation_towers_ground -p recreation_towers_server pass. cognition_league: unit tests pass; its acceptance test fails with "The suite's 120 s ran out" (the nested builds of its challenger tests); not shown to be caused by this change. cargo clippy --workspace --all-targets and cargo fmt: clean. cargo build --release -p recreation_towers_server -p teleoperation_command: OK.

🤖 Generated with Claude Code

Instruction is an order and a queue of up to four Queued instructions, each started by a
When: out of contact for some seconds, the order before it done (told from the drone's own
camera and position), or the battery down to some seconds. Standing is the queue of one.
ToServer::Order carries the queue beside the old standing field. The fast arena and the
server fly the whole queue; the ground still uploads only the first Silent instruction as the
flight controller's one standing plan. New arena policies Chain and Timed, measured in the
denial example; the existing rows are unchanged.

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