Creating a New Satellite#
Constellation provides satellite templates for Python and for C++ with the Meson and CMake build systems, which can be used as a starting point.
See also
This tutorial will create an external satellite. For more details on the difference between external and framework satellites, consult the introduction.
Getting Started#
On GitHub, new repositories can be created from the template repositories using the green Use this template
button.
For projects which will not be hosted on GitHub, the template code can be downloaded manually using the green Code
button.
The template repository can be found on GitHub.
After cloning the new repository, the first which should be done is adjusting the files to match the new satellite type. This can be easily done with the included rename script:
./rename-template.py NewType
The rename script will adjust and rename all relevant files and finally deletes itself.
See also
Before committing the changes, it is recommended to install the provided pre-commit hooks as described in the introduction.
Installing Constellation#
See also
The installation instructions in the operator guide can be
consulted to install build dependencies such as Meson or Pythonβs venv
module.
External satellites can use a wrap file for Constellation to automatically build Constellation if required. The Meson template satellite already contains a wrap file pointing to the current version.
Attention
The wrap file does not automatically update when a new version is released. It is possible to updated it manually, for example by downloading the current file from the template repository again.
Alternatively, Constellation can also be installed system-wide as explained in the instructions for CMake.
External satellites require an installation from source of Constellation. By default, the meson install
command installs to
/usr/local
. This can be changed via:
meson configure build -Dprefix=CNSTLN_PREFIX # set installation directory here, e.g. `$(pwd)/usr`
meson install -C build
Note
Constellation exports its dependency using pkg-config
, which can be easily used in many build systems, including CMake.
In order to find Constellation via pkg-config
in a non-standard location when building external satellites, the prefix path
needs to be exported:
export CNSTLN_PREFIX=$(pwd)/usr
export PKG_CONFIG_PATH="$CNSTLN_PREFIX/lib64/pkgconfig:$CNSTLN_PREFIX/usr/share/pkgconfig"
Note that the platform specific part (lib64
) might be different depending on your platform, e.g. it is
lib/x86_64-linux-gnu
for amd64
Debian/Ubuntu. It can be found be checking the content of the prefix path.
Constellation needs be installed in a virtual environment via pip, which will happen automatically using editable installs.
A virtual environment can be created via:
python3 -m venv venv
source venv/bin/activate
Building the Satellite#
The satellite can be built using:
meson setup build
meson compile -C build
The satellite can be built using:
cmake -B build -G Ninja
ninja -C build
Or alternatively using Make:
cmake -B build
make -C build
The satellite can be installed in the virtual environment via:
pip install -e .
After building one can check that the satellite executable is working correctly:
./build/SatelliteNewType
SatelliteNewType
Note
NewType
has to be replaced with the satellite type used when renaming.
Implementing Functionality#
There are separate implementation guides of the base functionality of a satellite for C++ and Python. Separate guide exist for adding functionality such as logging, metrics, data transmission and custom commands.
Once the functionality has been implemented and tested, the README should be updated and included in the satellite listing. If applicable, the satellite can also be added to the main repository.