mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Navigator: Only indicate timeout if we really time out
This commit is contained in:
parent
4c60f4d98a
commit
4fa0123652
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user