refactor(commander): Remove COM_LKDOWN_TKO (#27262)

hardcoding its default 3 second time window.
This commit is contained in:
Matthias Grob
2026-05-01 00:37:55 +02:00
committed by GitHub
parent b8194973ff
commit 5638ac53c7
4 changed files with 5 additions and 26 deletions
@@ -305,7 +305,6 @@
1 1 COM_HLDL_LOSS_T 120 6
1 1 COM_HOME_EN 1 6
1 1 COM_HOME_IN_AIR 0 6
1 1 COM_LKDOWN_TKO 3.000000000000000000 9
1 1 COM_LOW_BAT_ACT 0 6
1 1 COM_OBL_RC_ACT 0 6
1 1 COM_OBS_AVOID 0 6
@@ -550,20 +550,6 @@ parameters:
default: 1
min: 0
max: 4
COM_LKDOWN_TKO:
description:
short: Timeout for detecting a failure after takeoff
long: |-
A non-zero, positive value specifies the timeframe in seconds within failure detector is allowed to disarm the vehicle
if attitude exceeds the limits defined in FD_FAIL_P and FD_FAIL_R.
The check is not executed for flight modes that do support acrobatic maneuvers, e.g: Acro (MC/FW) and Manual (FW).
A zero or negative value means that the check is disabled.
type: float
default: 3.0
unit: s
min: -1.0
max: 5.0
decimal: 3
COM_ARM_HFLT_CHK:
description:
short: Enable FMU SD card hardfault / watchdog detection check
+5 -10
View File
@@ -570,9 +570,9 @@ void Failsafe::checkStateAndMode(const hrt_abstime &time_us, const State &state,
CHECK_FAILSAFE(status_flags, battery_low_remaining_time,
ActionOptions(fromRemainingFlightTimeLowActParam(_param_com_fltt_low_act.get())));
if ((_armed_time != 0)
&& (time_us < _armed_time + static_cast<hrt_abstime>(_param_com_spoolup_time.get() * 1_s))
) {
const hrt_abstime spoolup = static_cast<hrt_abstime>(_param_com_spoolup_time.get() * 1_s);
if ((_armed_time != 0) && (time_us < _armed_time + spoolup)) {
CHECK_FAILSAFE(status_flags, battery_unhealthy, ActionOptions(Action::Disarm).cannotBeDeferred());
} else {
@@ -617,9 +617,7 @@ void Failsafe::checkStateAndMode(const hrt_abstime &time_us, const State &state,
// Handle fails during spoolup just after arming
if ((_armed_time != 0)
&& (time_us < _armed_time + static_cast<hrt_abstime>(_param_com_spoolup_time.get() * 1_s))
) {
if ((_armed_time != 0) && (time_us < _armed_time + spoolup)) {
_last_state_fd_esc_arming = checkFailsafe(_caller_id_fd_esc_arming, _last_state_fd_esc_arming,
status_flags.fd_esc_arming_failure,
ActionOptions(Action::Disarm).cannotBeDeferred());
@@ -629,10 +627,7 @@ void Failsafe::checkStateAndMode(const hrt_abstime &time_us, const State &state,
}
// Handle fails during the early takeoff phase
if ((_armed_time != 0)
&& (time_us < _armed_time
+ static_cast<hrt_abstime>((_param_com_lkdown_tko.get() + _param_com_spoolup_time.get()) * 1_s))
) {
if ((_armed_time != 0) && (time_us < _armed_time + spoolup + 3_s)) {
CHECK_FAILSAFE(status_flags, fd_critical_failure, ActionOptions(Action::Disarm).cannotBeDeferred());
CHECK_FAILSAFE(status_flags, fd_alt_loss, ActionOptions(Action::Disarm).cannotBeDeferred());
@@ -202,7 +202,6 @@ private:
(ParamInt<px4::params::COM_RC_IN_MODE>) _param_com_rc_in_mode,
(ParamInt<px4::params::GF_ACTION>) _param_gf_action,
(ParamFloat<px4::params::COM_SPOOLUP_TIME>) _param_com_spoolup_time,
(ParamFloat<px4::params::COM_LKDOWN_TKO>) _param_com_lkdown_tko,
(ParamInt<px4::params::CBRK_FLIGHTTERM>) _param_cbrk_flightterm,
(ParamInt<px4::params::COM_ACT_FAIL_ACT>) _param_com_actuator_failure_act,
(ParamInt<px4::params::COM_LOW_BAT_ACT>) _param_com_low_bat_act,