Skip to content

Preserve relative-alt guided behavior by setting Locationwp.frame at implicit callers#3728

Open
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-set-guided-mode-ripple-effect
Open

Preserve relative-alt guided behavior by setting Locationwp.frame at implicit callers#3728
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-set-guided-mode-ripple-effect

Conversation

Copy link
Copy Markdown

Copilot AI commented May 29, 2026

A recent guided-mode path change surfaced a behavior shift: callers constructing Locationwp without frame now send default GLOBAL (AMSL) instead of the previously normalized relative-alt behavior. For Copter paths passing relative altitude, this can produce unintended altitude commands.

  • Scope: explicit frame assignment at affected guided callers

    • Added frame = (byte)MAVLink.MAV_FRAME.GLOBAL_RELATIVE_ALT where Locationwp was built with lat/lng/alt only before setGuidedModeWP(...).
    • Updated call sites:
      • Controls/FollowMe.cs
      • Utilities/httpserver.cs (/guide GET + POST handlers)
      • Swarm/FollowPath.cs
      • ExtLibs/ExtGuided/ExtGuidedPlugin.cs
      • Plugins/example14-mass.cs
      • ExtLibs/Xamarin/Xamarin/Linked/httpserver.cs (mirrored HTTP guided handlers)
  • Behavioral intent

    • Restore pre-change semantics for these paths by making altitude frame explicit.
    • Keep existing FlyToHere / GuidedMode.frame-threaded paths untouched.
var gwp = new Locationwp
{
    lat = ...,
    lng = ...,
    alt = ...,
    frame = (byte)MAVLink.MAV_FRAME.GLOBAL_RELATIVE_ALT
};
MainV2.comPort.setGuidedModeWP(gwp);

Copilot AI changed the title [WIP] Fix ripple effect for setGuidedModeWP callers Preserve relative-alt guided behavior by setting Locationwp.frame at implicit callers May 29, 2026
Copilot finished work on behalf of meee1 May 29, 2026 21:01
Copilot AI requested a review from meee1 May 29, 2026 21:01
@meee1 meee1 marked this pull request as ready for review May 29, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Heads-up that this change has a subtle ripple effect for setGuidedModeWP callers that don't explicitly set

2 participants