This repository provides a demonstration of controlling a DJI Tello drone in the AirSim environment using hand gestures detected via the MediaPipe library. By utilizing computer vision techniques, the code interprets hand movements captured by the webcam to command the drone to perform specific actions.
- Hand Gesture Recognition: Utilizes MediaPipe's Hand module to detect and analyze hand landmarks in real-time from the webcam feed.
- Drone Control: Interprets recognized hand gestures to control the DJI Tello drone's movements in the AirSim simulator.
- Gesture Mapping: Maps specific finger configurations to predefined drone movements (e.g., up, down, left, right).
- User Interface: Displays a live feed with hand landmarks drawn and a label indicating the recognized gesture.
- Python 3.x
- OpenCV (cv2)
- MediaPipe (mediapipe)
- AirSim Python API (airsim)
- Tello Python library (tellolib)
- Clone this repository.
- Install required libraries by running:
pip install -r requirements.txt
.
- Connect to AirSim: Ensure AirSim is running and connect to the simulator.
- Connect DJI Tello Drone: Ensure the Tello drone is connected and accessible.
- Run the Python script airsim_hand_gesture_control.py.
- Perform hand gestures in front of your webcam.
- The recognized gestures will control the Tello drone's movements within the AirSim environment.
This repository provides four distinct code files catering to different functionalities:
- File Name: airsim_hand_gesture_control.py
- Description: This script integrates both hand gesture recognition using MediaPipe and control commands for the DJI Tello drone in the AirSim environment.
- File Name: mediapipe_hand_gesture.py
- Description: This script focuses solely on hand gesture recognition using MediaPipe's Hand module. It serves as a standalone demonstration of hand gesture recognition without drone control functionalities.
- File Name: tello_control.py
- Description: This script provides a simplified version of the AirSim integration for controlling the DJI Tello drone based on hand gestures. It imposes certain limitations on the drone's movements to ensure safer operation.
- File Name: airsim_limitations.py
- Description: Similar to tello_control.py, this script adds additional safety measures to drone movements, preventing continuous or excessive maneuvers.
Users can choose the script based on their requirements:
- Use airsim_hand_gesture_control.py for integrating hand gesture control with the DJI Tello drone in the AirSim simulator.
- Use mediapipe_hand_gesture.py for a standalone demonstration of hand gesture recognition without drone control functionalities.
- Use tello_control.py for controlling the DJI Tello drone with added limitations on movements for safety.
- Use airsim_limitations.py for a version with extended safety measures in drone control.
- AirSim: Utilized for the drone simulation environment.
- MediaPipe: Used for real-time hand landmark detection.
- OpenCV: Employed for image processing and webcam capture.
- Tello Python library: Used for communication with the DJI Tello drone.
This project is licensed under the MIT License.
Contributions are welcome! Feel free to fork this repository, create pull requests, or open issues for any improvements, bug fixes, or suggestions.