Plane: handle very steep landings more gracefully

prevent us trying to put the flare point too high or too far back if
the mission requires a steep landing
This commit is contained in:
Andrew Tridgell 2015-02-03 16:44:16 +11:00
parent 2ae412d513
commit 28341a6c7a
1 changed files with 10 additions and 0 deletions

View File

@ -131,6 +131,11 @@ static void setup_landing_glide_slope(void)
// the height we aim for is the one to give us the right flare point
float aim_height = g.land_flare_sec * sink_rate;
// don't allow the aim height to be too far above LAND_FLARE_ALT
if (g.land_flare_alt > 0 && aim_height > g.land_flare_alt*2) {
aim_height = g.land_flare_alt*2;
}
// time before landing that we will flare
float flare_time = aim_height / SpdHgt_Controller->get_land_sinkrate();
@ -138,6 +143,11 @@ static void setup_landing_glide_slope(void)
// get closer. This takes into account the wind
float flare_distance = groundspeed * flare_time;
// don't allow the flare before half way along the final leg
if (flare_distance > total_distance/2) {
flare_distance = total_distance/2;
}
// now calculate our aim point, which is before the landing
// point and above it
location_update(loc, land_bearing_cd*0.01f, -flare_distance);