From 2c5342acd4e77f7aa74f9a3dffd4f482339f8f92 Mon Sep 17 00:00:00 2001 From: bresch Date: Thu, 4 Mar 2021 13:03:46 +0100 Subject: [PATCH] commander: increase nav_test_failed hysteresis time This is to avoid race condition with the yaw emergency estimator having the same trigger delay of 1 second. Commander will now give more time to EKF2 to reset itself before switching to altitude mode. --- src/modules/commander/Commander.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/commander/Commander.cpp b/src/modules/commander/Commander.cpp index 5499ba124b..190e082941 100644 --- a/src/modules/commander/Commander.cpp +++ b/src/modules/commander/Commander.cpp @@ -3849,7 +3849,7 @@ void Commander::estimator_check() } else if (innovation_fail) { _time_last_innov_fail = hrt_absolute_time(); - if (!_nav_test_failed && hrt_elapsed_time(&_time_last_innov_pass) > 1_s) { + if (!_nav_test_failed && hrt_elapsed_time(&_time_last_innov_pass) > 2_s) { // if the innovation test has failed continuously, declare the nav as failed _nav_test_failed = true; mavlink_log_emergency(&_mavlink_log_pub, "Navigation failure! Land and recalibrate sensors");