mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-02 13:27:32 +08:00
[autopilot] merge AP and FBW in normal operation (#2828)
There is no longer a separated FBW in normal operation for fixedwing, only a single AP task/thread. The code for main_ap is now factorized for all firmwares. Dual MCU support (separated AP and FBW) is still possible, based on the rotorcraft implementation and intermcu pprzlink messages. Relevant code is also factorized and available in all firmwares. The recovery mode (in case of hard fault) is still available for fixedwing with ChibiOS implementation. Only intermcu_uart is supported at the moment. Other options (spi/can) might be added back in the future if really used. Some other evolution are made: - in the radio_control and actuators modules, now integrated to AP and using ABI messages - the message parsing on datalink event (defined in module) that is now properly filtering the messages based on their class and allowing to have multiple callbacks for the same message - cleaning the part of code that were using the old intermcu fixedwing interface
This commit is contained in:
committed by
GitHub
parent
05de94932c
commit
e436d78c84
+12
-3
@@ -201,7 +201,14 @@ let make_event = fun f cond ->
|
||||
}
|
||||
|
||||
|
||||
type datalink = { message: string; func: string }
|
||||
type datalink = { message: string; func: string; dl_class: string option; cond: string option }
|
||||
|
||||
let make_datalink = fun f m cl cond ->
|
||||
{ message = m;
|
||||
func = f;
|
||||
dl_class = cl;
|
||||
cond = cond
|
||||
}
|
||||
|
||||
let fprint_datalink = fun ch d ->
|
||||
Printf.fprintf ch "(msg_id == DL_%s) { %s; }\n" d.message d.func
|
||||
@@ -312,8 +319,10 @@ let rec parse_xml m = function
|
||||
{ m with events = make_event f c :: m.events }
|
||||
| Xml.Element ("datalink", _, []) as xml ->
|
||||
let message = Xml.attrib xml "message"
|
||||
and func = Xml.attrib xml "fun" in
|
||||
{ m with datalinks = { message; func } :: m.datalinks }
|
||||
and func = Xml.attrib xml "fun"
|
||||
and dl_class = ExtXml.attrib_opt xml "class"
|
||||
and c = ExtXml.attrib_opt xml "cond" in
|
||||
{ m with datalinks = make_datalink func message dl_class c :: m.datalinks }
|
||||
| Xml.Element ("makefile", _, _) as xml ->
|
||||
{ m with makefiles = parse_makefile empty_makefile xml :: m.makefiles }
|
||||
| _ -> failwith "Module.parse_xml: unreachable"
|
||||
|
||||
Reference in New Issue
Block a user