From 6b5147110b4b6e63aff2743c581f0aa11475f243 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Sat, 14 Mar 2026 10:09:28 +0100 Subject: [PATCH] refactor(commander): remove needless parameter COM_KILL_DISARM (#26736) --- .../amovlab_f410/amovlabf410_drone_v1.15.4.params | 1 - docs/en/config/safety.md | 8 ++------ src/modules/commander/Commander.cpp | 3 +-- src/modules/commander/Commander.hpp | 1 - src/modules/commander/commander_params.c | 13 ------------- src/modules/rc_update/params.c | 2 +- 6 files changed, 4 insertions(+), 24 deletions(-) diff --git a/docs/assets/airframes/multicopter/amovlab_f410/amovlabf410_drone_v1.15.4.params b/docs/assets/airframes/multicopter/amovlab_f410/amovlabf410_drone_v1.15.4.params index f17707cff1..48cec71d9b 100644 --- a/docs/assets/airframes/multicopter/amovlab_f410/amovlabf410_drone_v1.15.4.params +++ b/docs/assets/airframes/multicopter/amovlab_f410/amovlabf410_drone_v1.15.4.params @@ -308,7 +308,6 @@ 1 1 COM_HOME_EN 1 6 1 1 COM_HOME_IN_AIR 0 6 1 1 COM_IMB_PROP_ACT 0 6 -1 1 COM_KILL_DISARM 5.000000000000000000 9 1 1 COM_LKDOWN_TKO 3.000000000000000000 9 1 1 COM_LOW_BAT_ACT 0 6 1 1 COM_MOT_TEST_EN 1 6 diff --git a/docs/en/config/safety.md b/docs/en/config/safety.md index 306e93acaf..4995a88d67 100644 --- a/docs/en/config/safety.md +++ b/docs/en/config/safety.md @@ -364,11 +364,7 @@ This section lists the available emergency switches. A kill switch immediately stops all motor outputs — if flying, the vehicle will start to fall! -[By default](#COM_KILL_DISARM) the motors will restart if the switch is reverted within 5 seconds, after which the vehicle will automatically disarm, and you will need to arm it again in order to start the motors. - -| Parameter | Description | -| -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -| [COM_KILL_DISARM](../advanced_config/parameter_reference.md#COM_KILL_DISARM) | Timeout value for disarming after kill switch is engaged. Default: `5` seconds. | +The motors will restart if the switch is reverted within 5 seconds, after which the vehicle will automatically disarm, and you will need to arm it again in order to start the motors. ::: info There is also a [Kill Gesture](#kill-gesture), which cannot be reverted. @@ -410,7 +406,7 @@ A return switch can be used to immediately engage [Return mode](../flight_modes/ A kill gesture immediately stops all motor outputs — if flying, the vehicle will start to fall! -The action cannot be reverted without a reboot (this differs from a [Kill Switch](#kill-switch), where the operation can be reverted within the time period defined by [COM_KILL_DISARM](#COM_KILL_DISARM)). +The action cannot be reverted without a reboot (this differs from a [Kill Switch](#kill-switch), where the operation can be reverted within 5 seconds). | Parameter | Description | | -------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | diff --git a/src/modules/commander/Commander.cpp b/src/modules/commander/Commander.cpp index 0d30a8895c..98e3796f38 100644 --- a/src/modules/commander/Commander.cpp +++ b/src/modules/commander/Commander.cpp @@ -766,6 +766,7 @@ Commander::Commander() : updateParameters(); _failsafe.setOnNotifyUserCallback(&Commander::onFailsafeNotifyUserTrampoline, this); + _auto_disarm_killed.set_hysteresis_time_from(false, 5_s); } Commander::~Commander() @@ -1814,8 +1815,6 @@ void Commander::updateParameters() _vehicle_status.system_type = value_int32; } - _auto_disarm_killed.set_hysteresis_time_from(false, _param_com_kill_disarm.get() * 1_s); - const bool is_rotary = is_rotary_wing(_vehicle_status) || (is_vtol(_vehicle_status) && _vtol_vehicle_status.vehicle_vtol_state != vtol_vehicle_status_s::VEHICLE_VTOL_STATE_FW); const bool is_fixed = is_fixed_wing(_vehicle_status) || (is_vtol(_vehicle_status) diff --git a/src/modules/commander/Commander.hpp b/src/modules/commander/Commander.hpp index c6aeae8385..5681cec022 100644 --- a/src/modules/commander/Commander.hpp +++ b/src/modules/commander/Commander.hpp @@ -343,7 +343,6 @@ private: (ParamBool) _param_com_home_en, (ParamBool) _param_com_home_in_air, (ParamBool) _param_com_force_safety, - (ParamFloat) _param_com_kill_disarm, (ParamBool) _param_com_mot_test_en, (ParamFloat) _param_com_obc_loss_t, (ParamInt) _param_com_prearm_mode, diff --git a/src/modules/commander/commander_params.c b/src/modules/commander/commander_params.c index 8ec105c531..731d9c619d 100644 --- a/src/modules/commander/commander_params.c +++ b/src/modules/commander/commander_params.c @@ -710,19 +710,6 @@ PARAM_DEFINE_INT32(COM_FORCE_SAFETY, 0); */ PARAM_DEFINE_INT32(COM_MOT_TEST_EN, 1); -/** - * Timeout value for disarming when kill switch is engaged - * - * Use RC_MAP_KILL_SW to map a kill switch. - * - * @group Commander - * @unit s - * @min 0.0 - * @max 30.0 - * @increment 0.1 - */ -PARAM_DEFINE_FLOAT(COM_KILL_DISARM, 5.0f); - /** * Maximum allowed CPU load to still arm. * diff --git a/src/modules/rc_update/params.c b/src/modules/rc_update/params.c index 3709a3a841..36ace2d33a 100644 --- a/src/modules/rc_update/params.c +++ b/src/modules/rc_update/params.c @@ -1216,7 +1216,7 @@ PARAM_DEFINE_INT32(RC_MAP_OFFB_SW, 0); * * This channel immediately sets all outputs to their disarmed values, parachutes are NOT deployed. * Unlike termination this can be undone. Quickly flipping the switch back restores control. - * System auto-disarms after COM_KILL_DISARM seconds, preflight checks and re-arming are then required. + * System auto-disarms after 5 seconds, preflight checks and re-arming are then required. * * @min 0 * @max 18