Plane: use origin-relative altitudes rather than home-relative

This commit is contained in:
Peter Barker 2023-10-18 15:00:36 +11:00 committed by Andrew Tridgell
parent a89c2cda6e
commit f7767d9068
1 changed files with 2 additions and 2 deletions

View File

@ -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,