From 4fa0123652a3f99009aea1ca1f71b1f7436131cb Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Mon, 2 Nov 2015 13:48:30 +0100 Subject: [PATCH] Navigator: Only indicate timeout if we really time out --- src/modules/navigator/navigator_main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/navigator/navigator_main.cpp b/src/modules/navigator/navigator_main.cpp index df2d6f5c07..c7d1c10d05 100644 --- a/src/modules/navigator/navigator_main.cpp +++ b/src/modules/navigator/navigator_main.cpp @@ -314,6 +314,8 @@ Navigator::task_main() fds[0].fd = _global_pos_sub; fds[0].events = POLLIN; + bool global_pos_available_once = false; + while (!_task_should_exit) { /* wait for up to 200ms for data */ @@ -321,7 +323,9 @@ Navigator::task_main() if (pret == 0) { /* timed out - periodic check for _task_should_exit, etc. */ - PX4_WARN("navigator timed out"); + if (global_pos_available_once) { + PX4_WARN("navigator timed out"); + } continue; } else if (pret < 0) { @@ -330,6 +334,8 @@ Navigator::task_main() continue; } + global_pos_available_once = true; + perf_begin(_loop_perf); if (_mavlink_fd < 0 && hrt_absolute_time() > mavlink_open_time) {