Skip to content

feat(Vehicle): lock out pre-flight actions during vehicle sync - #15356

Open
DonLakeFlyer wants to merge 1 commit into
mavlink:masterfrom
DonLakeFlyer:feat/vehicle-sync-lockout
Open

DonLakeFlyer wants to merge 1 commit into
mavlink:masterfrom
DonLakeFlyer:feat/vehicle-sync-lockout

Conversation

@DonLakeFlyer

@DonLakeFlyer DonLakeFlyer commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Feature Description

Locks out the pre-flight actions (Arm, Takeoff and Start Mission) until initial connect has finished loading the vehicle's parameters, plan and other state. Before this change, these actions could be offered while QGC still had an incomplete picture of the vehicle. On ArduPilot, for example, Arm and Takeoff were available as soon as the vehicle appeared.

While syncing, the main status indicator shows a yellow Vehicle Sync badge. The full height initial connect progress display is removed; only the progress line along the bottom of the toolbar remains.

Implementation Details

  • VehicleReadiness gains a Syncing status (builds on feat(Vehicle): firmware-driven guided action readiness #15353). Until initial connect completes, canArm, canTakeoff and canStartMission are false.
    • The lockout is applied after the firmware overrides, so neither firmware nor custom builds can lift it. It takes precedence over an enforced pre-flight checklist.
    • It replaces PX4's wait for a health report before initial connect completes, so _expectsHealthAndArmingChecks is removed. The 10 s health report fallback after initial connect is unchanged.
  • Toolbar:
    • A Vehicle Sync badge sits where the Error/Warning pill normally goes, and replaces the severity pill, reboot required icon and firmware update badge while syncing.
    • The status text keeps its normal states, so Comms Lost still shows. During sync it reads a yellow Not Ready (or Armed, Flying or Landing on yellow), the same as while waiting for a health report.
    • The full height "Downloading" display is removed from ParameterDownloadProgress.qml.
  • Joystick: the Arm and Toggle Arm buttons will not arm while syncing.
    • The first blocked press shows "Arming is not available until vehicle sync completes.", once per sync, so repeated presses don't stack dialogs.
    • Disarm is not affected.
  • Not locked out: Force Arm, Disarm, Emergency Stop and the in-flight actions (RTL, Land, Pause and so on). QGC can connect to a vehicle that is already flying, so these must stay available during sync.
  • Docs: the Vehicle Sync badge and the lockout are described under Flight Status Badges in fly_view_toolbar.md, and the yellow Not Ready entry mentions syncing.

Joystick.cc's include block is re-sorted by clang-format (IncludeBlocks: Regroup) because two includes were added; the hook enforces this.

Not covered: the multi-vehicle Arm and Start actions in the Fly View's Multi Vehicle Actions panel still ignore readiness, as they did before this change, so they are not locked out during sync either.

Testing

  • Tested locally
  • Added/updated unit tests
  • Tested with simulator (SITL)
  • Tested with hardware

New and updated tests:

  • VehicleReadinessTest: table rows for the lockout. It covers a ready vehicle, an armed vehicle, a vehicle with no health report, and sync taking precedence over the checklist. Rows for the removed PX4 pre-connect wait are rewritten or dropped.

  • VehicleReadinessPX4Test::_testLockedOutDuringInitialConnect (was _testWaitsForHealthReportDuringInitialConnect). While the vehicle is still syncing, it checks that:

    • every action is locked out, even when a firmware override allows arming;
    • joystick Arm presses don't reach the vehicle, but Disarm does;
    • repeated presses show the message once.

    After connect completes, it checks that every action, including joystick Arm, is allowed again.

Results:

  • cmake --build build/don-mac-debug: passed
  • ctest -L Unit -LE "Flaky|Network" --parallel 8 --output-on-failure: passed (353/353)
  • ctest -L Integration -LE "Flaky|Network" --parallel 2 --output-on-failure: passed (93/93)
  • pre-commit run --from-ref upstream/master --to-ref HEAD --files <changed files>: passed

The toolbar's "Vehicle Sync" badge and the hiding of the other badges have no UI test. ToolbarIndicatorUITest waits for initial connect to complete, so it would need MockLink to hold sync open.

Platforms Tested

  • Linux
  • Windows
  • macOS
  • Android
  • iOS

Flight Stacks Tested

  • PX4
  • ArduPilot

Screenshots / Demo

N/A

Checklist

  • I have read the Contribution Guidelines
  • My code follows the project's coding standards
  • I have added tests that prove my feature works
  • New and existing unit tests pass locally

Related Issues

Relates to #15353


By submitting this pull request, I confirm that my contribution is made under the terms of the project's dual license (Apache 2.0 and GPL v3).

Copilot AI balanced review requested due to automatic review settings October 20, 2026 03:06
Arm, Takeoff and Start Mission are no longer allowed while initial connect
is still loading the vehicle's parameters, plan and other state.

- VehicleReadiness gains a Syncing status. Until initial connect completes,
  canArm, canTakeoff and canStartMission are false. The lockout is applied
  after firmware overrides, so neither firmware nor custom builds can lift
  it, and it takes precedence over an enforced checklist.
- This replaces PX4's wait for a health report before initial connect
  completes, so _expectsHealthAndArmingChecks is removed. The 10 second
  health report fallback after initial connect is unchanged.
- The main status indicator shows a yellow "Vehicle Sync" badge while
  syncing, which replaces the severity, reboot required and firmware update
  badges. The status text shows a yellow "Not Ready" (or Armed, Flying,
  Landing on yellow) as it does while waiting for a health report.
- The full height initial connect progress display is removed. Only the
  progress line along the bottom of the toolbar remains.
- Joystick Arm and Toggle Arm buttons will not arm while syncing. The first
  blocked press shows a message, once per sync. Disarm is not affected.
- Force Arm, Disarm, Emergency Stop and in-flight actions are not locked
  out, since QGC can connect to a vehicle which is already flying.

The Joystick.cc include block is re-sorted by clang-format
(IncludeBlocks: Regroup) after adding AppMessages.h and VehicleReadiness.h.
@DonLakeFlyer
DonLakeFlyer force-pushed the feat/vehicle-sync-lockout branch from b9b79e9 to 94ca0af Compare October 20, 2026 03:09

Copilot AI 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.

🔵 Needs a closer look

Flight-critical lockouts span C++ and QML and warrant human review, with simulator and hardware validation still outstanding.

No open issues 🎉

What changed in this PR

Adds a centralized vehicle-sync lockout for pre-flight actions while preserving disarm and in-flight controls.

Changes:

  • Blocks Arm, Takeoff and Start Mission during initial sync, including joystick arming.
  • Shows a yellow Vehicle Sync status and simplifies toolbar progress.
  • Updates readiness tests and user documentation.
File Description
test/​Vehicle/​VehicleReadinessTest.h Renames the sync-lockout test.
test/​Vehicle/​VehicleReadinessTest.cc Tests lockouts, firmware overrides and joystick behavior.
src/​Vehicle/​VehicleReadiness.h Defines Syncing status and lockout interface.
src/​Vehicle/​VehicleReadiness.cc Applies sync lockouts after firmware overrides.
src/​Toolbar/​ParameterDownloadProgress.qml Removes the full-height progress overlay.
src/​Toolbar/​MainStatusIndicator.qml Prioritizes Vehicle Sync and hides badges.
src/​Joystick/​Joystick.h Declares guarded arming and notification state.
src/​Joystick/​Joystick.cc Blocks arming during sync with a one-time message.
src/​FlyView/​GuidedActionsController.qml Removes an unused connection-state property.
src/​FirmwarePlugin/​PX4/​PX4VehicleReadiness.h Removes the superseded health-report expectation override.
docs/​en/​qgc-user-guide/​fly_view/​fly_view_toolbar.md Documents Vehicle Sync behavior.

Review effort: Balanced

@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 52.38095% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.82%. Comparing base (f29efd3) to head (94ca0af).
⚠️ Report is 610 commits behind head on master.

Files with missing lines Patch % Lines
src/Joystick/Joystick.cc 46.15% 1 Missing and 6 partials ⚠️
src/Vehicle/VehicleReadiness.cc 62.50% 2 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #15356       +/-   ##
===========================================
+ Coverage   25.47%   40.82%   +15.35%     
===========================================
  Files         769     1075      +306     
  Lines       65912    96865    +30953     
  Branches    30495    44092    +13597     
===========================================
+ Hits        16788    39548    +22760     
+ Misses      37285    32969     -4316     
- Partials    11839    24348    +12509     
Flag Coverage Δ
unittests 40.82% <52.38%> (+15.35%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/Joystick/Joystick.h 17.89% <ø> (+2.84%) ⬆️
src/Vehicle/VehicleReadiness.h 93.33% <ø> (ø)
src/Vehicle/VehicleReadiness.cc 60.41% <62.50%> (ø)
src/Joystick/Joystick.cc 11.77% <46.15%> (+4.43%) ⬆️

... and 862 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 45f1fd7...94ca0af. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants