tools+docs: the pitch stick sign was inverted - the pilot fires now

Measured, not argued: command a 45-degree-off-the-nose error and watch whether it
shrinks, both axes, both sides, two pulse widths, with the opposite sign as a
control. Yaw's sign is correct (45 -> 11.3/32.7 at 0.6 s, 41.6/33.8 at 1.2 s).
Pitch's is inverted - the pilot's own sign GREW the error every time
(48.3/55.6/70.7/91.7) and the opposite shrank it every time (30.7/41.5/15.7/9.6).

A method artefact is recorded because it gave the opposite answer first: a 3 s
full-deflection pulse overshoots a 45-degree error so far that BOTH signs look
wrong (45 -> 164 and 45 -> 178). A long pulse cannot answer a sign question.

Verified against the game rather than by inspection. Before: fire=1 in 0 of 13521
samples, |aim yaw| pinned at 90.0, target 36-43 km away. After: 43 of 1732, aim
down to 2.3 degrees, range median 6.3 km, and the HUD's own ammunition counters
moving - NOSE BM 06000 -> 05723, MAIN MPM 00300 -> 00298.

Also fixed a leftover of the same FIFO era: pilot.py called pad.f.write("tap A
90") for the target-select double tap, which raised AttributeError once Pad
stopped having an `f`. Pad gained tap()/dpad(); ctrl_probe.py and target_probe.py
still use pad.f and now say so in place.

Still open: YOU KILLED is 0000 after 250 s of firing and REMAINING OB is still
012. The craft shoots, closes and selects; whether it destroys anything is next.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PMRJjbxLqZtsb5Vb7KunPE
This commit is contained in:
Sylpheed RE agent
2026-08-23 22:39:33 +00:00
parent 70497b1606
commit 5a9b16bf03
7 changed files with 212 additions and 4 deletions

View File

@@ -283,8 +283,9 @@ class Pilot:
"""A, twice: make the GAME target what we are already pointing at."""
if self.dry or t - self.select_t < self.SELECT_PERIOD:
return
self.pad.f.write("tap A 90\n")
self.pad.f.write("tap A 90\n")
# Target select is (A) pressed TWICE — see autopilot-memory-driven.md.
self.pad.tap("A", 0.09)
self.pad.tap("A", 0.09)
self.select_t = t
self.selects += 1
@@ -404,7 +405,17 @@ class Pilot:
if ez < 0: # target behind: commit to a full turn
yaw = math.copysign(math.pi / 2, ex if ex else 1.0)
sx = max(-1.0, min(1.0, self.KP * yaw - self.KD * float(np.dot(w, up))))
sy = max(-1.0, min(1.0, -(self.KP * pitch - self.KD * float(np.dot(w, right)))))
# 🔴 The leading minus was WRONG and is measured out (2026-08-23). With
# the pad finally reaching the game, a 45°-off-the-nose error was
# commanded with this convention and with its opposite, at 0.6 s and
# 1.2 s pulses, both sides: the pilot's own sign GREW the error every
# time (45° -> 48/56/71/92) and the opposite sign SHRANK it every time
# (45° -> 31/41/16/10). Yaw's sign, tested the same way, is correct.
#
# Method note, because the first attempt got the opposite answer: a 3 s
# full-deflection pulse OVERSHOOTS a 45° error so far that both signs
# look wrong. Pulse short, or measure the initial rotation direction.
sy = max(-1.0, min(1.0, self.KP * pitch - self.KD * float(np.dot(w, right))))
return sx, sy, yaw, pitch
# ---------------------------------------------------------------- step