diff --git a/ArduPlane/ArduPlane.cpp b/ArduPlane/ArduPlane.cpp index 1e6979d251..acf239865b 100644 --- a/ArduPlane/ArduPlane.cpp +++ b/ArduPlane/ArduPlane.cpp @@ -559,7 +559,7 @@ void Plane::handle_auto_mode(void) // allow landing to restrict the roll limits nav_roll_cd = landing.constrain_roll(nav_roll_cd, g.level_roll_limit*100UL); - if (landing.is_complete()) { + if (landing.is_throttle_suppressed()) { // if landing is considered complete throttle is never allowed, regardless of landing type SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, 0); } else { @@ -950,7 +950,6 @@ void Plane::update_flight_stage(void) } else { set_flight_stage(AP_Vehicle::FixedWing::FLIGHT_LAND); } - } else if (quadplane.in_assisted_flight()) { set_flight_stage(AP_Vehicle::FixedWing::FLIGHT_VTOL); } else { diff --git a/ArduPlane/Attitude.cpp b/ArduPlane/Attitude.cpp index 53b3bf2771..19712a020d 100644 --- a/ArduPlane/Attitude.cpp +++ b/ArduPlane/Attitude.cpp @@ -226,7 +226,7 @@ void Plane::stabilize_yaw(float speed_scaler) // are below the GROUND_STEER_ALT steering_control.ground_steering = (channel_roll->get_control_in() == 0 && fabsf(relative_altitude) < g.ground_steer_alt); - if (landing.is_on_approach()) { + if (!landing.is_ground_steering_allowed()) { // don't use ground steering on landing approach steering_control.ground_steering = false; } diff --git a/ArduPlane/altitude.cpp b/ArduPlane/altitude.cpp index 58afed197c..0ecbfa91e1 100644 --- a/ArduPlane/altitude.cpp +++ b/ArduPlane/altitude.cpp @@ -25,6 +25,8 @@ */ void Plane::adjust_altitude_target() { + Location target_location; + if (control_mode == FLY_BY_WIRE_B || control_mode == CRUISE) { return; @@ -36,6 +38,8 @@ void Plane::adjust_altitude_target() } else if (landing.is_on_approach()) { landing.setup_landing_glide_slope(prev_WP_loc, next_WP_loc, current_loc, target_altitude.offset_cm); landing.adjust_landing_slope_for_rangefinder_bump(rangefinder_state, prev_WP_loc, next_WP_loc, current_loc, auto_state.wp_distance, target_altitude.offset_cm); + } else if (landing.get_target_altitude_location(target_location)) { + set_target_altitude_location(target_location); } else if (reached_loiter_target()) { // once we reach a loiter target then lock to the final // altitude target diff --git a/ArduPlane/servos.cpp b/ArduPlane/servos.cpp index aa918c42d3..afc175c170 100644 --- a/ArduPlane/servos.cpp +++ b/ArduPlane/servos.cpp @@ -48,6 +48,8 @@ void Plane::throttle_slew_limit(void) * 4 - We are not performing a takeoff in Auto mode or takeoff speed/accel not yet reached * OR * 5 - Home location is not set + * OR + * 6- Landing does not want to allow throttle */ bool Plane::suppress_throttle(void) { @@ -59,6 +61,10 @@ bool Plane::suppress_throttle(void) } #endif + if (landing.is_throttle_suppressed()) { + return true; + } + if (!throttle_suppressed) { // we've previously met a condition for unsupressing the throttle return false;