Plane: fixed a potential numerical error close to waypoints

This commit is contained in:
Andrew Tridgell 2014-04-21 18:49:30 +10:00
parent e07b70de4e
commit 12012c9530
1 changed files with 1 additions and 1 deletions

View File

@ -134,7 +134,7 @@ static void calc_altitude_error()
control_mode == CRUISE) {
return;
}
if (nav_controller->reached_loiter_target()) {
if (nav_controller->reached_loiter_target() || (wp_distance <= 30) || (wp_totalDistance<=30)) {
// once we reach a loiter target then lock to the final
// altitude target
target_altitude_cm = next_WP_loc.alt;