|
|
|
@ -324,6 +324,15 @@ static void set_offset_altitude_location(const Location &loc)
@@ -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; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|