Plane: use the projected position for geofencing and waypoints

This commit is contained in:
Andrew Tridgell 2013-09-17 21:05:25 +10:00
parent dcb60e190d
commit ec0c894306
2 changed files with 2 additions and 2 deletions

View File

@ -1010,7 +1010,7 @@ static void update_GPS(void)
}
// get position from AHRS
have_position = ahrs.get_position(current_loc);
have_position = ahrs.get_projected_position(current_loc);
if (g_gps->new_data && g_gps->status() >= GPS::GPS_OK_FIX_3D) {
g_gps->new_data = false;

View File

@ -213,7 +213,7 @@ static void geofence_check(bool altitude_check_only)
} else if (geofence_check_maxalt()) {
outside = true;
breach_type = FENCE_BREACH_MAXALT;
} else if (!altitude_check_only && ahrs.get_position(loc)) {
} else if (!altitude_check_only && ahrs.get_projected_position(loc)) {
Vector2l location;
location.x = loc.lat;
location.y = loc.lng;