ArduPlane: Fix spiralling loiters when no fence return point can be found

This commit is contained in:
James O'Shannessy 2021-04-29 19:24:16 +10:00 committed by Peter Barker
parent 6d8d35f272
commit 5253b8a3ee
1 changed files with 5 additions and 3 deletions

View File

@ -92,9 +92,11 @@ void Plane::fence_check()
guided_WP_loc.lat = return_point[0];
guided_WP_loc.lng = return_point[1];
} else {
// should. not. happen.
guided_WP_loc.lat = current_loc.lat;
guided_WP_loc.lng = current_loc.lng;
// When no fence return point is found (ie. no inclusion fence uploaded, but exclusion is)
// we fail to obtain a valid fence return point. In this case, home is considered a safe
// return point.
guided_WP_loc.lat = home.lat;
guided_WP_loc.lng = home.lng;
}
}