From 03e4843764e1b68d2694d3f2e5e09f44df12c931 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 18 Oct 2023 15:00:36 +1100 Subject: [PATCH] Plane: use origin-relative altitudes rather than home-relative --- ArduPlane/quadplane.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ArduPlane/quadplane.cpp b/ArduPlane/quadplane.cpp index b52688af91..ef6bc42548 100644 --- a/ArduPlane/quadplane.cpp +++ b/ArduPlane/quadplane.cpp @@ -2821,7 +2821,7 @@ void QuadPlane::vtol_position_controller(void) if (plane.control_mode == &plane.mode_guided || vtol_loiter_auto) { plane.ahrs.get_location(plane.current_loc); int32_t target_altitude_cm; - if (!plane.next_WP_loc.get_alt_cm(Location::AltFrame::ABOVE_HOME,target_altitude_cm)) { + if (!plane.next_WP_loc.get_alt_cm(Location::AltFrame::ABOVE_ORIGIN,target_altitude_cm)) { break; } if (poscontrol.slow_descent && @@ -2829,7 +2829,7 @@ void QuadPlane::vtol_position_controller(void) // gradually descend as we approach target plane.auto_state.wp_proportion = plane.current_loc.line_path_proportion(plane.prev_WP_loc, plane.next_WP_loc); int32_t prev_alt; - if (plane.prev_WP_loc.get_alt_cm(Location::AltFrame::ABOVE_HOME,prev_alt)) { + if (plane.prev_WP_loc.get_alt_cm(Location::AltFrame::ABOVE_ORIGIN,prev_alt)) { target_altitude_cm = linear_interpolate(prev_alt, target_altitude_cm, plane.auto_state.wp_proportion,