diff --git a/ArduPlane/altitude.pde b/ArduPlane/altitude.pde index 0ffe28e7f0..d2e0986b83 100644 --- a/ArduPlane/altitude.pde +++ b/ArduPlane/altitude.pde @@ -324,6 +324,15 @@ static void set_offset_altitude_location(const Location &loc) target_altitude.offset_cm = target_altitude.terrain_alt_cm - (height * 100); } #endif + + // if we are within 15 meters of the target altitude then reset + // the offset to not use a glide slope. This allows for more + // accurate flight of missions where the aircraft may lose or gain + // a bit of altitude near waypoint turn points due to local + // terrain changes + if (labs(target_altitude.offset_cm) < 1500) { + target_altitude.offset_cm = 0; + } } /*