From af5c48b8699b8ef1ee274e0268678fb0dd7db212 Mon Sep 17 00:00:00 2001 From: RomanBapst Date: Thu, 4 Jun 2020 14:23:39 +0300 Subject: [PATCH] navigator: always make sure that we set target lat/lon for fixed wing takeoff Signed-off-by: RomanBapst --- src/modules/navigator/navigator_main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/navigator/navigator_main.cpp b/src/modules/navigator/navigator_main.cpp index 9386fd1687..3eef314180 100644 --- a/src/modules/navigator/navigator_main.cpp +++ b/src/modules/navigator/navigator_main.cpp @@ -365,9 +365,9 @@ Navigator::run() rep->current.lon = cmd.param6; } else { - // If one of them is non-finite, reset both - rep->current.lat = (double)NAN; - rep->current.lon = (double)NAN; + // If one of them is non-finite set the current global position as target + rep->current.lat = get_global_position()->lat; + rep->current.lon = get_global_position()->lon; } rep->current.alt = cmd.param7;