mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-10-06 09:02:52 +08:00
* 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>
49 lines
1.8 KiB
Plaintext
49 lines
1.8 KiB
Plaintext
#Failure injection configuration.
|
|
#
|
|
# Currently active failure-injection configuration, published by the failure
|
|
# injection manager (the sole subscriber to vehicle_command INJECT_FAILURE).
|
|
# Republished only when the configuration changes, so command spam on
|
|
# vehicle_command cannot propagate to the consumers applying the failures.
|
|
|
|
uint64 timestamp # [us] Time since system start
|
|
|
|
uint8 MAX_FAILURES = 4 # maximum number of simultaneous failures
|
|
|
|
uint8 count # number of valid entries in the arrays below
|
|
|
|
uint8[4] unit # [@enum FAILURE_UNIT] Affected component per entry
|
|
# Failure unit (affected component). Mirrors MAVLink FAILURE_UNIT and the
|
|
# FAILURE_UNIT_* values in vehicle_command.
|
|
uint8 FAILURE_UNIT_SENSOR_GYRO = 0
|
|
uint8 FAILURE_UNIT_SENSOR_ACCEL = 1
|
|
uint8 FAILURE_UNIT_SENSOR_MAG = 2
|
|
uint8 FAILURE_UNIT_SENSOR_BARO = 3
|
|
uint8 FAILURE_UNIT_SENSOR_GPS = 4
|
|
uint8 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5
|
|
uint8 FAILURE_UNIT_SENSOR_VIO = 6
|
|
uint8 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7
|
|
uint8 FAILURE_UNIT_SENSOR_AIRSPEED = 8
|
|
uint8 FAILURE_UNIT_SYSTEM_BATTERY = 100
|
|
uint8 FAILURE_UNIT_SYSTEM_MOTOR = 101
|
|
uint8 FAILURE_UNIT_SYSTEM_SERVO = 102
|
|
uint8 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103
|
|
uint8 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104
|
|
uint8 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105
|
|
uint8 FAILURE_UNIT_SYSTEM_ESC = 106
|
|
uint8 FAILURE_UNIT_SYSTEM_TRAFFIC_AVOIDANCE = 107
|
|
|
|
uint16[4] instance_mask # Bit i targets instance (i+1); 0xFFFF = all instances
|
|
|
|
uint8[4] failure_type # [@enum FAILURE_TYPE] failure mode per entry
|
|
# Failure mode.
|
|
# Mirrors MAVLink FAILURE_TYPE and the FAILURE_TYPE_* values in vehicle_command.
|
|
uint8 FAILURE_TYPE_OK = 0
|
|
uint8 FAILURE_TYPE_OFF = 1
|
|
uint8 FAILURE_TYPE_STUCK = 2
|
|
uint8 FAILURE_TYPE_GARBAGE = 3
|
|
uint8 FAILURE_TYPE_WRONG = 4
|
|
uint8 FAILURE_TYPE_SLOW = 5
|
|
uint8 FAILURE_TYPE_DELAYED = 6
|
|
uint8 FAILURE_TYPE_INTERMITTENT = 7
|
|
uint8 FAILURE_TYPE_DRIFT = 8
|