No time right now?
The framework on which the code of the youngest Mars dispatcher from NASA is based is open source and multi-platform compatible and therefore also runs on your Raspberry PI.
Mars has a visitor: Perservance, as NASA’s robotic vehicle is called, landed safely on the red planet on Thursday evening after a 472 million kilometer journey. The drone carried out the complex landing on Mars’ surface exactly as NASA had planned. What you might not know: The underlying code is based on an open source framework called F ‘(F Prime).
Written in C ++ with testing tools in Python
F Prime is a component-based framework for the development of so-called embedded software. Originally developed by the Jet Propulsion Laboratory, the framework is behind the code of several space applications. It is tailored to small space systems such as CubeSats, SmallSats and instruments, but is also used in larger systems. Most of the framework was written in C ++, with smaller parts being based on Python. According to the Security Code Analysis Platform LGTM, the code of the framework is of outstanding quality: The part written in Python was evaluated with A ++, the larger “C ++” part with A.
The framework consists of several elements:
- An architecture that breaks down the flight software into separate components with clearly defined interfaces; a “C ++” framework that provides core functions such as message queues and threads;
- Modeling tools for automatic code generation and specification of components and connections;
- A growing collection of ready-to-use components and
- Testing tools for performing unit and integration tests that make up the Python part.
Cmake, Git and at least Python 3.5 required
The installation of the framework requires cmake, Git and Python 3.5 or newer. The readme of the associated repo on GitHub also recommends installing F Prime’s Python Dependencies – preferably in a virtual Python environment in order to avoid problems at system level. The complete installation instructions can be found in the project under INSTALL.md. Here are the most important commands:
git clone https://github.com/nasa/fprime.git
pip install --upgrade wheel setuptools pip
pip install Fw/Python Gds/
The repo contains two example deployments: a standard application that shows how the components should be put together and one for the Raspberry PI. The standard application is compatible with Linux or MacOS, so that you can try out the framework without embedded hardware. The Raspberry PI application offers start-up help in an embedded software context. At least one of them should be cloned and executed – if only to make sure that you have installed the framework correctly.