Files
ardupilot/Tools
Peter BarkerandClaude Opus 5 e98af74970 autotest: fly TestAutoSpeedFlaps' flap check at cruise, not full throttle
The FLAP_ACTUAL_SPEED subtest sets FLAP_1_SPEED=26 "above typical cruise of
~22 m/s", then commands RC3=1700 - which is not cruise.  The aircraft settles
at 26.6 m/s, *above* the threshold it just set, so the flaps deploy on the way
up through 26 and retract again a few seconds later:

    t=52.9  airspeed 24.37  flap 1380 (deployed)
    t=55.4  airspeed 26.08  flap 1380
    t=56.2  airspeed 26.31  flap 1200 (retracted)
    t=59.6  airspeed 26.60  flap 1200  ... for the rest of the test

Both assertions can therefore only hold during that 3.3s transient, and
wait_airspeed(18, 24) needs its first sample inside the ~0.3s the aircraft
spends between 22 and 24 while accelerating at 7.7 m/s/s.  On a slower
machine the first sample landed at 24.15 - 0.15 m/s late - and the test
failed; on faster ones it landed at 23.2-23.4 and passed.  Every pass so far
has been won on that transient, on a premise which is false at equilibrium.

Fly the subtest at cruise throttle instead, so measured airspeed settles
below FLAP_1_SPEED and the flaps stay deployed, and require the airspeed to
be *held* in the band rather than merely pass through it - so if a future
change moves the settled speed back out of the band the test says so instead
of quietly going back to sampling a transient.

Settled airspeed at RC3=1500, 6 runs: 22.4 - 22.8 m/s, 6/6 pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-08 10:33:15 +10:00
..
2026-09-02 12:32:45 +09:00