Repository navigation
feat(Vehicle): lock out pre-flight actions during vehicle sync - #15356
DonLakeFlyer wants to merge 1 commit into
Conversation
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.
b9b79e9 to
94ca0af
Compare
There was a problem hiding this comment.
🔵 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 Report❌ Patch coverage is
Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 862 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
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
VehicleReadinessgains aSyncingstatus (builds on feat(Vehicle): firmware-driven guided action readiness #15353). Until initial connect completes,canArm,canTakeoffandcanStartMissionare false._expectsHealthAndArmingChecksis removed. The 10 s health report fallback after initial connect is unchanged.ParameterDownloadProgress.qml.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
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:After connect completes, it checks that every action, including joystick Arm, is allowed again.
Results:
cmake --build build/don-mac-debug: passedctest -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>: passedThe toolbar's "Vehicle Sync" badge and the hiding of the other badges have no UI test.
ToolbarIndicatorUITestwaits for initial connect to complete, so it would need MockLink to hold sync open.Platforms Tested
Flight Stacks Tested
Screenshots / Demo
N/A
Checklist
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).