Installation
Ufil is a ROS 2 workspace. The repository bassamlab/ufil
contains all Ufil components and ships a Docker setup, a dev container and a Makefile for
building.
Ufil targets ROS 2 Jazzy on Ubuntu 24.04 (amd64 and arm64). There are three ways to get a working installation:
Option |
Use it when |
Requirements |
|---|---|---|
Docker Compose (recommended) |
You want to run the examples or deploy Ufil without installing ROS 2 on the host. |
Docker with Compose v2 |
You develop Ufil in VS Code. |
Docker, VS Code, Dev Containers extension |
|
You need Ufil directly on the host, e.g. on a sensor node. |
Ubuntu 24.04 with ROS 2 Jazzy |
All three use the same dependencies: the container images are built from
docker/Dockerfile of the workspace, and the native build installs the same packages.
Note
Installation from .deb packages is not available yet.
Get the Workspace
Clone the workspace from GitHub:
git clone https://github.com/bassamlab/ufil.git ufil_ws
cd ufil_ws
To get a specific release, check out one of its tags (git tag lists them), e.g.
git checkout <version>.
The workspace has the following layout:
ufil_ws/
├── docker/ # Dockerfile, pinned Python requirements
├── docker-compose.yaml # build, terminal, bag, router, visualization and example services
├── .devcontainer/ # VS Code dev container
├── lichtblick/ # optional Lichtblick web visualization stack
├── evaluation/ # Python scripts for the evaluation of recorded runs
├── Makefile # colcon shortcuts
└── src/
├── ufil-core/ # tracking library, messages, bridges, visualization
├── ufil-osn/ # outdoor sensor node
├── ufil-rsu/ # road side unit (central fusion)
├── ufil-obu/ # on-board unit
├── ufil-ssl/ # sensitive surface layer
├── ufil-tools/ # bag and map tools
└── ufil-examples/ # example deployments (CARLA, CPM Lab, pedestrian, ...)
See Repositories and Packages for the content of each component.
Option 1: Docker Compose
The runtime image contains ROS 2 Jazzy and every dependency of the workspace.
Build the runtime image (takes a while, it installs PyTorch and the ROS dependencies):
docker compose build foxglove-bridge
All services share the same image, so building it for one service is enough.
Build the workspace inside the image. The source tree is mounted into the container, so
build/,install/andlog/end up in the workspace on the host:docker compose --profile build up
The
buildservice runsmake sequential, which builds one package at a time to keep the memory consumption low.Run something, e.g. the pedestrian example with Foxglove:
COMPOSE_PROFILES=pedestrian,foxglove-bridge docker compose up
Open Foxglove and connect to
ws://localhost:8765.
Running Ufil explains the profiles, the middleware selection and how to split an example across machines.
For an interactive shell in the runtime image, use the terminal profile:
docker compose --profile terminal run --rm terminal
source install/setup.bash
Option 2: Dev Container
The dev container uses the dev stage of docker/Dockerfile: the runtime image plus a
non-root user ufil, compilers, gdb and Git. Development, CI and deployment therefore share
the same dependencies.
Create
.devcontainer/.envwith the values used by.devcontainer/docker-compose.yml:ROS_DOMAIN_ID=21 BAGS_DIR=/absolute/path/to/your/bags # mounted read-only at /bags
Open the workspace in VS Code and run Dev Containers: Reopen in Container. The image is built locally on the first start.
The post-create script runs
rosdep installfor all packages. Build with the VS Code taskcolcon:buildor withmakein the integrated terminal (see Makefile Targets).
The workspace is mounted at /home/ufil/ws; port 8765 (Foxglove bridge) is forwarded to
the host.
Option 3: Native Build
Install ROS 2 Jazzy following the official guide and source it:
source /opt/ros/jazzy/setup.bash
Install the dependencies.
make dependenciesresolves allpackage.xmldependencies withrosdep(requiressudo):sudo rosdep init # only once per machine make dependencies
The YOLO classifier of the outdoor sensor node additionally needs the Python packages in
docker/requirements.txt(Ultralytics, PyTorch). Install them with the pinned versions:make venv && . ./venv/bin/activate pip install -c docker/constraints.txt -r docker/requirements.txt
make venvcreates a virtual environment with access to the system site packages, so the ROS 2 Python packages stay visible.Build the workspace:
make
Verify the installation:
source install/setup.bash ros2 pkg list | grep ufil
Tip
Add source /opt/ros/jazzy/setup.bash and source ~/ufil_ws/install/setup.bash to your
~/.bashrc to avoid sourcing them in every new terminal.
Makefile Targets
All targets call colcon build with --symlink-install (Python and launch files can be edited
without rebuilding) in release mode unless stated otherwise.
Target |
Builds |
|---|---|
|
the whole workspace with 4 parallel workers |
|
the whole workspace one package at a time, without tests (used by the Docker |
|
the whole workspace in debug mode |
|
a component and its dependencies ( |
|
a single example and its dependencies |
|
removes |
|
installs the system dependencies with |
|
creates the Python virtual environment |
Hint
Heavy packages such as ufil_osn_tracker need a lot of memory to compile. If the compiler
gets killed, use make sequential.
Container Images
docker/Dockerfile defines all images:
Stage |
Content |
|---|---|
|
ROS 2 Jazzy (without the desktop meta-package) with all workspace dependencies, CPU-only
PyTorch and the pinned Python packages. Used by CI and |
|
|
Dependencies are pinned for reproducible builds:
Base image:
ros:jazzyis pinned by digest (ROS_IMAGEin the Dockerfile).Python packages: top-level packages go into
docker/requirements.txt; the exact versions for amd64 and arm64 are indocker/constraints.txt. After changing the requirements, rundocker/update-python-lock.sh(needs Docker buildx) and commit both files.ROS packages: add them to the
apt-get installlist in the Dockerfile. The CI jobrosdep-checkfails if apackage.xmldeclares a dependency that the runtime image lacks.
Troubleshooting
CMake cannot find ament_cmake
CMake Error at CMakeLists.txt:15 (find_package):
By not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH...
ROS 2 is not sourced in the terminal. Run source /opt/ros/jazzy/setup.bash and build again.
The compiler is killed during the build
The machine ran out of memory. Build with make sequential or reduce
--parallel-workers in the Makefile.
Nodes in different containers or on different machines do not see each other
All participants must use the same RMW_IMPLEMENTATION and ROS_DOMAIN_ID; with Zenoh they
also need to reach the same router. See Middleware.
General checks
ros2 doctor
ros2 pkg list | grep ufil