mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 00:30:50 +08:00
refactor(commander): Remove COM_LKDOWN_TKO (#27262)
hardcoding its default 3 second time window.
This commit is contained in:
1 parent
b8194973ff
commit
5638ac53c7
4 files changed
+5
-26
No files matched your search
@@ -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());
|
||||
|
||||
|
||||
Reference in new issue
Block a user