Development of new components

In this section, the development of new components will be covered.

Important

The examples provided in this section are meant to be used as a reference for the development of new components. They are not meant to be used as templates for new applications, as they do not necessarily follow the best practices for application development. This is particularly true for the DataSources, which are implemented in a very basic way, without semaphores or mutexes to protect the shared data.

The developer is strongly encouraged to read the MARTe2 documentation and to use the API, particularly with regard to low-level primitives, as this allows porting the components to other platforms and using the full potential of the framework.

The application structure is the same discussed in the deploying section.

In this tutorial, the MARTe2 command line Manager will be used to create the project and the components. The marte2_manager is a command line tool that allows managing the development of MARTe2 applications. It can be used to deploy a new project, add a new component (including the boilerplate code) and its corresponding tests and makefiles, and modify an existing component (including the boilerplate code).

Note

If the marte2_manager cannot be installed on the system, clone the MARTe2 repository, change to the folder Resources/Manager and run export PYTHONPATH=$PYTHONPATH:src.

Check that the manager is correctly installed by running the command python -m marte2_manager.cli -h. This should print the help message of the manager.

Important

The marte2_manager requires Python 3.9 or higher.

The commands assume that python points to a Python 3.9 or higher interpreter.

If this is not the case, replace python with the appropriate command (e.g. python3.11).