WP6-12: Difference between revisions

From COMP4DRONES
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 49: Line 49:


==Experimentation==
==Experimentation==
It was successfully used on Paparazzi UAV where our offset assignment heuristic, called GCD+, was used to avoid critical instants within custom modules added to the core of Paparazzi UAV.
== References ==
[1] Kamni, S., Ouhammou, Y., Grolleau, E., Bertout, A., & Hattenberger, G. (2022, November). A Reverse Design Framework for Modifiable-off-the-Shelf Embedded Systems: Application to Open-Source Autopilots. In Model and Data Engineering: 11th International Conference, MEDI 2022, Cairo, Egypt, November 21–24, 2022, Proceedings (pp. 133-146). Cham: Springer Nature Switzerland.
[2] Ladeira, M., Grolleau, E., Bonneval, F., Hattenberger, G., Ouhammou, Y., & Hérouard, Y. (2022, July). Scheduling offset-free systems under fifo priority protocol. In 34th Euromicro Conference on Real-Time Systems (ECRTS 2022) (Vol. 231).
[3] Hattenberger, G., Bonneval, F., Ladeira, M., Grolleau, E., & Ouhammou, Y. (2022, September). Micro-drone autopilot architecture for efficient static scheduling. In 13th International Micro Air Vehicle Conference (pp. 175-182).

Latest revision as of 14:16, 10 March 2023

Introduction

ID WP6-12
Contributor ENSMA
Levels Tool
Require Capella with AADL-like point of view plugin
Provide Retro-engineering of Paparazzi C/C++ code into a Capella point of view, offset adjustment to avoid interferences in telemetry messages or in the kernel
Input C/C++ code and Makefile of Paparazzi UAV
Output Model for Capella AADL-like point of view, offsets computed by GCD+ offset choosing method
C4D tooling System-Level modelling and analysis
TRL 3
Contact grolleau at ensma.fr

Retro engineering from autopilot source code to model

Our toolchain allows the retro-engineering of an autopilot programmed in C/C++, to obtain a AADL-like model, an extension of AADL semantics following COMP4DRONES implementation. The AADL-like model is expressed in a Capella Point of View, allowing the end-user to obtain a graphical representation of threads, functions seen as a dataflow graph, software buses and shared global variable access. The flow is represented in the following figure.

Autopilot retro-engineering workflow

Our framework is based on ANTLR and it is composed of a parsing engine, which is the program that is responsible for the traversal and the transformation of the parse tree. The processing consists of three layers. From top to bottom, the program that performs the tree traversal and its text-to-text transformation layer. This program is built on top of the two other layers, which are provided by ANTLR, namely the built parse tree as well as the generated bricks (lexer, parser, tokens, and the listeners).

Building the parse tree consists in parsing the GIMPLE code (e.g., Paparazzi GIMPLE files) that is conforming to the GIMPLE grammar and requires the three given components of the first layer, namely the Parser, the Lexer, and the Tokens. Once the parse tree is built, it is then transformed into XML code. This process requires the generated listeners of the first layer.

This toolchain has been tested on instances of Paparazzi UAV autopilots, and still requires some rare (compared to the hundreds of source code files) manual addition.

AADL-like point of view in Capella

We developed this point of view in order to visualize tasks and their interactions with an AADL graphical syntax. Note that there are additional semantics related to COMP4DRONES D3.3 definitions, in order to be able to represent the core elements of an autopilot. Its tool palette is represented on the right hand side.

Tool palette of the AADL-like Capella point of view


The following figure shows an excerpt of an AADL-like representation of an autopilot.

Excerpt of an AADL-like representation of an autopilot

The figure represents two parts of the viewpoint: on the left-hand side, we can see all the threads of a ChibiOS based Paparazzi autopilot: the ones marked (1) are four threads in charge of UART, (2) is a shell thread, (3) is a log thread, and (4) is the main autopilot thread. On the right-hand side, (5) is an excerpt of the functions present in the main autopilot thread. These are functions called to check if the UAV lost communication with the ground station or is too high compared to the allowed altitude, and in both cases, will change the actual mode of the autopilot. This representation is giving a global view of Paparazzi implementation on the Ulysse rotorcraft platform, which is requiring the compilation of 161 C and C++ files. At the very bottom of the left-hand side, we can see green bent up and down arrows for every access (read or write) to a software bus (global variables or middleware). Several properties are accessible from the environment for each represented element, but in this mode we directly displayed the LOC (Lines of Code) field to quickly indicate to the developer which functions may be computationally intensive, and require some WCET computation.

Experimentation

It was successfully used on Paparazzi UAV where our offset assignment heuristic, called GCD+, was used to avoid critical instants within custom modules added to the core of Paparazzi UAV.

References

[1] Kamni, S., Ouhammou, Y., Grolleau, E., Bertout, A., & Hattenberger, G. (2022, November). A Reverse Design Framework for Modifiable-off-the-Shelf Embedded Systems: Application to Open-Source Autopilots. In Model and Data Engineering: 11th International Conference, MEDI 2022, Cairo, Egypt, November 21–24, 2022, Proceedings (pp. 133-146). Cham: Springer Nature Switzerland.

[2] Ladeira, M., Grolleau, E., Bonneval, F., Hattenberger, G., Ouhammou, Y., & Hérouard, Y. (2022, July). Scheduling offset-free systems under fifo priority protocol. In 34th Euromicro Conference on Real-Time Systems (ECRTS 2022) (Vol. 231).

[3] Hattenberger, G., Bonneval, F., Ladeira, M., Grolleau, E., & Ouhammou, Y. (2022, September). Micro-drone autopilot architecture for efficient static scheduling. In 13th International Micro Air Vehicle Conference (pp. 175-182).