mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-09 22:49:53 +08:00
[autopilot] fix detection of generated mode and generation dep (#2927)
- server extract the correct modes with generated autopilots - compilation dependency fixed for generated autopilot
This commit is contained in:
committed by
GitHub
parent
45b020d678
commit
83e57b3733
@@ -252,6 +252,5 @@ let modes_of_aircraft = fun ac ->
|
||||
| Some m, _ -> m
|
||||
| None, FixedWing -> Server_globals.fixedwing_ap_modes
|
||||
| None, Rotorcraft -> Server_globals.rotorcraft_ap_modes
|
||||
| None, Rover -> Server_globals.rover_ap_modes
|
||||
| None, _ -> [| "UKN" |]
|
||||
|
||||
|
||||
@@ -601,7 +601,7 @@ let new_aircraft = fun get_alive_md5sum real_id ->
|
||||
done in
|
||||
|
||||
ignore (ac.ap_modes <- try
|
||||
let ac = Aircraft.parse_aircraft "" airframe_xml in
|
||||
let ac = Aircraft.parse_aircraft ~parse_af:true ~parse_ap:true "" conf in
|
||||
match ac.Aircraft.autopilots with
|
||||
| None -> None
|
||||
| Some [(_, ap)] -> Some (modes_from_autopilot ap.Autopilot.xml)
|
||||
|
||||
@@ -8,7 +8,6 @@ let port = ref 8889
|
||||
(** FIXME: Should be read from messages.xml *)
|
||||
let fixedwing_ap_modes = [|"MANUAL";"AUTO1";"AUTO2";"HOME";"NOGPS"|]
|
||||
let rotorcraft_ap_modes = [|"KILL";"SAFE";"HOME";"RATE";"ATT";"R_RCC";"A_RCC";"ATT_C";"R_ZH";"A_ZH";"HOVER";"HOV_C";"H_ZH";"NAV";"RC_D";"CF";"FWD";"MODULE";"FLIP";"GUIDED"|]
|
||||
let rover_ap_modes = [|"MANUAL";"AUTO1";"AUTO2";"HOME";"KILL"|]
|
||||
let _AUTO2 = 2
|
||||
let gaz_modes = [|"MANUAL";"THROTTLE";"CLIMB";"ALT"|]
|
||||
let lat_modes = [|"MANUAL";"ROLL_RATE";"ROLL";"COURSE"|]
|
||||
|
||||
@@ -282,7 +282,7 @@ let () =
|
||||
| Some autopilots ->
|
||||
List.iter (fun (freq, autopilot) ->
|
||||
let dep = List.map (fun sm ->
|
||||
let h_name = paparazzi_conf // ("autopilot_core_"^(Xml.attrib sm "name")^".h") in
|
||||
let h_name = aircraft_gen_dir // ("autopilot_core_"^(Xml.attrib sm "name")^".h") in
|
||||
(h_name, [autopilot.Autopilot.filename])
|
||||
) (Xml.children autopilot.Autopilot.xml) in
|
||||
generate_config_element autopilot
|
||||
|
||||
Reference in New Issue
Block a user