A professional Python SDK for controlling DJI Tello drones with advanced flight patterns, computer vision capabilities, and comprehensive safety features.
✈️ Advanced Flight Control: Takeoff, landing, precise movement in all directions- 📷 Real-time Camera Streaming: Live video feed with photo capture capabilities
- 🎯 Complex Flight Patterns: Automated sequences, geometric patterns, and custom maneuvers
- 🛡️ Safety First: Comprehensive battery monitoring, emergency protocols, and error handling
- 👁️ Computer Vision Ready: OpenCV integration for image processing and autonomous navigation
- 📊 Flight Data: Real-time telemetry and flight status monitoring
tello_controller/
├── src/
│ ├── tello_controller.py # Core drone control interface
│ ├── flight_control.py # Advanced flight pattern implementations
│ └── utils.py # Helper functions and utilities
├── examples/
│ ├── basic_flight_demo.py # Simple takeoff, movement, and landing demo
│ └── advanced_patterns.py # Complex flight patterns and maneuvers
├── photos/ # Captured drone photos
├── tests/ # Unit tests and test fixtures
├── requirements.txt # Python dependencies
└── README.md # Project documentation
- DJI Tello or Tello EDU drone
- Python 3.8 or higher
- WiFi-enabled computer
- Well-ventilated, open flying area
-
Clone the repository:
git clone https://github.com/curohn/tello_controller.git cd tello_controller -
Install dependencies:
pip install -r requirements.txt
-
Connect to Tello:
- Power on your Tello drone
- Connect your computer to the Tello WiFi network (TELLO-XXXXXX)
- Wait for solid connection light
Run the basic flight demonstration:
python examples/basic_flight_demo.pyExperience advanced flight patterns:
python examples/advanced_patterns.pyfrom src.tello_controller import TelloController
# Initialize controller
drone = TelloController()
# Connect and perform basic flight
if drone.connect():
drone.takeoff()
drone.move_forward(100) # Move 100cm forward
drone.rotate_clockwise(90) # Turn 90 degrees
drone.land()
drone.disconnect()from src.flight_control import FlightController
# Initialize advanced controller
controller = FlightController()
if controller.connect():
# Execute predefined patterns
controller.fly_square_pattern(100) # 100cm square
controller.fly_circle_pattern(50) # 50cm radius circle
controller.perform_flip_sequence() # Multiple flips
controller.disconnect()| Category | Command | Description |
|---|---|---|
| Movement | move_forward(distance) |
Move forward by distance (cm) |
move_back(distance) |
Move backward by distance (cm) | |
move_left(distance) |
Move left by distance (cm) | |
move_right(distance) |
Move right by distance (cm) | |
move_up(distance) |
Move up by distance (cm) | |
move_down(distance) |
Move down by distance (cm) | |
| Rotation | rotate_clockwise(degrees) |
Rotate clockwise |
rotate_counter_clockwise(degrees) |
Rotate counter-clockwise | |
| Advanced | flip(direction) |
Perform flip ('l', 'r', 'f', 'b') |
go_xyz_speed(x, y, z, speed) |
Move to coordinates with speed | |
| Camera | streamon() |
Enable video streaming |
streamoff() |
Disable video streaming | |
take_picture() |
Capture and save photo | |
| Status | get_battery() |
Get battery percentage |
get_height() |
Get current height (cm) | |
get_temperature() |
Get internal temperature |
⚠️ SAFETY FIRST: Always prioritize safety when operating drones
- 🏞️ Environment: Fly only in open areas away from people, buildings, and obstacles
- 🔋 Battery: Monitor battery levels constantly; land when below 20%
- 📡 Connection: Maintain strong WiFi connection; have manual override ready
- 🌤️ Weather: Avoid flying in windy, rainy, or poor visibility conditions
- 📋 Regulations: Understand and comply with local drone regulations
- 👥 Supervision: Never leave drone unattended during operation
Create a .env file for custom configurations:
TELLO_TIMEOUT=10
PHOTO_DIRECTORY=photos
LOG_LEVEL=INFODefault safety parameters can be configured in src/utils.py:
- Minimum battery level: 20%
- Maximum flight height: 100m
- Connection timeout: 10 seconds
Connection Problems
- ✅ Ensure Tello is powered and in WiFi mode
- ✅ Verify computer connection to Tello network
- ✅ Check for interference from other WiFi networks
- ✅ Restart drone and retry connection
Flight Issues
- ✅ Confirm battery level above 20%
- ✅ Calibrate drone on flat surface before flight
- ✅ Check for adequate flying space
- ✅ Verify no GPS interference (indoor flying)
Import/Installation Issues
- ✅ Confirm Python 3.8+ installation
- ✅ Reinstall dependencies:
pip install -r requirements.txt --force-reinstall - ✅ Check virtual environment activation
Run the test suite:
python -m pytest tests/Run with coverage:
python -m pytest tests/ --cov=src/We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Clone your fork
git clone https://github.com/yourusername/tello_controller.git
cd tello_controller
# Install development dependencies
pip install -r requirements.txt
pip install -r requirements-dev.txt
# Install pre-commit hooks
pre-commit installThis project is licensed under the MIT License - see the LICENSE file for details.
- DJI for creating the Tello drone platform
- djitellopy - Python SDK for Tello drones
- OpenCV - Computer vision capabilities
- Community contributors who have helped improve this project
- DJI Tello SDK 2.0 Documentation
- djitellopy Documentation
- OpenCV Python Tutorials
- Drone Safety Guidelines