Plane: don't flare due to crash detection unless crash detection enabled

this fixes the issue in this bug report:

http://discuss.ardupilot.org/t/auto-landing-bug-crash-with-3d-video-and-logs-ardupilot-3-6-0
This commit is contained in:
Andrew Tridgell 2016-08-23 12:19:03 +10:00
parent 68dfe42443
commit cbbc4d6774
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ bool Plane::verify_land()
flight_stage == AP_SpdHgtControl::FLIGHT_LAND_PREFLARE);
bool below_flare_alt = (height <= g.land_flare_alt);
bool below_flare_sec = (aparm.land_flare_sec > 0 && height <= auto_state.sink_rate * aparm.land_flare_sec);
bool probably_crashed = (fabsf(auto_state.sink_rate) < 0.2f && !is_flying());
bool probably_crashed = (g.crash_detection_enable && fabsf(auto_state.sink_rate) < 0.2f && !is_flying());
if ((on_approach_stage && below_flare_alt) ||
(on_approach_stage && below_flare_sec && (auto_state.wp_proportion > 0.5)) ||