Skip to content

Copter: Refactor Flip Mode code for clarity (no behavior change)#33097

Draft
hunt0r wants to merge 6 commits into
ArduPilot:masterfrom
hunt0r:improve-flip
Draft

Copter: Refactor Flip Mode code for clarity (no behavior change)#33097
hunt0r wants to merge 6 commits into
ArduPilot:masterfrom
hunt0r:improve-flip

Conversation

@hunt0r
Copy link
Copy Markdown
Contributor

@hunt0r hunt0r commented May 18, 2026

Summary

This fixes/removes comments, creates subfunctions, and similar clarity improvements for Flip Mode. No changes to autopilot behavior.

This PR is chained behind several others, so I'll keep it in DRAFT until they land. If you want to see this PR's contributions, skip to the last ~4 commits.

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

  1. Make explicit that flip mode does not "allow_flip()". (The english is odd, but this is the correct behavior. It is also the default behavior inherited from the parent, but due to the oddness, I think it's worth being explicit.)
  2. Several spots check for "high RC stick input" from the pilot. Create a subfunction to make the value defining "high magnitude" (control >= 4000) DRY and reuse that subfunction at all call-spots.
  3. Several comments are outdated, non-DRY, or self-evident. They are removed because the code is clear as-is.

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.

1 participant