Skip to content

Plane: GLIDE failsafe becomes dedicated mode - #34971

Open
IamPete1 wants to merge 4 commits into
ArduPilot:masterfrom
IamPete1:glide_fs_mode
Open

IamPete1 wants to merge 4 commits into
ArduPilot:masterfrom
IamPete1:glide_fs_mode

Conversation

@IamPete1

@IamPete1 IamPete1 commented Nov 3, 2026

Copy link
Copy Markdown
Member

Summary

A alternate approach to #34351, by making the glide failsafe a dedicated mode all the tricky entry and exit behavior is resolved.

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

Changes to a dedicated mode, there is some behavior changes as a result, but I think for the better. The benefit of the dedicated mode is that its clearer to the user when they are in normal FBWA and when there in a Glide failsafe. There is no contradiction of reported mode and behavior. I'm open to better name ideas, I wanted to make it clear that this was a failsafe and not related to soaring/thermaling.

This also opens the path for potential improvements, such as gliding into the wind rather than just holding 0/0.

@AP-Review

AP-Review commented Nov 3, 2026 •

Copy link
Copy Markdown

Deprecated — see below for the updated review.

Previous review (2026-11-03)

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

Reviewed at head ae99325dba.
Full report: https://firmware.ardupilot.org/Tools/APReview/DevCallReviews/PRReviews/ardupilot/ardupilot/34971/1.html#pr34971

The new Glide FS mode does what it says: the PR's new and modified autotests pass at head, and I found no blocking issues.

Should fix

  • ArduPlane/Parameters.cpp:448: Glide FS stays engaged after a long or GCS failsafe clears, with zero throttle and no stick mixing, until the pilot changes mode. With FS_LONG_ACTN=2, a GCS failsafe while RC is healthy used to leave the pilot in FBWA. Now it cuts the throttle. Please say this in the FS_LONG_ACTN, FS_SHORT_ACTN and RCx_OPTION 157 docs and in the PR description.
Minor (2)
  • ArduPlane/mode_glide_failsafe.cpp:16: with a landing-flare switch (aux 89) on and THR_MIN>0, force_flare() in servos.cpp sets throttle back to THR_MIN after run() has zeroed it, because Glide FS is not an auto-throttle mode. The old FBWA glide did the same; skipping the throttle part of force_flare() in Glide FS would make the zero-throttle guarantee hold.
  • ArduPlane/mode.h:73: mode 27 is not yet in the mavlink PLANE_MODE enum or pymavlink's mode map. A companion mavlink PR would let GCSes that use those name the mode.

The blank lines before } else if in events.cpp are not a problem: astyle keeps them and nearby Plane code does the same.

Not fully reviewed: ChibiOS builds and flash cost, the full Plane/QuadPlane autotest suites, and Q_ASSIST/tiltrotor behaviour during Glide FS were not run.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Global Size Summary (Total Flash delta in bytes)

Built from dc351bb rebased onto a995235

Board Periph tracker blimp bootloader copter heli iofw plane rover sub
DrotekP3Pro _ _ _ * _ _ _ _ _ _
Durandal _ * * _ * * _ +212 * *
Hitec-Airspeed * _ _ _ _ _ _ _ _ _
KakuteF7 _ * * _ * * _ +396 * *
MambaH743v4 _ * * _ * * _ +200 * *
MatekF405-CAN _ _ _ * _ _ _ _ _ _
MatekF405 _ * * _ * * _ +396 * *
MatekH743-bdshot _ * * _ * * _ +288 * *
Pixhawk1-1M _ * * _ * * _ +172 * *
disco _ * * _ * * _ +542 * *
f103-GPS * _ _ _ _ _ _ _ _ _

@LupusTheCanine

Copy link
Copy Markdown

Could it be extended to become proper glide mode?

@IamPete1

IamPete1 commented Nov 3, 2026

Copy link
Copy Markdown
Member Author
  • ArduPlane/Parameters.cpp:448: Glide FS stays engaged after a long or GCS failsafe clears, with zero throttle and no stick mixing, until the pilot changes mode. With FS_LONG_ACTN=2, a GCS failsafe while RC is healthy used to leave the pilot in FBWA. Now it cuts the throttle. Please say this in the FS_LONG_ACTN, FS_SHORT_ACTN and RCx_OPTION 157 docs and in the PR description.

This change in behavior is intentional, it makes the glide failsafe action consistent with other actions such as RTL.

@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label Nov 3, 2026
@peterbarker

Copy link
Copy Markdown
Contributor

Possibly stale comment above bool emergency_landing; in Plane.h

@tridge

tridge commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

@IamPete1 can you look and see if you are happy with the AI review comment, I think it's deliberate, but please check

@Hwurzburg Hwurzburg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is true mode and can be pilot entered, the name should be GLIDE not GLIDE FS, since FS is not the only way it gets activated...

@IamPete1

IamPete1 commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

Since this is true mode and can be pilot entered, the name should be GLIDE not GLIDE FS, since FS is not the only way it gets activated...

I wanted to differentiate it from soaring/thermaling, but maybe your right, certainty GLFS is not a great 4 char name, GLDE would be better.

@timtuxworth timtuxworth left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this @IamPete1 , but I agree with @Hwurzburg - let's just call it "Glide", since it can be pilot entered. 4 char abbreviation could be GLID I think.

@Georacer Georacer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I much prefer this incarnation, well done!

I am of the opinion that GLIDE_FS is a better name for the mode, because simply glide to me would mean some sort of user control.
Appending the "_FS" somewhat conveys that this mode is handicapped in some way.

Perhaps even better we could prevent the user from going into GLIDE_FS completely via RC, just like FLTMODE_GCSBLOCK does?

Comment thread ArduPlane/mode_glide.cpp
Mode::run();

// Always zero throttle
SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, 0.0);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this. It can accommodate ICE options in the future, akin to what Henry is asking for.

Comment thread libraries/RC_Channel/RC_Channel.cpp Resolved
Comment thread libraries/RC_Channel/RC_Channel.h Resolved
Comment thread Tools/autotest/arduplane.py Resolved
@Hwurzburg

Hwurzburg commented Nov 10, 2026 via email •

Copy link
Copy Markdown
Contributor

@peterbarker

Copy link
Copy Markdown
Contributor

#3037 is relevant

@IamPete1

Copy link
Copy Markdown
Member Author

I have decided that since it is a full mode there is no real reason not to let the user switch into it. It takes more code to prevent that. We certainly should not recommend people add it to there mode switch without understanding its behavior. But I can think of some cases where it may be useful to switch into it manually.

@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 dc351bbd15.
Full report: https://firmware.ardupilot.org/Tools/APReview/DevCallReviews/PRReviews/ardupilot/ardupilot/34971/2.html#pr34971

The dedicated Glide mode still works as described at dc351bbd15: the PR's new and changed autotests pass, and I found nothing blocking.
Since the last review the mode was renamed to Glide, the FS_SHORT_ACTN and FS_LONG_ACTN docs now say it means zero throttle and wings level, and you confirmed that staying in Glide after a long or GCS failsafe clears is intended, like RTL, so I've dropped that request.

Minor (3)
  • ArduPlane/GCS_MAVLink_Plane.cpp:52: with the default STICK_MIXING=1 the heartbeat in Glide still sets MAV_MODE_FLAG_MANUAL_INPUT_ENABLED, although Glide ignores the sticks. Leaving the flag off when control_mode == &mode_glide would fix it; the old FBWA glide had the same mismatch.
  • ArduPlane/mode_glide.cpp:16: force_flare() puts throttle back to THR_MIN when a flare switch is on (still open).
  • ArduPlane/mode.h:73: mode 27 is not in the mavlink PLANE_MODE enum or pymavlink's mode map (still open).

The red test blimp CI job looks unrelated: outside ArduPlane this PR only changes comments, the Blimp suite passes locally at this head, and blimp is green on master at the merge base. Other CI jobs were still running when I checked.

Not fully reviewed: the full Plane and QuadPlane autotest suites, Q_ASSIST/tiltrotor/tailsitter behaviour in Glide, ChibiOS builds other than MatekF405, and hardware were not run.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants