Plane: Use new landing interfaces

This commit is contained in:
Michael du Breuil 2017-02-14 12:13:11 -07:00 committed by Andrew Tridgell
parent c10fe2e7a4
commit 1bb806edb2
4 changed files with 12 additions and 3 deletions

View File

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

View File

@ -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;
}

View File

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

View File

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