Workspaces & Bundles
Overview
HELIX Flightkit uses Workspaces and Bundles to organise software development and manage how code is shared and reused.
Workspaces are directories where you write and organise your Mission code, configure different parts of the system, and build your application for execution. Bundles are read-only snapshots of Workspaces that act as software libraries and can be required by other Workspaces.
Together, they provide a clear separation between the code you write and the code you depend on.
Workspaces
Workspaces are project directories where you develop your flight software in Flightkit. It brings together all of the Flightkit model elements you are actively working on into a single, structured environment.
Within Workspaces, you create Components, instantiate and group them in Deployments, and define the Assets within your Mission. The structure is designed to separate the different model elements and make it clear how the system is organised.
Once Workspaces have been fully populated, they will contain the following directories:
-
library– contains all created model elements except for Missions -
missions– contains each Mission's XML file, Meson build configurations, and the initialisation files for Component instances. -
output– contains all outputs from development, including machine-readable Mission Database, generated HTML and Markdown documentation from Flightkit XML files, and executable flight software binaries -
generated– contains tooling-generated files required for building and running anything in Flightkit, and is not intended to be viewed or modified by users -
.hfk– contains Bundles andgen-one-c
|
The |
This structure helps you quickly understand where to make changes and which parts of the Workspace are managed by the system.
Creating a Workspace
To create a Workspace in your current directory, use the following command:
hfk workspace create <WorkspaceName>
This creates a directory with a workspace.xml file, which defines the Workspace and lists its dependencies, such as required Bundles.
Preparing a Workspace
The hfk workspace prepare command prepares a Workspace so it is ready to be used for development. This checks that the Workspace is valid and sets up the gen-one-c and Bundle dependencies.
Adding Model Elements to a Workspace
You can add model elements to a Workspace using the hfk command line tool. Use the following command to create a model element.
hfk <ModelElementType> create <ModelElementName>
where <ModelElementType> is the type of Flightkit model element you want to create (e.g. Component Type), and <ModelElementName> is a name of your choosing. The following model elements can be created this way:
-
Component Types
-
Deployment Types
-
Missions
-
Services
-
Modules
-
Boards
-
Operating System Abstraction Layers (OSALs)
This will create a blank XML template in the Workspace's library directory.
|
To learn more about the |
Generating Workspace Documentation
You can use the following command to generate HTML and Markdown documentation for your Workspace:
hfk workspace generate-docs
Documentation is created using each model element’s XML file and is added to the output directory within your Workspace. It can be helpful to generate documentation for Workspaces and Bundles to quickly view the contents of each model element and share it with other engineers.
Bundles
Bundles are read-only snapshots of Workspaces that function as software libraries in Flightkit. They contain pre-built Flightkit model elements such as Components, Deployments, Missions, and {OSAL} support. By adding a Bundle requirement in a Workspace, you can use its functionality without modifying it. This keeps your development straightforward by clearly separating what you create from what is provided for you.
Creating and sharing Bundles is the primary method of coordinating Flightkit software development within teams.
Bundle Versioning
Each Bundle has an associated version number, along with a corresponding hfk command line tooling version. These version numbers are defined in the Bundle’s bundle.xml file.
When a Bundle is used within a Workspace, the Workspace specifies the required version of that Bundle as a dependency. This dependency information is defined in the workspace.xml file.
Provided Bundles
Flightkit is distributed with two Bundles: FlightkitFoundation and FlightkitExtras.
FlightkitFoundation Bundle
The FlightkitFoundation Bundle contains artefacts that are required to build a typical mission.
It includes:
-
Core Components and Services
-
Board support
-
Subsystem support
-
Pre-made demonstration Missions
This Bundle includes demonstration Missions for the following boards:
-
Generic Linux board
-
Raspberry Pi Zero W
-
ACS Kryten
-
EnduroSat OBC
All artefacts in this Bundle have been tested on the hardware they are intended to run on.
Installing & Uninstalling a Bundle
Bundles on the disk must be installed to make them available to use in Workspaces. Use the following command to install a Bundle:
hfk bundle install <path-to-bundle-archive>
|
The default installed Bundle directory is |
They can also be uninstalled when they are no longer needed:
hfk bundle uninstall <BundleName>
This command can be forced using the -f flag.
Adding a Bundle Requirement to a Workspace
Workspaces can require one or more Bundles to access pre-built functionality. Adding a Bundle requirement in a Workspace brings in all of the Bundle's model elements, allowing them to be used.
Use the following command to add a Bundle requirement:
hfk workspace bundle require <BundleName>
Unless the Bundle version is specified, hfk will bring in the latest installed version.
After a Bundle requirement has been added to a Workspace, you must prepare the Workspace by using the following command:
hfk workspace prepare
Related Documentation
-
Feature Guide: hfk Tooling