From 2f024a9a8a30c6b4f7f1c4bd4d2deb8e30b39e79 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 17 Mar 2021 16:36:17 +0100 Subject: [PATCH] commander: pass in correct time since boot This fixes the case where the preflight check fail right after the start and report "sensors unstable". --- src/modules/commander/Commander.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/commander/Commander.cpp b/src/modules/commander/Commander.cpp index 1e8a5c287b..5499ba124b 100644 --- a/src/modules/commander/Commander.cpp +++ b/src/modules/commander/Commander.cpp @@ -2479,7 +2479,8 @@ Commander::run() // Evaluate current prearm status if (!_armed.armed && !_status_flags.condition_calibration_enabled) { - bool preflight_check_res = PreFlightCheck::preflightCheck(nullptr, _status, _status_flags, false, true, 30_s); + bool preflight_check_res = PreFlightCheck::preflightCheck(nullptr, _status, _status_flags, false, true, + hrt_elapsed_time(&_boot_timestamp)); // skip arm authorization check until actual arming attempt PreFlightCheck::arm_requirements_t arm_req = _arm_requirements;