Skip to content

wp: fix Draw altitude and add remembered frame selection - #1769

Merged
tridge merged 2 commits into
ArduPilot:masterfrom
tridge:pr-draw-height
Oct 8, 2026
Merged

tridge merged 2 commits into
ArduPilot:masterfrom
tridge:pr-draw-height

Conversation

@tridge

@tridge tridge commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Draw read the wrong argument index, leaving the requested altitude unused. Reuse the frame/altitude dialog to remember session choices and create waypoints with the selected AboveHome, AGL or AMSL frame.

Draw read the wrong argument index, leaving the requested altitude unused. Reuse the frame/altitude dialog to remember session choices and create waypoints with the selected AboveHome, AGL or AMSL frame.
@tridge tridge added the AIReview label Oct 3, 2026
@AP-Review

AP-Review commented Oct 4, 2026 •

Copy link
Copy Markdown

Deprecated — see below for the updated review.

Previous review (2026-10-04)

Automated review note — AI-generated (Claude), validated against the live diff. Please sanity-check before acting.
Verdict: REQUEST CHANGES

Reviewed at head a92abed0eb.
Full report: https://firmware.ardupilot.org/Tools/APReview/DevCallReviews/PRReviews/ardupilot/mavproxy/1769/1.html#prMAVProxy-1769

Thanks, the single-argument altitude fix is real and the new tests pass. One problem remains: the frame handling now overrides the automatic terrain default. The Draw dialog fixes its default frame when the wp module loads, before TERRAIN_FOLLOW is known (https://github.com/ardupilot/mavproxy/pull/1769/files#diff-32e9fbffd1d495e943604af13b0c1ea91d3151abf35c3281abc5fa0278ac0503R39). On a terrain-following vehicle, accepting the defaults now gives AboveHome (frame 3) waypoints instead of terrain-relative ones (frame 10). Separately, a plain "wp draw" stores the automatically chosen frame in draw_frame (https://github.com/ardupilot/mavproxy/pull/1769/files#diff-32e9fbffd1d495e943604af13b0c1ea91d3151abf35c3281abc5fa0278ac0503R322), so later draws skip get_default_frame() (https://github.com/ardupilot/mavproxy/pull/1769/files#diff-32e9fbffd1d495e943604af13b0c1ea91d3151abf35c3281abc5fa0278ac0503R309) even after TERRAIN_FOLLOW or terrainalt changes. Could draw_frame hold only frames the operator chose explicitly, with the default worked out at draw time (for example, a "Default" dropdown entry that leaves the frame argument off)? A minor optional point: frames chosen on the CLI are not reflected in the dialog defaults (https://github.com/ardupilot/mavproxy/pull/1769/files#diff-32e9fbffd1d495e943604af13b0c1ea91d3151abf35c3281abc5fa0278ac0503R36). Checked offline with mocked wx and map; not checked with a live GUI or SITL.

Capturing the frame at menu creation or caching an automatic choice ignored terrain parameters loaded or changed later. Add a Default option and remember only explicit frame choices, binding the resolved frame to each active draw.
@AP-Review

Copy link
Copy Markdown

Automated review note — AI-generated (Claude+Codex), validated against the live diff. Please sanity-check before acting.
Verdict: COMMENT

Reviewed at head f8eeaffe64.
Full report: https://firmware.ardupilot.org/Tools/APReview/DevCallReviews/PRReviews/ardupilot/mavproxy/1769/2.html#prMAVProxy-1769

Thanks, the follow-up commit fixes both earlier blocking points. 'Default' is now resolved when each draw starts, and only explicit frames are remembered. Automatic draws track TERRAIN_FOLLOW changes as base did, and the new tests catch the old behaviour. One small, non-blocking suggestion: the frame is now fixed for the vehicle selected when the draw starts (https://github.com/ardupilot/mavproxy/pull/1769/files#diff-32e9fbffd1d495e943604af13b0c1ea91d3151abf35c3281abc5fa0278ac0503R324), but the completed line goes to whichever vehicle is selected when it finishes. Switching vehicles mid-draw can therefore give the second vehicle the first one's default frame. Base already uploads the line to the wrong vehicle in that case, so recording target_system in cmd_draw and dropping or warning on a completion for a different target would fix both. As before, CLI choices are not shown as the dialog defaults (https://github.com/ardupilot/mavproxy/pull/1769/files#diff-32e9fbffd1d495e943604af13b0c1ea91d3151abf35c3281abc5fa0278ac0503R37), which is optional. Checked offline with mocked wx and map; not checked with a live GUI or SITL.

@tridge
tridge merged commit 4cdf72b into ArduPilot:master Oct 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants