Frost is an open-source framework for the development, testing, and deployment of software applications for controlling and supervising industrial machines. The focus of the framework is on implementing a unified and extensible interface for the development of machine control software, which can be used in different industrial contexts.
Frost enables the development and testing of software applications in a virtual environment (i.e., a Digital Twin) before deploying them on the actual machine. Once the software is validated in the virtual environment, it can be deployed on the real system with minimal/no changes.
Frost is built on top of the Lingua Franca framework (LF), which ensures deterministic execution, enhancing the reliability of soft-ware prototyping and testing. Frost is part of the Glacier project.
FrostReactor is the main building block of the Frost framework: a ready-to-use reactor that can be extended to implement a component's behavior. It bundles logging, message handling, and a data-model–backed interface so that custom components only need to define their domain logic. FrostLink is the message router of the Frost network: it registers the components connected to it and forwards messages between them based on their target. Both reactors descend from FrostBase and rely on the data model library to expose their interfaces. Custom components are developed by extending FrostReactor and implementing the desired behavior.
To build and run this project, you will need the following prerequisites:
-
Lingua Franca: This project is built using the Lingua Franca framework. You can find installation instructions on the Lingua Franca website.
You can install Lingua Franca using the following command:
curl -Ls https://install.lf-lang.org | bash -s cliAfter installation, you may need to add the Lingua Franca binary to your PATH. Follow the instructions provided by the installer.
-
Python: Python 3.12 or later is required. You can download it from the Python website.
-
Python Packages: The project requires several Python packages. You can install them by running the following command in the root of the project:
pip install -r requirements.txt
-
Make: The
makebuild automation tool is used to simplify the build and test process.
The development is summarized in the following step:
- Extend the FrostReactor reactor.
- Define the state variables of the component and link them to the data model nodes.
- Define the logic implementing the component behavior.
- Instantiate the reactor in the main file and run it.
# Extend the FrostReactor reactor
reactor TrafficLight extends FrostReactor{
# State variables of the machine
state mode
# Method for implementing the machine behavior
method m(ins){=
self.logger.info("Received: %s", ins)
if ins == 0:
self.error.value = 1
else:
self.req.value = 0
return ins
=}
# Link the state variables to the data model nodes
# and set the method as callback
reaction(startup){=
self.mode = self.data_model.get_node("TrafficLight/Mode")
method_node = self.data_model.get_node("TrafficLight/")
method_node.callback = self.m
=}
# Custom logic updating the state variables
timer t(0 s, 1 s)
reaction(t) -> work{=
if self.mode.value == LIGHT_GREEN:
self.mode.value = LIGHT_RED
else:
self.mode.value = LIGHT_GREEN
=}
}Then instantiate the following reactor with:
import TrafficLight from "TrafficLight.lf"
main reactor{
tl = TrafficLight(model_path="path/to/model.yaml")
...
}- ICE Laboratory: The directory contains an implementation of the production line of the ICE Laboratory of Verona, Italy. A Scheduler controls the production by sending requests to the different machines of the plant The example is still under development and will be updated soon.
Contributions are welcome! If you have suggestions for improvements or features, please open an issue or submit a pull request.
The development environment is managed with pip. To set up the development environment, follow these steps:
-
Clone the repository:
git clone <repository-url> cd frost
-
Create a virtual environment (recommended):
python -m venv .venv source .venv/bin/activate -
Install dependencies: Execute the following command to install the required Python packages:
pip install -r requirements.txt
To ensure the stability and correctness of the codebase, it is important to run the test suite before committing any changes. The project provides a convenient Makefile target for this purpose.
To build and run all the tests, execute the following command from the root of the project:
make testThis command will:
- Find all the
.lftest files in thetest/srcdirectory. - Build each test using the Lingua Franca compiler.
- Run the compiled test binaries.
- Provide a summary of the test results, indicating which tests passed and which failed.
This process is managed by the test/run_all.sh script, which is invoked by the Makefile.
This project uses act to enable local execution of GitHub Actions workflows. This allows you to test CI/CD pipelines locally before pushing changes to the repository.