Commit Graph
4 Commits
Author SHA1 Message Date
Claudio Chies 6bfe60507d feat(failure_injection): add CAN bus failure injection (#28140) 2026-08-25 10:33:52 +02:00
55bb872df1 feat(failure_injection): add ADS-B traffic failure injection and battery severity levels (#27950)
* feat(failure_injection): add ADS-B traffic-avoidance failure injection

Wire up FAILURE_UNIT_SYSTEM_TRAFFIC_AVOIDANCE (107) for the MAVLink-based
traffic avoidance path:

- OFF suppresses and STUCK freezes the incoming transponder_report, applied
  both at the MAVLink ADS-B ingestion (handle_message_adsb_vehicle) and at
  the navigator consumer (check_traffic), so it works for real ADS-B over
  MAVLink, simulated ADS-B and the fake_traffic command.
- OFF additionally marks the ADS-B/FLARM heartbeat unhealthy so the traffic
  avoidance system health check fails, using a message-less process()
  overload.
- Add the unit to the capability catalogue (OK/OFF/STUCK), the failure
  console command, the RC-switch unit selector and the docs.

The matching MAVLink FAILURE_UNIT enum entry lives in the mavlink submodule
(common.xml) and is handled by a separate PR; the uORB mirrors in
VehicleCommand.msg and FailureInjection.msg are included here.

* feat(failure_injection): enhance battery failure injection with severity levels

* feat(failure_injection): improve battery failure handling with dynamic threshold parameters

* refactor(failure_injection): remove traffic avoidance example from documentation

* docs(docs): subedit

* feat(failure_injection): add variance setting for distance sensor and integrate rangefinder in simulator

* feat(docs): add failure injection to release notes

* docs(docs): Add sim_mavlink back to heading

* fix(failure_injection): update default battery failure injection severity to Emergency

* docs(docs): get away from footnotes

* feat(failure_injection): enhance battery failure injection handling and update traffic unit support

* feat(failure_injection): add traffic avoidance handling tests and configurations

* [AUTO COMMIT] update EKF change indication

See .github/workflows/checks.yml for more details

* Apply suggestion from @hamishwillee

* feat(failure_injection): update failure types and handling for traffic avoidance and ESC telemetry

* fix(typo)

* [AUTO COMMIT] update EKF change indication

See .github/workflows/checks.yml for more details

* fix(docs): clarify notes on GPS and airspeed handling in failure injection documentation

---------

Co-authored-by: Claudio Chies <chiesc@chies.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2026-08-21 14:23:06 +02:00
Claudio ChiesandClaudio Chies d63f30c612 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>
2026-07-15 07:56:13 -07:00
f937bd5818 refactor(failure_injection): centralize MAV_CMD_INJECT_FAILURE behind a manager module (#27572)
* feat(failure_injection): add failure_injection topic and helper library

* feat(failure_injection): add failure injection manager module

* refactor(commander): route motor failure injection through the manager

* refactor(simulation): route sensor sim failure injection through the manager

* refactor(simulation): route SimulatorMavlink failure injection through the manager

* feat(failure_injection): start the manager in the SITL startup

* docs(failure_injection): document per-simulator failure support

* feat(failure_injection): enhance failure injection management and configuration

* fix(rebase): baro failure injectionb

* refactor(failure_injection): simplify FailureInjectionManager and FailureTable implementations

* refactor(failure_injection): replace Subscriber with Config in various modules and add update method

* update(uorb): FailureInjection.msg to docs standard

* docs(docs): subedit

* fix(failure_injection): correct comment formatting in FailureInjection.msg

* feat(failure_injection): add failure injection manager support across multiple boards and modules

* feat(mavlink): implement failure injection functionality

---------

Co-authored-by: Claudio Chies <chiesc@chies.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2026-06-30 15:33:39 +02:00