reset the position lock only if current triplet latitude and longitude

are valid
This commit is contained in:
Martina Rivizzigno 2019-05-17 11:42:11 +02:00 committed by Dennis Mannhart
parent c4c3bbbfb0
commit a18f3e5d45
1 changed files with 3 additions and 1 deletions

View File

@ -178,10 +178,12 @@ bool FlightTaskAuto::_evaluateTriplets()
} else {
tmp_target(0) = _lock_position_xy(0);
tmp_target(1) = _lock_position_xy(1);
_lock_position_xy.setAll(NAN);
}
} else {
// reset locked position if current lon and lat are valid
_lock_position_xy.setAll(NAN);
// Convert from global to local frame.
map_projection_project(&_reference_position,
_sub_triplet_setpoint->get().current.lat, _sub_triplet_setpoint->get().current.lon, &tmp_target(0), &tmp_target(1));