diff --git a/conf/flight_plans/AGGIEAIR/BasicTuning_Launcher.xml b/conf/flight_plans/AGGIEAIR/BasicTuning_Launcher.xml index 5e18ceafb4..1ceffb9254 100644 --- a/conf/flight_plans/AGGIEAIR/BasicTuning_Launcher.xml +++ b/conf/flight_plans/AGGIEAIR/BasicTuning_Launcher.xml @@ -1,6 +1,6 @@ - +
#include "subsystems/datalink/datalink.h"
diff --git a/conf/flight_plans/flight_plan.dtd b/conf/flight_plans/flight_plan.dtd index d73ac94cf8..f5bd1a97d6 100644 --- a/conf/flight_plans/flight_plan.dtd +++ b/conf/flight_plans/flight_plan.dtd @@ -68,7 +68,7 @@ alt CDATA #REQUIRED qfu CDATA #IMPLIED home_mode_height CDATA #IMPLIED geofence_max_alt CDATA #IMPLIED -geofence_max_agl CDATA #IMPLIED +geofence_max_height CDATA #IMPLIED geofence_sector CDATA #IMPLIED> GEOFENCE_MAX_ALTITUDE); #endif /* GEOFENCE_MAX_ALTITUDE */ -#ifdef GEOFENCE_MAX_AGL - above_max_alt = above_max_alt || (GetPosAlt() > ( GetAltRef() + GEOFENCE_MAX_AGL)); -#endif /* GEOFENCE_MAX_AGL */ +#ifdef GEOFENCE_MAX_HEIGHT + above_max_alt = above_max_alt || (GetPosAlt() > ( GetAltRef() + GEOFENCE_MAX_HEIGHT)); +#endif /* GEOFENCE_MAX_HEIGHT */ return above_max_alt; } #else // we dont have max altitude specified, so the condition is never true diff --git a/sw/tools/generators/gen_flight_plan.ml b/sw/tools/generators/gen_flight_plan.ml index 1ac644a72d..2a163cd9bd 100644 --- a/sw/tools/generators/gen_flight_plan.ml +++ b/sw/tools/generators/gen_flight_plan.ml @@ -1021,21 +1021,21 @@ let () = begin try - let geofence_max_agl = get_float "geofence_max_agl" in - if geofence_max_agl < !security_height then + let geofence_max_height = get_float "geofence_max_height" in + if geofence_max_height < !security_height then begin - fprintf stderr "\nError: Geofence max AGL below security height (%.0f < %.0f)\n" geofence_max_agl !security_height; + fprintf stderr "\nError: Geofence max height below security height (%.0f < %.0f)\n" geofence_max_height !security_height; exit 1; end - else if geofence_max_agl < home_mode_height then + else if geofence_max_height < home_mode_height then begin - fprintf stderr "\nError: Geofence max AGL below home mode height (%.0f < %.0f)\n" geofence_max_agl home_mode_height; + fprintf stderr "\nError: Geofence max height below home mode height (%.0f < %.0f)\n" geofence_max_height home_mode_height; exit 1; end - else if (geofence_max_agl +. !ground_alt) < (float_of_string alt) then - fprintf stderr "\nWarning: Geofence max AGL below default waypoint AGL (%.0f < %.0f)\n" (geofence_max_agl +. !ground_alt) (float_of_string alt); - Xml2h.define "GEOFENCE_MAX_AGL" (sof geofence_max_agl); - fprintf stderr "\nWarning: Geofence max AGL set to %.0f\n" geofence_max_agl; + else if (geofence_max_height +. !ground_alt) < (float_of_string alt) then + fprintf stderr "\nWarning: Geofence max AGL below default waypoint AGL (%.0f < %.0f)\n" (geofence_max_height +. !ground_alt) (float_of_string alt); + Xml2h.define "GEOFENCE_MAX_HEIGHT" (sof geofence_max_height); + fprintf stderr "\nWarning: Geofence max AGL set to %.0f\n" geofence_max_height; with _ -> () end;