Skip to content

autotest: let the takeoff settle before DO_CHANGE_ALTITUDE asserts - #34082

Open
peterbarker wants to merge 1 commit into
ArduPilot:masterfrom
peterbarker:pr-claude2/pr/dca-takeoff-settle
Open

autotest: let the takeoff settle before DO_CHANGE_ALTITUDE asserts#34082
peterbarker wants to merge 1 commit into
ArduPilot:masterfrom
peterbarker:pr-claude2/pr/dca-takeoff-settle

Conversation

@peterbarker

@peterbarker peterbarker commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Hacks in a settle period for DO_CHANGE_ALTITUDE's takeoff step. TECS causes the Plane to overshoot its 30m target by 11m. That was 1.5m in 2024.

Classification & Testing (check all that apply and add your own)

  • Checked by a human programmer
  • Non-functional change
  • No-binary change
  • Infrastructure change (e.g. unit tests, helper scripts)
  • Automated test(s) verify changes (e.g. unit test, autotest)
  • Tested manually, description below (e.g. SITL)
  • Tested on hardware
  • Logs attached
  • Logs available on request

Description

The test takes off to 30m and immediately asserts 30m +-1m held for 10s within 60s. TAKEOFF hands back to TECS 2m below the target while the vehicle is still climbing at 9.3m/s, so it overshoots to about 40m, sinks to 26.5m and takes some 25s to settle - and the assertion was paying for that transient out of its own budget, using 34s of the 60. Three runs in 26 overnight ran out of time and reported an altitude on the way back up, which is why the failures were always just below the band and never above it.

Wait for the vehicle to be established first. Measured over three runs: +-2m held for 5s completes 25s after the handover. A shorter hold is no use - +-2m for 2s is satisfied after 7s by the climb passing through the band on its way up, while still 10m from settled.

The overshoot itself is a vehicle-side regression, traced to three commits between August 2024 and April 2025; this only stops the test tripping over it.

Some analysis of the overshoot. The regression from 2024 actually came in multiple tranches.

The test takes off to 30m and immediately asserts 30m +-1m held for 10s
within 60s.  TAKEOFF hands back to TECS 2m below the target while the
vehicle is still climbing at 9.3m/s, so it overshoots to about 40m, sinks
to 26.5m and takes some 25s to settle - and the assertion was paying for
that transient out of its own budget, using 34s of the 60.  Three runs in
26 overnight ran out of time and reported an altitude on the way back up,
which is why the failures were always just below the band and never above
it.

Wait for the vehicle to be established first.  Measured over three runs:
+-2m held for 5s completes 25s after the handover.  A shorter hold is no
use - +-2m for 2s is satisfied after 7s by the climb passing through the
band on its way up, while still 10m from settled.

The overshoot itself is a vehicle-side regression, traced to three
commits between August 2024 and April 2025; this only stops the test
tripping over it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@peterbarker

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant