feat(failure_injection): Enable failure-injection on hardware, and through RC-switch#27832
Open
Claudio-Chies wants to merge 5 commits into
Open
feat(failure_injection): Enable failure-injection on hardware, and through RC-switch#27832Claudio-Chies wants to merge 5 commits into
Claudio-Chies wants to merge 5 commits into
Conversation
added 2 commits
July 7, 2026 15:48
…port and instance bitmasking feat(failure_injection): add disabled failure injection manager and system command support for v5x and v6x boards
31a7540 to
6a3bf90
Compare
Contributor
🔎 FLASH Analysispx4_fmu-v5x [Total VM Diff: 64 byte (0 %)]px4_fmu-v6x [Total VM Diff: 56 byte (0 %)]Updated: 2026-07-08T14:18:12 |
Contributor
|
No broken links found in changed files. |
added 3 commits
July 8, 2026 12:55
Add a value-mutating apply-site for FAILURE_UNIT_SYSTEM_BATTERY. On an injected OFF the outgoing battery_status is reported as a depleted pack (zero remaining, emergency warning) so the low-battery failsafe triggers. The apply-site lives in the shared Battery library, covering the analog ADC, INA power monitors, ESC battery and SITL in one place, plus the UAVCAN battery driver which publishes battery_status directly. The previous SITL-only hack in BatterySimulator is removed in favour of this shared path so simulation and hardware behave identically.
…commands across multiple boards
8b91514 to
9ed50b4
Compare
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
Extends failure injection beyond the SITL simulators so failures can be injected on real hardware, triggered from an RC switch, and applied to multiple instances at once. All new apply-sites compile in only with the
failure_injection_managermodule and stay gated at runtime bySYS_FAILURE_EN.Problem
Failure injection only worked through the SITL sensor/actuator sims. On real hardware
failure <sensor>did nothing; failures could only be commanded over MAVLink/console with no RC trigger; andMAV_CMD_INJECT_FAILUREcould target a single instance only.Solution
SYS_FAIL_RC_SRCselects AUX1–6 (mapped viaRC_MAP_AUXn), withSYS_FAIL_RC_UNIT/SYS_FAIL_RC_MODE/SYS_FAIL_RC_INSTdescribing the failure;MAV_CMD_INJECT_FAILUREinstance bitmask (param4) support, plus afailure -m <mask>console option.distance_sensoradded to the capability catalogue; FAILURE_UNIT_SYSTEM_ESC (106) mirrored from MAVLink (reserved, not yet implemented).All new paths are gated by
CONFIG_MODULES_FAILURE_INJECTION_MANAGER+SYS_FAILURE_EN.