From d9c85d3e691702d66baf3c0ade3d5b2485c90a6a Mon Sep 17 00:00:00 2001 From: Jacob Dahl Date: Tue, 17 Mar 2026 21:55:33 -0800 Subject: [PATCH] refactor(commander/HealthAndArmingChecks): convert params.c to module.yaml Convert parameter definition(s) from legacy C format to YAML module configuration. --- .../HealthAndArmingChecks/CMakeLists.txt | 1 + .../esc_check_params.yaml | 62 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 src/modules/commander/HealthAndArmingChecks/esc_check_params.yaml diff --git a/src/modules/commander/HealthAndArmingChecks/CMakeLists.txt b/src/modules/commander/HealthAndArmingChecks/CMakeLists.txt index b170d1d2ca..e313921d82 100644 --- a/src/modules/commander/HealthAndArmingChecks/CMakeLists.txt +++ b/src/modules/commander/HealthAndArmingChecks/CMakeLists.txt @@ -71,6 +71,7 @@ px4_add_library(health_and_arming_checks checks/externalChecks.cpp ) +set_property(GLOBAL APPEND PROPERTY PX4_MODULE_CONFIG_FILES ${CMAKE_CURRENT_SOURCE_DIR}/esc_check_params.yaml) add_dependencies(health_and_arming_checks mode_util) px4_add_functional_gtest(SRC HealthAndArmingChecksTest.cpp diff --git a/src/modules/commander/HealthAndArmingChecks/esc_check_params.yaml b/src/modules/commander/HealthAndArmingChecks/esc_check_params.yaml new file mode 100644 index 0000000000..a1170bc592 --- /dev/null +++ b/src/modules/commander/HealthAndArmingChecks/esc_check_params.yaml @@ -0,0 +1,62 @@ +module_name: HealthAndArmingChecks +parameters: +- group: Motor Failure + definitions: + FD_ACT_EN: + description: + short: Enable Actuator Failure check + long: |- + If enabled, the HealthAndArmingChecks will verify that for motors, a minimum amount of ESC current per throttle + level is being consumed. + Otherwise this indicates an motor failure. + This check only works for ESCs that report current consumption. + type: boolean + default: 0 + MOTFAIL_C2T: + description: + short: Motor Failure Current/Throttle Scale + long: |- + Determines the slope between expected steady state current and linearized, normalized thrust command. + E.g. FD_ACT_MOT_C2T A represents the expected steady state current at 100%. + FD_ACT_LOW_OFF and FD_ACT_HIGH_OFF offset the threshold from that slope. + type: float + default: 35.0 + min: 0.0 + max: 50.0 + unit: A/% + decimal: 2 + increment: 1 + MOTFAIL_LOW_OFF: + description: + short: Undercurrent motor failure limit offset + long: threshold = FD_ACT_MOT_C2T * thrust - FD_ACT_LOW_OFF + type: float + default: 10.0 + min: 0 + max: 30 + unit: A + decimal: 2 + increment: 1 + MOTFAIL_HIGH_OFF: + description: + short: Overcurrent motor failure limit offset + long: threshold = FD_ACT_MOT_C2T * thrust + FD_ACT_HIGH_OFF + type: float + default: 10.0 + min: 0 + max: 30 + unit: A + decimal: 2 + increment: 1 + MOTFAIL_TIME: + description: + short: Motor Failure Hysteresis Time + long: Motor failure only triggers after current thresholds are exceeded for + this time. + type: float + default: 1.0 + unit: s + min: 0.01 + max: 10 + decimal: 2 + increment: 1