From 29730e30fa45e703b296c188405b7173b1a55e49 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Fri, 7 May 2021 10:13:20 +0200 Subject: [PATCH] ekf2: don't timeout in HITL mode Otherwise ekf2 might not start if HITL isn't started within 30 seconds. --- src/modules/ekf2/EKF2.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/ekf2/EKF2.cpp b/src/modules/ekf2/EKF2.cpp index b0a55289becf..46f655673fdf 100644 --- a/src/modules/ekf2/EKF2.cpp +++ b/src/modules/ekf2/EKF2.cpp @@ -1742,7 +1742,8 @@ int EKF2::task_spawn(int argc, char *argv[]) while ((multi_instances_allocated < multi_instances) && (vehicle_status_sub.get().arming_state != vehicle_status_s::ARMING_STATE_ARMED) - && (hrt_elapsed_time(&time_started) < 30_s)) { + && ((hrt_elapsed_time(&time_started) < 30_s) + || (vehicle_status_sub.get().hil_state == vehicle_status_s::HIL_STATE_ON))) { vehicle_status_sub.update();