mirror of https://github.com/ArduPilot/ardupilot
Plane: use origin-relative altitudes rather than home-relative
This commit is contained in:
parent
1919362383
commit
4002c2a0af
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue