Transform your hands into a virtual steering wheel for Roblox driving games!
Drivable is a real-time hand-tracking controller that uses computer vision to let you drive in Roblox games such Driving Empire using natural hand gestures. Hold your hands like you're gripping a steering wheel, tilt to steer, and show an open palm to brake—all captured through your webcam.
- Intuitive Hand Steering: Raise your left hand to steer left, right hand to steer right, keep level to go straight
- Proportional Control: Steeper hand angles = sharper turns
- Gesture-Based Braking: Show an open palm with either hand to activate the brake
- Auto-Acceleration: Automatically accelerates when both hands are detected (like holding the wheel)
- Real-Time Visual Feedback: See hand landmarks, steering angle, and gesture classifications on screen
- Start/Stop Control: Toggle detection on/off without closing the app
- Smooth Steering: Moving average filter prevents jittery movements
- Privacy-First: All processing happens locally—no data leaves your computer
- Position your hands in front of your webcam as if holding a steering wheel
- Tilt your hands to steer:
- Left hand higher = Steer LEFT
- Right hand higher = Steer RIGHT
- Both hands level = Drive STRAIGHT
- Show an open palm (either hand) to brake
- Auto-accelerate when both hands are detected
The system calculates the angle between your hands and translates it into keyboard inputs (WASD keys) that Roblox recognizes.
- Python 3.8 or higher
- Webcam
- Windows, macOS, or Linux
-
Clone the repository
git clone https://github.com/yourusername/drivable.git cd drivable -
Install dependencies
pip install -r requirements.txt
-
Run the application
python main.py
- Launch the application using the command above
- Position yourself so your webcam can see both hands clearly
- Press 's' to START detection and keyboard input
- Press 'x' to STOP detection (releases all keys)
- Press 'q' to QUIT the application
Controls:
s- Start detection and keyboard inputx- Stop detection and release all keysq- Quit application
Hand Gestures:
- Two hands detected → Steering control active
- Left hand higher → Steer LEFT (A key)
- Right hand higher → Steer RIGHT (D key)
- Hands level → Drive STRAIGHT
- Open palm → BRAKE (S key)
- Two hands present (not braking) → AUTO-ACCELERATE (W key)
The project consists of three main modules:
- MediaPipe Hands integration for real-time tracking
- Gesture recognition (open palm, fist detection)
- Hand center calculation for steering
- Angle computation between hand positions
- Visual overlay rendering
- Keyboard input simulation via pynput
- State management for key press/release
- WASD key mapping for Roblox games
- Conflict prevention and cleanup
- Main application coordinator
- Camera feed management
- Steering angle smoothing (10-frame moving average)
- Start/stop state control
- Real-time frame processing pipeline
1. Detect both hands and extract landmark positions
2. Identify left/right hands based on x-coordinate
3. Calculate vertical height difference (y-coordinates)
4. Compute angle: atan2(height_diff, horizontal_distance)
5. Apply threshold (12.5°) for "straight" dead zone
6. Calculate excess angle for proportional steering
7. Apply moving average filter for smoothing
8. Map to keyboard input (A/D keys)
- Python 3.x - Core programming language
- MediaPipe 0.10.0+ - Hand tracking and landmark detection
- OpenCV 4.8.0+ - Camera access and image processing
- pynput 1.7.6+ - Keyboard input simulation
- NumPy 1.24.0+ - Numerical computations
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
- MediaPipe by Google for excellent hand tracking
- OpenCV for computer vision capabilities
- pynput for cross-platform input control
- The Roblox community for inspiration
Have questions or suggestions? Feel free to:
- Open an issue on GitHub
- Submit a pull request
- Reach out to the maintainers
This project is for educational and entertainment purposes. Use responsibly and in accordance with Roblox's Terms of Service. The developers are not responsible for any account actions taken by Roblox as a result of using this tool.
Made with ❤️ and Python
Drive safely, even virtually! 🚗💨