Conversation
…fallback notification Hardens the failsafe priority resolution framework with three changes: 1. Inline documentation: adds worked examples for axioms A1/A3/A4/A5 directly in failsafe.cpp covering navigator_failure, geofence breach, and battery escalation edge cases. 2. Unit tests: four new GoogleTest cases exercise the highest-risk conflict scenarios — simultaneous conditions (A1), duplicate RTL suppression (A4), RTL→Land fallback when home is invalid (A3), and Land overriding active RTL without a Hold interlude. 3. A3 fallback notification: notifyA3Fallback() emits a mavlink_log_critical and structured event when the framework silently degrades an action (e.g. RTL→Land due to GPS loss), with an anti-spam guard that fires at most once per worsening step. Includes a Python post-flight log validator (validate_a3_fallback_log.py) to verify event counts from ULogs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The failsafe priority framework applies five axioms (A1–A5) to resolve conflicting failure conditions, but these rules were undocumented and untested. When the framework silently degraded from RTL to Land (e.g., GPS lost mid-RTL), operators received no notification.
This PR addresses all three gaps:
failsafe.cppandframework.cppnotifyA3Fallback()fires amavlink_log_critical+ structured event when the framework degrades an action, with an anti-spam guard (fires at most once per worsening step)validate_a3_fallback_log.pyverifies A3 fallback event counts from ULogsFiles Changed
failsafe.cppfailsafe_test.cppFailsafeTesterWithFallbackCapturefixtureframework.cppframework.hnotifyA3Fallback()virtual methodvalidate_a3_fallback_log.pyNew Tests
conflict_higher_priority_winsconflict_geofence_breach_during_rtlrtl_fallback_to_land_when_home_invalidland_overrides_active_rtl_without_delayTesting