Installation
This sections provides comprehensive instructions for installing and configuring the DJI Tello leader follower scheme control system, it covers dependency installation, ROS 2 Iron setup, Hailo AI module integration and environment configuration. The guide supports Raspberry Pi OS on Raspberry Pi 5 as the primary platform.
System Requirements
Hardware Requirements
- Raspberry Pi 5 with 8GB RAM
- Storage: 32 GB microSD card (Class 10)
- DJI Tello Drone
- Hailo-8 AI module
Software Requirements * Operating System: Ubuntu 24.04 (64-bit, ARM) * Additional: Git, pip, Python virtual environment
Environment Setup:
Hailo Drivers Installation

The Hailo-8 is specialized AI processor designed for high-performance, low-power edge computing applications. With up to 26 TOPS (Tera Operatios Per Second) while consuming only 2.5W of power, it provides exceptional efficiency for real-time AI inference tasks on embedded systems like the Raspberry Pi 5.
update the system
Installing Required Dependencies
sudo apt install -y build-essential cmake git unzip wget curl pkg-config ca-certificates gnupg software-properties-common
sudo apt-get install build-essential dkms linux-headers-$(uname -r)
Cloning the Driver Repository
Download the official Hailo driver repository from GitHub to your local machine.Selecting the Compatible Version
Navigates into the repository and switches to a specific driver version (v4.20.0) to ensure compatibility with the SDK and hardware.Building and Install the Driver
Compiles the driver from source code and installs it into the system. This step creates the necessary kernel modules for communicating with the Hailo device.Loading the Kernrl Module
Manually loads the driver module into the kernel, allowing the system to recognize the Hailo device without requiring a rebootReturning to the Root Directory Go to hailort-drivers file:
Return to the root directory of the repository to continue the setup process.Installing Firmware and Udev Rules
sudo mkdir -p /lib/firmware/hailo
./download_firmware.sh
sudo mv hailo8_fw.4.20.0.bin /lib/firmware/hailo/hailo8_fw.bin
sudo cp ./linux/pcie/51-hailo-udev.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm trigger
Rebooting the System
Restarts the system to ensure all changes (driver, firmware, and rules) are properly appliedVerify the Installation
Check that the driver was successfully loaded by inspecting kernel messages. If everything is working correctly, you should see entries related to the Hailo device.HailoRT Installation
Cloning the HailoRT Repository
Clones the official HailoRT repository from GitHub, enters the project directory, and checks out a specific version (v4.20.0) to ensure compatibility with the installed drivers.Building and Installing HailoRT
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DHAILO_BUILD_EXAMPLES=1 && sudo cmake --build build --config release --target install
-
-DCMAKE_BUILD_TYPE=Releaseenables optimized compilation -
-DHAILO_BUILD_EXAMPLES=1includes example applications -
The build in then installed system-wide
Verifying Installation
Checks that HailoRT was installed correctly by displaying the installed version.Scanning for Devices
Searches for connected Hailo devices and confirms that the system can detect the hardware.Identifying the Device Firmware
Displays detailed information about the connected device, including firmware version and hardware details.Installing and configuring Docker
Installing Docker
Docker Installation
Install Docker by following the official documentation: Docker Docs
Creating the Docker Group
Creates a docker group on the system. This group allows users to run Docker commands without needingsudo.
Adding User to Docker Group
Adds your current user to the docker group, granting permission to run Docker commands without elevated privileges.Applying Group Changes
Restarts the systems so the group changes take effect.Testing Docker Installation
Runs a test container to verify that Docker is working correctly. It also enables the Docker service so it starts automatically at boot.Enabling Container Runtime
Enablescontainerd, the container runtime used by Docker, ensuring it also starts on boot.
Disabling Docker Service (Optional)
Disables the Docker service from starting automatically at boot. Use this only if you prefer to start Docker manually when needBuilding the container
Cloning the project Repository
Downloads the project repository containing the Docker setup and application code.Navigating to the Project Directory
Moves into the project folder where the Docker configuration files are located.Allowing Docker to Access the Display (GUI Support)
Grants Docker containers permission to access the host's X server. This is required if the container runs application with a graphical interface.!!! warning You need to run this command every time the container is used.
Building the Docker Container
Builds the Docker image based on thedocker-compose.yml configuration. This step installs all dependencies and prepares the environment.
Running the container
Starts the specified container in detached mode (-d). This launches the environment in the background so it can run independently of the terminal.
"Changing the session type"
Checking the Display Server Type
Displays the current session type (x11 or wayland). This is important because GUI application in Docker require X11 to work correctly.Configuring Display Manager (if using Wayland)
Opens the GDM configuration file. If your system is using Wayland, you may need to disable it (by enabling X11) to ensure compatibility with Docker GUI applications. Change the line #WaylandEnable=false to WaylandEnable=false.Applying Changes (if you change your session type)
Restarts the system to apply any changes made to the display configuration.Accessing the Running Container
Opens an interactive shell inside the running container, allowing you to execute commands directly within it.Hailo Installation In The Container
Installing Hailo Full Package
Installs the complete Hailo software stack inside the container, including runtime libraries, tools, and dependencies required to work with the Hailo device.Verifying Hardware Detection
Checks if the Hailo device is correctly detected inside the container. If the installation is successful, it will display device information such as firmware version, architecture, and product details.Verifying TAPPAS Core Installation
Confirms that the Hailo GStreamer plugins (TAPPAS core components) are properly installed.If successful, it will list available Hailo elements used for building AI pipelines, such as detection, tracking, and post-processing.
Installing Hailo Examples
Navigates to the Hailo examples directory and runs the installation script.This sets up example pipelines and required resources for testing and development.
Setting Up the Environment
Loads environment variables required for running Hailo applications, such as library paths and configuration settings.To deactivate the virtual environment tap deactivate
Running a Test Pipeline
Executes a basic object detection example to verify that the full pipeline (hardware + software) is working correctly.Setting Up and Building ROS 2 Packages
Sourcing ROS 2 Environment
cvBridge installation
open the src folder:
Compile the package: activate the environment you just compiled:Quote
Check the repository to get more information: Vision opencv
Building the ROS 2 interfaces for the project
Compile the package:
Activate the environment you just compiled:Building the GUI and communication modules
Open the repository:
To create the virtual environment, run:
Activate the virtual environment using the next source command:
After you activate the environment your command prompt will change to show that you are in a Python virtual environment.
To use a virtual environment with ROS 2 you must tell colcon to ignore the directory that contains the files that manage the virtual environment:
To exit your virtual virtual environment type:
To ensure your ROS 2 distribution can access Python packages installed in your virtual environment, you need to explicitly add the virtual environment's Python path to ROS's Python system path. This bridges the gap between your isolated Python environment and the ROS 2 ecosystem.
Add the following lines to your virtual environment's activation script to automatically configure the Python path when the environment is activated:
Ensure that your python virtual environment is activated:
Install the necessary Python modules for the application: Install numpy manually: Compile the packages:Use colcon build only within your workspace
Activate the environment you just compiled:
Building the Vision Package and modifying setup_env.sh
Open hailo-rpi5-examples:
Modify setup_env.sh:
copy the path to of your library python packages:
Open your setup_env.sh file: Paste your python path with the next structure:export PYTHONPATH=${PYTHONPATH}:home/<user>/<path-to-your-hailo-environment>/venv_hailo_apps/lib/python3.11/site-packages
Build the vision package:
Troubleshooting
Tello Connection Problems
Issue: Cannot connect ro Tello drone
Check WiFi connection:
Verify Tello WiFi is available: Restart network manager:Module problems
Issue: "ModuleNotFoundError: No module named 'matplotlib.tri.triangulation'"
Uninstall matplotlib in your virtual environment:
`bash
pip uninstall matplotlib -y