Plane: use origin-relative altitudes rather than home-relative
This commit is contained in:
parent
7e1492d2b7
commit
aa78f53498
@ -2859,7 +2859,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 &&
|
||||
@ -2867,7 +2867,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,
|
||||
|
Loading…
Reference in New Issue
Block a user