|
|
|
@ -131,6 +131,11 @@ static void setup_landing_glide_slope(void)
@@ -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)
@@ -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); |
|
|
|
|