F´:经过飞行验证的多平台开放源代码飞行软件框架
F´ Source Tree F´ Out of the Box Items
The rest of this page will cover various items provided by F´ out-of-the-box. Most of these items have more complete documentation linked above.
Framework and Service Components
F´ ships with a core framework and service code enabling the construction of F´ applications using standards. Specifically, the service (Svc) components provide most of the basic functionality to command, and communicate with an embedded system such as a spacecraft.
Autocoder
Autocoder automatically adds ports for registering commands, receiving commands and reporting an execution status. F′ defines an Extensible Markup Language (XML) schema that users can use to specify a model of a FSW application. The model describes the application at a high level in terms of the components, ports, and topologies of the F′ architecture. The F′ autocoder translates the model into the C++ classes to greatly reduce the boiler plate code required to build an embedded system.
Operating System Abstraction Layer
An operating system abstraction layer (OSAL) provides implementations of an application programming interface (API) for real-time operating systems (RTOS) and non-real-time operating systems in a generic way such that the code using the OSAL layer can easily swap to another OS without modification.
The F′ framework OSAL includes C++ classes that provide abstractions of common operating systems features. These features include threads, mutual exclusion locks, message queues, files, timers, and clocks.
The open-source framework provides implementations of the operating systems layer for Linux and Mac OS. The Linux implementation works in Windows using WSL. Some other Os are provided in extension libraries.
Ground Data System (GDS)
See: F´ GDS
The F′ user experience is intended to be an out-of-box ready to use ground data system (GDS) solution than can easily run on Linux, Mas OSX, or Windows platforms without any mission specific tailoring. The GDS provides an end-user graphical user interface (GUI) tool and an integration test application programming interface (API) to enable integration testing and quick-look telemetry monitoring.
Initially, the user defines the mission specific components with commands and telemetry, and then the dictionaries are automatically generated from this design. These dictionaries are read into the GDS to provide the user experience.
F′ Utility Build Helper and CMake System
F´ ships with a buoild system configured to build the F´ code. This build system is implemented using CMake and handles the dependencies needed to run the Autocoder and assemble it with user written code. In order to support more standard development patterns with F´, the fprime-util was built. This tool maps simple commands into the make system in order to allow developer to follow set patterns easily.
Linux Drivers
F´ ships with some basic driver implementations for Linux systems. These act as example driver components and allow users choosing the Linux OS to run standard hardware like UART, I2C, SPI, etc.
F´ depends on several items before the user should attempt to install it. These requirements are listed below, and should be on any system the user wishes to use. Should these items not be available on the user's Operating System, then a Virtual Machine should be used. One option is VirtualBox Oracle VM VirtualBox.
Requirements:
Note: it is possible to install and run F´ without a virtual environment, however; for individuals and researchers, this is the recommended approach.
This will create a new virtual environment for F´ to be installed into. The following commands will create a new virtual environment called fprime-venv
and ensure that virtual environment is activated.
Python 3.5+:
python3 -m venv ./fprime-venv
. ./fprime-venv/bin/activate
Any time the user wishes to use F´, this virtual environment should be activated. This should be done in each new shell the user uses. This is all that is required to activate F´ for use.
Note: file system for VirtualEnvironment should support symbolic links, or use the --always-copy
flag to pip.
Activate the Virtual Environment
. ./fprime-venv/bin/activate
Installation of F´ requires cloning of the F´ core repository. This uses Git. This will bring down the core framework and C++ files.
Clone F´
git clone https://github.com/nasa/fprime
F´ python support packages have certain requirements on various Python packages available on PYPI. These requirements are broken out in two files one for the Autocoder tools and one for the GDS tools package. This is to enable users to choose which tools they'd like to use.
Installing F´ Python Packages
pip install --upgrade wheel setuptools pip
cd <path to fprime checkout>
pip install ./Fw/Python
pip install ./Gds
from werkzeug.datastructures import FileStorage
from werkzeug.utils import secure_filename