refactor(commander): remove needless parameter COM_KILL_DISARM (#26736)

This commit is contained in:
Matthias Grob
2026-03-14 10:09:28 +01:00
committed by GitHub
parent 576e336849
commit 6b5147110b
6 changed files with 4 additions and 24 deletions

View File

@@ -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

View File

@@ -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 |
| -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| <a id="COM_KILL_DISARM"></a>[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 |
| -------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |

View File

@@ -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)

View File

@@ -343,7 +343,6 @@ private:
(ParamBool<px4::params::COM_HOME_EN>) _param_com_home_en,
(ParamBool<px4::params::COM_HOME_IN_AIR>) _param_com_home_in_air,
(ParamBool<px4::params::COM_FORCE_SAFETY>) _param_com_force_safety,
(ParamFloat<px4::params::COM_KILL_DISARM>) _param_com_kill_disarm,
(ParamBool<px4::params::COM_MOT_TEST_EN>) _param_com_mot_test_en,
(ParamFloat<px4::params::COM_OBC_LOSS_T>) _param_com_obc_loss_t,
(ParamInt<px4::params::COM_PREARM_MODE>) _param_com_prearm_mode,

View File

@@ -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.
*

View File

@@ -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