diff --git a/sw/airborne/nav.c b/sw/airborne/nav.c index 8ebaab9c8b..d4fb4bfe88 100644 --- a/sw/airborne/nav.c +++ b/sw/airborne/nav.c @@ -187,7 +187,7 @@ static float qdr; #define Follow(_ac_id, _distance, _height) { \ struct ac_info_ * ac = get_ac_info(_ac_id); \ vertical_mode = VERTICAL_MODE_AUTO_ALT; \ - nav_altitude = Max(ac->alt + _height, SECURITY_ALT); \ + nav_altitude = Max(ac->alt + _height, ground_alt+SECURITY_HEIGHT); \ float alpha = M_PI/2 - ac->course; \ fly_to_xy(ac->east - _distance*cos(alpha), ac->north - _distance*sin(alpha)); \ } @@ -477,7 +477,7 @@ void nav_home(void) { /** Nominal speed */ nav_pitch = 0.; vertical_mode = VERTICAL_MODE_AUTO_ALT; - nav_altitude = ground_alt+50; + nav_altitude = ground_alt+SECURITY_HEIGHT; compute_dist2_to_home(); dist2_to_wp = dist2_to_home; } diff --git a/sw/tools/extract_makefile.ml b/sw/tools/extract_makefile.ml index c24800e2df..aeed37d90f 100644 --- a/sw/tools/extract_makefile.ml +++ b/sw/tools/extract_makefile.ml @@ -6,13 +6,13 @@ let _ = printf "# This file has been generated from %s by sw/tools/extract_makefile\n" f; printf "# Please DO NOT EDIT\n"; List.iter (fun x -> - if ExtXml.tag_is x "makefile" then - begin - try - printf "\n# makefile target '%s'\n" (Xml.attrib x "target") - with _ -> () - end; - match Xml.children x with - [Xml.PCData s] -> printf "%s\n" s - | _ -> fprintf stderr "Warning: wrong makefile section in '%s': %s\n" f (Xml.to_string_fmt x)) + if ExtXml.tag_is x "makefile" then begin + begin try + printf "\n# makefile target '%s'\n" (Xml.attrib x "target") + with _ -> () end; + match Xml.children x with + [Xml.PCData s] -> printf "%s\n" s + | _ -> fprintf stderr "Warning: wrong makefile section in '%s': %s\n" f (Xml.to_string_fmt x) + end) (Xml.children xml) + diff --git a/sw/tools/gen_flight_plan.ml b/sw/tools/gen_flight_plan.ml index 445641ddcc..23997ba561 100644 --- a/sw/tools/gen_flight_plan.ml +++ b/sw/tools/gen_flight_plan.ml @@ -713,6 +713,7 @@ let _ = Xml2h.define "NB_WAYPOINT" (string_of_int (List.length waypoints)); Xml2h.define "GROUND_ALT" (sof !ground_alt); + Xml2h.define "SECURITY_HEIGHT" (sof !security_height); Xml2h.define "SECURITY_ALT" (sof (!security_height +. !ground_alt)); Xml2h.define "MAX_DIST_FROM_HOME" (sof mdfh);