This tutorial will walk new users through creating a new F´ project. First, ensure you meet the F´ System Requirements.
An F´ project ties to a specific version of tools to work with F´. In order to create this project and install the correct version of tools, you should perform a bootstrap of F´.
The F´ Bootstrap tool is responsible for creating a new F´ project and installing the Python dependencies within the project's virtual environment. Install the fprime-bootstrap tool with:
pip install fprime-bootstrap
The entrypoint to developing with F´ is creating a new project. This will clone the F´ repository and install the full tool suite of the specified version for working with the selected version of F´. To create a new project, run:
fprime-bootstrap project
This command will ask for a project name. We will use the default: MyProject
[1/1] Project name (MyProject): MyProject
Bootstrapping your F´ project created a folder called MyProject
(or any name you chose) containing the standard F´ project structure as well as the virtual environment containing the tools to work with F´.
We should navigate to the project's directory and look around:
cd MyProject
ls
This will show the following files:
fprime/
: F´ repository, this is a git submodule that points to https://github.com/nasa/fprime. Contains core F´ components, the API for the build system, among otherssettings.ini
: allows users to set various settings to control the buildCMakeList.txt
andproject.cmake
: CMake files defining the build systemComponents/
: directory to place user components infprime-venv/
: this directory is the virtual environment containing the Python tools to work with F´
Activate the virtual environment to use the F´ tool suite.
# in MyProject/
. fprime-venv/bin/activate
Always remember to activate the virtual environment whenever you work with this F´ project.
The next step is to set up and build the newly created project. This will serve as a build environment for any newly created components, and will build the F´ framework supplied components.
cd MyProject
fprime-util generate
fprime-util build
fprime-util generate
sets up the build environment for a project/deployment. It only needs to be done once.
fprime-util build
can be sped up by building in parrallel on multiple cores, using the-j <N>
option. For example,fprime-util build -j16
A new project has been created with the name MyProject
and has been placed in a new folder called MyProject
in
the current directory. It includes the initial build system setup, and F´ version. It is still empty in that the user
will still need to create components and deployments.
For the remainder of this Hello World tutorial we should use the tools installed for our project and issue commands within this new project's folder:
# In: MyProject
. fprime-venv/bin/activate
Use this command if your virtual environment is not already running.