Repository navigation
autotest: fix and re-enable Plane.TerrainRally - #34517
Conversation
Previous review (2026-09-28)Automated review note — AI-generated (Claude), validated against the live diff. Please sanity-check before acting. Reviewed at head Most of this works — the terrain loading pacing, the guided legs and the second rally leg all check the right thing — but the first rally check asserts an altitude the plane never holds, and passes only on a transient. Three independent passes reached the same conclusion. Bug
Suggestion
Note (out of scope for this PR)
Checked
|
69b10d7 to
2f4394d
Compare
Previous review (2026-09-28)Automated review note — AI-generated (Claude), validated against the live diff. Please sanity-check before acting. Re-reviewed at head No blockers. Both findings from my previous comment are resolved; the out-of-scope doc note is unchanged, which is fine for this PR. Resolved
Still open (out of scope)
Checked
|
| guided_loc = Location(-35.39723762, 149.07284612, 99.0, AltFrame.ABOVE_TERRAIN) | ||
| # uploaded relative to home; TERRAIN_FOLLOW makes RTL follow | ||
| # terrain on the way, but it arrives at the same AMSL height | ||
| rally_loc_home = Location(-35.3654952000, 149.1558698000, 100, AltFrame.ABOVE_HOME) |
There was a problem hiding this comment.
| rally_loc_home = Location(-35.3654952000, 149.1558698000, 100, AltFrame.ABOVE_HOME) | |
| rally_loc_relhome = Location(-35.3654952000, 149.1558698000, 100, AltFrame.ABOVE_HOME) |
The guided and rally locations carried AMSL altitudes while being sent in the terrain frame, so the vehicle climbed several hundred metres and the test could only pass vacuously. Use a terrain-relative guided location, upload the first rally point relative to home (TERRAIN_FOLLOW makes RTL fly it relative to terrain) and the second in the terrain frame, and check arrival against terrain-relative targets. terrain_wait_path sent TERRAIN_CHECKs in a tight loop, which kept the link saturated with TERRAIN_REPORTs so the vehicle never had room to send TERRAIN_REQUEST and loading stalled on an empty terrain cache. Pace it at 1Hz, and also check the path end points, including the guided location, so their terrain height is known before arrival is checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2f4394d to
76c7051
Compare
|
Thanks, done. CI on the new commit: |
|
Automated review note — AI-generated (Claude+Codex), validated against the live diff. Please sanity-check before acting. Reviewed at head Re-reviewed at head The rename to Checked
CI
Not re-run at this head Optional nit Still open, out of scope |

Summary
Fixes #33740. Plane.TerrainRally now checks the altitudes it is meant to check, and it is removed from the disabled tests.
Classification & Testing (check all that apply and add your own)
Tools/autotest/autotest.py build.Plane test.Plane.TerrainRallyon macOS (arm64) SITL, with an empty terrain cache for each run:pending=56and the test times out before takeoff.TERRAIN_FOLLOW=0for the first leg makes the test fail (below 50m AGL).All workflows pass on the fork.
Description
Altitude frames. The guided and rally targets were AMSL values sent in the terrain frame. Now:
TERRAIN_FOLLOW, RTL follows terrain on the way.change_alt_frame()keeps the AMSL height, so the plane arrives at home+100m, and that is what the test checks.TERRAIN_FOLLOW=0, and is checked against 100m above terrain.minimum_duration=10, so they check where the plane settles, not a moment during the descent.terrain_wait_path. It sent TERRAIN_CHECKs in a tight loop. With an empty terrain cache the vehicle answered with ~450k TERRAIN_REPORTs, left no room on the link for TERRAIN_REQUEST, and loading never finished. This PR:
wait_locationconverts the target to AMSLNote: the
TERRAIN_FOLLOWparameter docs say rally altitudes are taken as height above terrain, but the code keeps the AMSL height. This PR tests what the firmware does today and does not change that.This contribution was AI-assisted (Claude Code): it investigated the failure, wrote the change and ran the SITL checks above. I have not reviewed the code myself. @robertlong13 agreed on the issue to me opening this PR.
🤖 Generated with Claude Code