Files
PX4-Autopilot/docs/uk/debug/failure_injection.md
Hamish Willee 88d623bedb Move PX4 Guide source into /docs (#24490)
* Add vitepress tree

* Update existing workflows so they dont trigger on changes in the docs path

* Add nojekyll, package.json, LICENCE etc

* Add crowdin docs upload/download scripts

* Add docs flaw checker workflows

* Used docs prefix for docs workflows

* Crowdin obvious fixes

* ci: docs move to self hosted runner

runs on a beefy server for faster builds

Signed-off-by: Ramon Roche <mrpollo@gmail.com>

* ci: don't run build action for docs or ci changes

Signed-off-by: Ramon Roche <mrpollo@gmail.com>

* ci: update runners

Signed-off-by: Ramon Roche <mrpollo@gmail.com>

* Add docs/en

* Add docs assets and scripts

* Fix up editlinks to point to PX4 sources

* Download just the translations that are supported

* Add translation sources for zh, uk, ko

* Update latest tranlsation and uorb graphs

* update vitepress to latest

---------

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Co-authored-by: Ramon Roche <mrpollo@gmail.com>
2025-03-13 16:08:27 +11:00

4.1 KiB
Raw Blame History

Інжекція помилки системи

System failure injection allows you to induce different types of sensor and system failures, either programmatically using the MAVSDK failure plugin, or "manually" via a PX4 console like the MAVLink shell. This enables easier testing of safety failsafe behaviour, and more generally, of how PX4 behaves when systems and sensors stop working correctly.

Failure injection is disabled by default, and can be enabled using the SYS_FAILURE_EN parameter.

:::warning Failure injection still in development. На момент написання (PX4 v1.14):

  • Це можна використовувати лише в симуляції (підтримка як для впровадження в реальному польоті запланована).
  • Потребує підтримки в симуляторі. Це підтримується в Gazebo Classic
  • Багато типів відмов не широко реалізовані. У таких випадках команда повернеться з повідомленням "unsupported".

:::

Команда системи збою

Failures can be injected using the failure system command from any PX4 console/shell, specifying both the target and type of the failure.

Синтаксис

The full syntax of the failure command is:

failure <component> <failure_type> [-i <instance_number>]

де:

  • component:
    • Датчики:
      • gyro: Gyro.
      • accel: Accelerometer.
      • mag: Magnetometer
      • baro: Barometer
      • gps: GPS
      • optical_flow: Optical flow.
      • vio: Visual inertial odometry.
      • distance_sensor: Distance sensor (rangefinder).
      • airspeed: Airspeed sensor.
    • Системи:
      • battery: Battery.
      • motor: Motor.
      • servo: Servo.
      • avoidance: Avoidance.
      • rc_signal: RC Signal.
      • mavlink_signal: MAVLink signal (data telemetry).
  • failure_type:
    • ok: Publish as normal (Disable failure injection).
    • off: Stop publishing.
    • stuck: Report same value every time (could indicate a malfunctioning sensor).
    • garbage: Publish random noise. Це схоже на читання неініціалізованої пам'яті.
    • wrong: Publish invalid values (that still look reasonable/aren't "garbage").
    • slow: Publish at a reduced rate.
    • delayed: Publish valid data with a significant delay.
    • intermittent: Publish intermittently.
  • instance number (optional): Instance number of affected sensor. 0 (за замовчуванням) вказує на всі сенсори вказаного типу.

Приклад

Щоб симулювати втрату сигналу RC без вимкнення вашого пульта керування RC:

  1. Enable the parameter SYS_FAILURE_EN.

  2. Enter the following commands on the MAVLink console or SITL pxh shell:

    # Fail RC (turn publishing off)
    failure rc_signal off
    
    # Restart RC publishing
    failure rc_signal ok
    

MAVSDK відлагоджувальний плагін

The MAVSDK failure plugin can be used to programmatically inject failures. It is used in PX4 Integration Testing to simulate failure cases (for example, see PX4-Autopilot/test/mavsdk_tests/autopilot_tester.cpp).

API плагіна - це пряме відображення команди збою, показаної вище, з деякими додатковими сигналами про помилки, пов'язані з підключенням.