Skip to content

Towers: fewer drones lost to the trees (measured, plans that last, rings by team) - #139

Merged
ptescher merged 2 commits into
masterfrom
towers-tree-strikes
Nov 15, 2026
Merged

ptescher merged 2 commits into
masterfrom
towers-tree-strikes

Conversation

@ptescher

Copy link
Copy Markdown
Owner

Towers: drones hit trees

The server's acceptance test (No drone crashes in a game) failed on master: 0 to 8 crashes a game. This measures where they come from, from the tracks, and fixes what the data shows.

Measure first

towers_server now prints, for every crash, a crashinfo: line (drone, class, order, where it was, the distance to the tower and to the clearing, the tree it hit and the gap to its trunk) and the last 10 s of the drone at 10 Hz (track: height, speed over the ground and through the air, bank, pitch, heading, the executor's AG_PLAN/AG_ENV/AG_FALL, the order, the leg the ground sends, the distance to the tower and to the clearing's edge, the nearest other drone with its distance and height over, and how long the drone has been out of contact). The logging stays. The executor's reports reach the world through Tally::status.

14 games before any change (--speedup 10 --timeout 200, one at a time): 33 crashes, 2.36 a game (2, 3, 2, 4, 3, 1, 2, 1, 0, 5, 4, 4, 1, 1; one game in 14 had none). By what the tracks show:

Cause Crashes Evidence
A drone out of contact: its plan ran out 9 The drone takes an enemy tower and is in its radio shadow (160 to 200 m, wider than the 80 m clearing), where no plan arrives unless a friend relays it. Plans were good for 3 s; then the executor flies a loiter round the point where the plan ran out (AG_FALL 1, silent 12 to 17 s in the dump): a circle of 50 m round a drone that is already 40 to 50 m from the tower, so it reaches 90 to 107 m, the trees at 86 m, a few seconds after. The AGNT log of the flight controller shows the demand: a steady bank of 33 degrees (the 50 m circle) and then the loiter
The heavy drone (T2 Cruza) loses control 11 Roll of 70 to 83 degrees at the end (standard drones: 53 at most), then a spiral dive; in the clearing or on a lane. At 17 m/s a 50 degree bank is at the stall (airspeed minimum 13 m/s; 15 m/s at that bank) and a step in the demand (an order that changes, a separation escape, the entry into a circle) overshoots. The AGNT log shows the executor asking for a bank of 45 to 50 and the plane at 70 to 79
The take-off after a respawn 9 "Hard impact" at 21 m/s at the base, 15 to 40 s after the drone was put back; the forward transition dives (pitch -33 degrees at 9 m/s at the start of a game too) and the respawned drone does not always come out of it. 9 of 33 here, 5 of 24 in the next batch, then 1 in 16 games and none in 16 games of the old code on a quieter machine: it follows the machine's load, not the code. Not found out
An enemy in the circle 4, and behind some of the heavy ones Blue and Red take the same tower going round opposite ways (one comes from the south, the other from the north) so they meet head on in one circle, inside the envelope's separation zone (AGENT_SEP 4 m and a buffer of 3 m, at nearly the same height: the drones' heights are 0.35 to 0.7 m apart). The escape (a bank of 45 to 50 degrees, level or climbing) takes the drone out of the circle, then to the clearing's edge. Of the 11 crashes with another drone within 12 m in the last 10 s, 10 had an enemy

Not in the table: the order changes. The orders flip between towers (Take(3), Take(2), Take(3) in 2 s in one dump), who orders is not this change's concern.

What changed

  • towers_ground::plan_ttl: a plan is good for the rest of the game, not for 3 s. Test: a_plan_is_good_for_the_rest_of_the_game_so_a_drone_in_a_shadow_keeps_its_orbit.
  • towers_ground::standing_for: the standing plan of a drone that takes a tower, or flies a low circle, is a climb on the same circle (over the trees), not home. The executor's standing plan was not what took over in the dumps (the plan id in AG_PLAN did not change at the end of the plan, AG_FALL read 1: not found out), so this is defensive. Test: a_drone_that_circles_low_climbs_where_it_circles_when_the_plans_stop_and_does_not_fly_home_low.
  • flight::orbit_radius: Blue circles a tower 40 m out, Red 50 m (the rings are 10 m apart, the separation zone is 7 m), and the circle's offset for a lane approach is the least of 15 m and what is left inside 55 m (flight::tangent). Test: the_two_teams_circle_a_tower_on_rings_that_keep_them_out_of_each_others_separation_zone. This changes the game's numbers: Red's orbit is 50 m, not 40 m, still inside the tower's circle of 60 m with 5 m to spare (rules text: plans/towers.md, domains/recreation/README.md, expectations/09-towers/arduplane/01-arduplane.expect say so now).
  • flight::leg: a drone below 30 m in the clearing of the tower it takes stays down when it strays more than 60 m from the tower (it used to be sent to its high height, a climb in a hard turn among the trees). Test: a_low_drone_that_strays_from_its_circle_in_the_clearing_stays_down_and_does_not_climb_out (fails without the change).
  • towers_ground::bank_limit: the heavy drone is told ROLL_LIMIT_DEG 45 (PARAM_SET, like the floor). Test: the_heavy_drone_is_held_to_a_bank_it_does_not_stall_in_and_still_fits_its_ring. It did not stop the heavy drone's crashes (see below).
  • World::radio: a crashed drone is put back with a full pack. Test: a_crashed_drone_is_back_at_its_base_with_a_full_battery. Right in itself; not shown to be the cause of the respawn dives.

The executor's safety envelope, the plan ABI and ardupilot/ are not touched. The arena (cognition_towers --example denial) gives the same numbers before and after (the diff of the two outputs is empty).

Before and after

The machine's load changes the crash count a lot (the same old code gave 2.75 a game in one batch and 0.75 in another), so the comparison is old code and new code interleaved game by game, 8 pairs a run:

Run Old code, crashes in 8 games Final code, crashes in 8 games
A/B 1 (final code without the plan's lifetime of the whole game) 22 (3, 0, 3, 0, 2, 5, 8, 1) 17 (2, 5, 5, 2, 0, 1, 1, 1)
A/B 2 10 (1, 1, 1, 1, 0, 0, 3, 3) 5 (1, 0, 1, 0, 1, 1, 1, 0)
A/B 3 6 (0, 0, 1, 2, 0, 2, 0, 1) 4 (1, 0, 0, 0, 0, 2, 0, 1)

With the final code (A/B 2 and 3): 9 crashes in 16 games, 0.56 a game, 8 games in 16 without one; the old code in the same 16 pairs: 16 crashes, 1.0 a game, 6 in 16 without one. That is a lower count but not a significant one (16 against 9 crashes); the change that shows is in the causes: of the old code's 16, 9 were drones out of contact; of the final code's 9, none.

By cause, final code (16 games): 8 of the 9 are the heavy drone (7 in flight, 1 at the base after a respawn), 1 is a standard drone (leaving a lane, with another drone 28 m off and the envelope intervening). Batches in between, not interleaved and so only a guide (14 games each unless said): rings and the clearing's stay-down 24 crashes; plus the heavy bank 14 in 8 games; plus a plan good for 45 s 21; plus the standing plan of a low circle 16.

The server's acceptance test (cargo test --release -p recreation_towers_server --test acceptance), 4 runs of 2 games each: passed 2 (both games with no crash), failed 1 on the crash expectation (1 crash in each game), failed 1 with 0 crashes in both games (another expectation; not looked into, likely the known "Blue took at least 1 tower" one). So "No drone crashes" held in 3 of 4 runs; it is not a gate that passes reliably yet.

What is left, plainly

  • The heavy drone: 8 of the final code's 9 crashes (7 in flight, 1 at the base). Bank of 72 to 83 degrees and a spiral at the end, with another drone within 16 m in the 10 s before in 6 of the 7 in flight, on a lane (350 to 735 m from a tower) or at a tower. In the flight controller's log the separation escape asks for a bank of 45 and a pitch of +25 degrees with a throttle of 0.27: a heavy drone with no energy, in a banked turn, near the stall. That is in the executor's safety envelope (mod safety) and in the roll loop that ardupilot/t2-cruza.parm leaves at the T1-S's gains. Neither is this change's to touch; the evidence is in the track dumps (track, the 'near' and 'env' columns) and the AGNT/ATT records.
  • The respawn dive: not found out (see the table).
  • The standing plan that should take over after 45 s of silence did not take over in the dumps: the plan id stayed the same and AG_FALL read 1, once the plan had run out. A drone out of contact now keeps circling its tower until the game ends or contact returns.
  • The A/B runs are 24 games of the old code and 16 of the new one; with counts of one to five a game, differences of a few crashes are noise.

🤖 Generated with Claude Code

ptescher and others added 2 commits November 14, 2026 23:32
…avy bank, crash track dump)

The server prints a crashinfo line and the last 10 s of the drone for each crash.
From 14 games (33 crashes): drones out of contact in an enemy tower's radio shadow flew
a loiter round the point where a 3 s plan ran out, out of the clearing; Red and Blue meet head
on in one circle (separation escapes); the heavy drone stalls in 50 degrees of bank.
Plans last the rest of the game, the teams circle on rings 10 m apart, a low drone in its
clearing stays down, the heavy drone banks 45 degrees at most, a respawned drone has a full pack.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@ptescher
ptescher merged commit 801853f into master Nov 15, 2026
2 checks passed
@ptescher
ptescher deleted the towers-tree-strikes branch November 15, 2026 15:46
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