Plane: fixed auto ICE engine cut in QLAND final

This commit is contained in:
Andrew Tridgell 2016-09-29 05:18:38 +10:00
parent 3adf8c3e51
commit 841828541d
1 changed files with 4 additions and 0 deletions

View File

@ -759,6 +759,10 @@ void QuadPlane::control_loiter()
float height_above_ground = plane.relative_ground_altitude(plane.g.rangefinder_landing);
if (height_above_ground < land_final_alt && poscontrol.state < QPOS_LAND_FINAL) {
poscontrol.state = QPOS_LAND_FINAL;
// cut IC engine if enabled
if (land_icengine_cut != 0) {
plane.g2.ice_control.engine_control(0, 0, 0);
}
}
float descent_rate = (poscontrol.state == QPOS_LAND_FINAL)? land_speed_cms:landing_descent_rate_cms(height_above_ground);
pos_control->set_alt_target_from_climb_rate(-descent_rate, plane.G_Dt, true);