feat(failure_injection): Enable failure-injection on hardware, and through RC-switch (#27832)

* feat(failure_injection): integrate failure injection support across sensor drivers

* feat(failure_injection): enhance failure injection with RC switch support and instance bitmasking

feat(failure_injection): add disabled failure injection manager and system command support for v5x and v6x boards

* feat(failure_injection): add battery failure injection

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.

* fix(failure_injection): change parameter types from int32 to enum

* refactor(failure_injection): disable failure injection manager and system commands across multiple boards

* feat(failure_injection): enhance failure injection with timestamp handling and message-less support

* refactor(failure_injection): simplify has_timestamp_sample implementation and remove unused includes

* refactor(failure_injection):move conditional compilation into helper libary

* refactor(failure_injection): update CMakeLists to include failure_injection dependency across multiple drivers

---------

Co-authored-by: Claudio Chies <chiesc@chies.com>
This commit is contained in:
Claudio Chies
2026-07-15 07:56:13 -07:00
committed by GitHub
parent f0ee79d34b
commit d63f30c612
57 changed files with 658 additions and 198 deletions

View File

@@ -714,6 +714,14 @@ else
unset RC_VTXTABLE
fi
#
# Start the failure injection manager. SYS_FAILURE_EN only exists when the module is built
#
if param compare -s SYS_FAILURE_EN 1
then
failure_injection_manager start
fi
#
# Set additional parameters and env variables for selected AUTOSTART.
#