navigator: always make sure that we set target lat/lon for fixed wing

takeoff

Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
RomanBapst 2020-06-04 14:23:39 +03:00 committed by Daniel Agar
parent 5286ed3a11
commit af5c48b869
1 changed files with 3 additions and 3 deletions

View File

@ -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;