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 b7ac74a8b5..9b55f53e94 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 @@ -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 diff --git a/src/modules/commander/commander_params.yaml b/src/modules/commander/commander_params.yaml index da345f8685..3ff1251fa1 100644 --- a/src/modules/commander/commander_params.yaml +++ b/src/modules/commander/commander_params.yaml @@ -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 diff --git a/src/modules/commander/failsafe/failsafe.cpp b/src/modules/commander/failsafe/failsafe.cpp index 5e6cd2bfb4..a086a574df 100644 --- a/src/modules/commander/failsafe/failsafe.cpp +++ b/src/modules/commander/failsafe/failsafe.cpp @@ -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(_param_com_spoolup_time.get() * 1_s)) - ) { + const hrt_abstime spoolup = static_cast(_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(_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((_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()); diff --git a/src/modules/commander/failsafe/failsafe.h b/src/modules/commander/failsafe/failsafe.h index 6c489af909..dc7974a830 100644 --- a/src/modules/commander/failsafe/failsafe.h +++ b/src/modules/commander/failsafe/failsafe.h @@ -202,7 +202,6 @@ private: (ParamInt) _param_com_rc_in_mode, (ParamInt) _param_gf_action, (ParamFloat) _param_com_spoolup_time, - (ParamFloat) _param_com_lkdown_tko, (ParamInt) _param_cbrk_flightterm, (ParamInt) _param_com_actuator_failure_act, (ParamInt) _param_com_low_bat_act,