This project provides a Python-based framework for controlling drones, initially supporting DJI Tello drones using the djitellopy library. The script supports joystick integration for manual control and autonomous movements as a fallback. The framework is designed to be extensible for other drones by modifying the drone-specific logic.
- Wi-Fi Management: Scans for available Wi-Fi networks and manages connections dynamically.
- Joystick Control: Supports joystick-based manual control using
pygame. - Autonomous Control: Performs predefined movements if no joystick is detected.
- Modular Design: Can be extended to support additional drones.
- Safety Features: Ensures safe landing and error handling during operations.
- Logging: Provides detailed logging for debugging and operational insights.
- Python 3.7 or later
- A compatible drone (initially tested with DJI Tello)
- PlayStation 5 controller (or any joystick supported by
pygame) - USB-C cable for joystick connection
- Dependencies:
djitellopyfor Tello drone control:pip install djitellopypygamefor joystick input:pip install pygame
-
Clone the repository:
git clone https://github.com/dougsland/autonomous_drones cd autonomous_drones -
Install the required dependencies:
pip install -r requirements.txt
-
Ensure the
nmclitool is installed and accessible for managing Wi-Fi connections.
-
Power on the Drone:
- For DJI Tello, power on the drone and wait for the Wi-Fi SSID to become available.
-
Run the Script:
python main.py
-
Joystick Connection:
- Connect a joystick (e.g., PlayStation 5 controller) via USB-C for manual control.
-
Autonomous Mode:
- If no joystick is detected, the script executes autonomous movements.
- Operating System: Linux-based system with
nmclifor Wi-Fi management
To support other drones:
- Replace the
Telloclass fromdjitellopywith the corresponding library or SDK for the target drone. - Update the methods related to drone-specific operations, such as
connect_drone,drone_logic, andprocess_joystick_input.
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
Contributions are welcome to extend support for additional drones and improve the framework. Please open an issue or submit a pull request.

