Installation
This section provides a guide to install and configure the environment required to run the DJI Tello altitude control system on Raspberry Pi 4. It covers dependency installation, ROS 2 Humble setup, and development environment configurations.
System Requirements
Hardware Requirements
- Raspberry Pi 4 or 5
- Storage: 32 GB microSD card (Class 10)
- DJI Tello Drone
Software Requirements
- Operating System: Ubuntu 22.04 LTS (64-bit, ARM) or Ubuntu 24.04 LTS (64-bit, ARM)
- ROS 2: Humble or Jazzy
Environment Setup
Update the system
ROS 2 Installation
For Ubuntu 22.04 Install ROS 2 Humble: ROS 2 Humble installation!
For Ubuntu 24.04 Install ROS 2 Jazzy: ROS 2 Jazzy installation!
Python Virtualenv Installation
To verify if virtualenv is ready installed, run:
If virtualenv is not installed, run:
Project Cloning and Creating the virtual environment
clone the repository and open the file:
git clone https://github.com/LichtenbergCode/tello-pid-altitude-control-ros2.git
cd tello-pid-altitude-control-ros2
To create the virtual environment, run:
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 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:
Example: Modify Virtual Environment Activation Script
Your virtual environment's path or your python version will differ. Ensure you use the correct path for your venv name and Python version in the following commands
Navigate to your env-package path:
Use the next command to get the absolute path of your current file:
environment package path
navigate to your virtual environment activate file:
open the activate file using a text editor:
Open activate file
Add the env-package path to your activate file:
Edit activate file
Activate your Python virtual environment:
To exit your virtual virtual environment type:
Install the necessary Python modules for the application:
Compile the packages:
Use colcon build only within your ros workspace
Activate the environment you just compiled:
Run the app:
Troubleshooting
Tello Connection Problems
Issue: Cannot connect ro Tello drone
Check WiFi connection:
Verify Tello WiFi is available: Restart network manager:
environment package path
Open activate file
Edit activate file