A comprehensive hand gesture recognition system that enables real-time control of robotic devices using computer vision and MediaPipe.
- Real-time Hand Gesture Recognition: Uses MediaPipe for accurate hand tracking
- Multiple Control Methods: Zone-based control, angle-based turning, and finger gesture recognition
- Professional GUI Applications: Modern PyQt5 interface with live camera feed
- ESP32 Integration: Wireless communication via UDP to control robotic hardware
- Configurable Parameters: Adjustable detection sensitivity, control zones, and network settings
- Multiple Example Implementations: From simple scripts to full-featured applications
- Python 3.7 or higher
- Webcam
- ESP32 development board (optional, for hardware control)
- Clone the repository:
git clone https://github.com/yourusername/gesture-controlled-robot.git
cd gesture-controlled-robot- Install Python dependencies:
pip install -r requirements.txt- Run the main application:
python src/gesture_control_gui.pygesture-controlled-robot/
โโโ src/ # Main application code
โ โโโ gesture_control_gui.py # Advanced GUI application
โ โโโ gesture_control_simple.py # Simple command-line version
โ โโโ core/ # Core modules
โโโ esp32/ # ESP32 Arduino code
โ โโโ robot_controller/ # Main ESP32 firmware
โโโ examples/ # Example implementations
โ โโโ simple_gestures/ # Basic gesture recognition
โ โโโ zone_based_control/ # Zone-based control methods
โ โโโ gui_applications/ # Different GUI versions
โโโ docs/ # Documentation
โ โโโ hardware_setup.md # Hardware assembly guide
โ โโโ api_reference.md # API documentation
โ โโโ troubleshooting.md # Common issues and solutions
โโโ requirements.txt # Python dependencies
โโโ README.md # This file
- Forward Zone: Place your hand in the top zone of the screen
- Backward Zone: Place your hand in the bottom zone of the screen
- Left/Right Turns: Tilt your hand left or right beyond the angle threshold
- Stop: Pinch index finger and thumb together
- Forward: Point with index finger upward
- Backward: Close fist
- Left/Right: Point left or right with index finger
- ESP32 development board
- 2x DC motors
- Motor driver (L298N or similar)
- Robot chassis
- Power supply (7.4V recommended)
- Jumper wires
| ESP32 Pin | Component | Description |
|---|---|---|
| GPIO 2 | ML_Ctrl | Left motor direction |
| GPIO 5 | ML_PWM | Left motor speed |
| GPIO 4 | MR_Ctrl | Right motor direction |
| GPIO 16 | MR_PWM | Right motor speed |
For detailed hardware setup instructions, see Hardware Setup Guide.
Configure the ESP32 IP address and UDP port in the application or modify the settings directly:
ESP32_IP = "192.168.137.205" # Your ESP32's IP address
ESP32_PORT = 4210 # UDP communication portAdjust hand detection sensitivity:
min_detection_confidence: Minimum confidence for hand detection (0.1-1.0)min_tracking_confidence: Minimum confidence for hand tracking (0.1-1.0)
Customize control zones in the GUI or modify zone parameters:
- Position (X, Y coordinates)
- Size (width and height)
- Turn angle threshold
from src.core.gesture_recognizer import GestureRecognizer
recognizer = GestureRecognizer()
command = recognizer.process_frame(frame)
print(f"Detected command: {command}")from src.core.udp_client import UDPClient
client = UDPClient("192.168.137.205", 4210)
client.send_command("FORWARD")- Define gesture logic in
src/core/gesture_recognizer.py - Add gesture to the recognition pipeline
- Map gesture to robot commands
- Test with the GUI application
Modify the ESP32 code in esp32/robot_controller/main.cpp to change:
- Motor speeds
- Movement patterns
- Additional sensors integration
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-gesture) - Commit your changes (
git commit -am 'Add new gesture recognition') - Push to the branch (
git push origin feature/new-gesture) - Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- MediaPipe for hand tracking capabilities
- OpenCV for computer vision functionality
- PyQt5 for the GUI framework
If you encounter any issues or have questions:
- Check the Troubleshooting Guide
- Open an issue on GitHub
- Contact the maintainers
- Voice command integration
- Mobile app for remote control
- Machine learning for custom gesture training
- Support for multiple robots
- Web-based control interface
- Advanced path planning algorithms
Happy Coding! ๐
