Plane: Support a different landing airspeed for fw quadplane landings

This commit is contained in:
Michael du Breuil 2018-11-16 15:27:45 -07:00 committed by Andrew Tridgell
parent 1a45755ffd
commit 05484c3987
2 changed files with 11 additions and 3 deletions

View File

@ -430,8 +430,6 @@ void Plane::do_landing_vtol_approach(const AP_Mission::Mission_Command& cmd)
}
vtol_approach_s.approach_stage = LOITER_TO_ALT;
set_flight_stage(AP_Vehicle::FixedWing::FLIGHT_LAND);
}
void Plane::loiter_set_direction_wp(const AP_Mission::Mission_Command& cmd)

View File

@ -139,7 +139,17 @@ void Plane::calc_airspeed_errors()
} else if (flight_stage == AP_Vehicle::FixedWing::FLIGHT_LAND) {
// Landing airspeed target
target_airspeed_cm = landing.get_target_airspeed_cm();
} else if ((control_mode == AUTO) &&
(quadplane.options & QuadPlane::OPTION_MISSION_LAND_FW_APPROACH) &&
((vtol_approach_s.approach_stage == Landing_ApproachStage::APPROACH_LINE) ||
(vtol_approach_s.approach_stage == Landing_ApproachStage::VTOL_LANDING))) {
float land_airspeed = SpdHgt_Controller->get_land_airspeed();
if (is_positive(land_airspeed)) {
target_airspeed_cm = SpdHgt_Controller->get_land_airspeed() * 100;
} else {
// fallover to normal airspeed
target_airspeed_cm = aparm.airspeed_cruise_cm;
}
} else {
// Normal airspeed target
target_airspeed_cm = aparm.airspeed_cruise_cm;