Skip to content

Commit ea4dc6a

Browse files
committed
refactor(commander): remove unused parameter COM_LKDOWN_TKO
1 parent 197a1a6 commit ea4dc6a

File tree

4 files changed

+4
-21
lines changed

4 files changed

+4
-21
lines changed

docs/assets/airframes/multicopter/amovlab_f410/amovlabf410_drone_v1.15.4.params

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@
307307
1 1 COM_HOME_EN 1 6
308308
1 1 COM_HOME_IN_AIR 0 6
309309
1 1 COM_IMB_PROP_ACT 0 6
310-
1 1 COM_LKDOWN_TKO 3.000000000000000000 9
311310
1 1 COM_LOW_BAT_ACT 0 6
312311
1 1 COM_OBC_LOSS_T 5.000000000000000000 9
313312
1 1 COM_OBL_RC_ACT 0 6

src/modules/commander/commander_params.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -575,20 +575,6 @@ parameters:
575575
default: 1
576576
min: 0
577577
max: 4
578-
COM_LKDOWN_TKO:
579-
description:
580-
short: Timeout for detecting a failure after takeoff
581-
long: |-
582-
A non-zero, positive value specifies the timeframe in seconds within failure detector is allowed to disarm the vehicle
583-
if attitude exceeds the limits defined in FD_FAIL_P and FD_FAIL_R.
584-
The check is not executed for flight modes that do support acrobatic maneuvers, e.g: Acro (MC/FW) and Manual (FW).
585-
A zero or negative value means that the check is disabled.
586-
type: float
587-
default: 3.0
588-
unit: s
589-
min: -1.0
590-
max: 5.0
591-
decimal: 3
592578
COM_ARM_SDCARD:
593579
description:
594580
short: Enable FMU SD card detection check

src/modules/commander/failsafe/failsafe.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,9 @@ void Failsafe::checkStateAndMode(const hrt_abstime &time_us, const State &state,
607607

608608

609609
// Handle fails during spoolup just after arming
610-
if ((_armed_time != 0)
611-
&& (time_us < _armed_time + static_cast<hrt_abstime>(_param_com_spoolup_time.get() * 1_s))
610+
const hrt_abstime spoolup = static_cast<hrt_abstime>(_param_com_spoolup_time.get() * 1_s);
611+
612+
if ((_armed_time != 0) && (time_us < _armed_time + spoolup)
612613
) {
613614
_last_state_fd_esc_arming = checkFailsafe(_caller_id_fd_esc_arming, _last_state_fd_esc_arming,
614615
status_flags.fd_esc_arming_failure,
@@ -619,9 +620,7 @@ void Failsafe::checkStateAndMode(const hrt_abstime &time_us, const State &state,
619620
}
620621

621622
// Handle fails during the early takeoff phase
622-
if ((_armed_time != 0)
623-
&& (time_us < _armed_time
624-
+ static_cast<hrt_abstime>((_param_com_lkdown_tko.get() + _param_com_spoolup_time.get()) * 1_s))
623+
if ((_armed_time != 0) && (time_us < _armed_time + spoolup + 3_s)
625624
) {
626625
CHECK_FAILSAFE(status_flags, fd_critical_failure, ActionOptions(Action::Disarm).cannotBeDeferred());
627626

src/modules/commander/failsafe/failsafe.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ class Failsafe : public FailsafeBase
201201
(ParamInt<px4::params::GF_ACTION>) _param_gf_action,
202202
(ParamFloat<px4::params::COM_SPOOLUP_TIME>) _param_com_spoolup_time,
203203
(ParamInt<px4::params::COM_IMB_PROP_ACT>) _param_com_imb_prop_act,
204-
(ParamFloat<px4::params::COM_LKDOWN_TKO>) _param_com_lkdown_tko,
205204
(ParamInt<px4::params::CBRK_FLIGHTTERM>) _param_cbrk_flightterm,
206205
(ParamInt<px4::params::COM_ACT_FAIL_ACT>) _param_com_actuator_failure_act,
207206
(ParamInt<px4::params::COM_LOW_BAT_ACT>) _param_com_low_bat_act,

0 commit comments

Comments
 (0)