This project uses MediaPipe to detect hand gestures from a webcam feed and controls a Dynamixel servo motor accordingly. When the system detects an open or closed hand, it sends a command to the motor to open or close a gripper in real-time.
- Real-time hand gesture recognition using MediaPipe
- Integration with Dynamixel SDK for servo motor control
- Current-based position control for safe and compliant motion
- Smooth visual feedback via OpenCV
| Gesture | Gripper Action |
|---|---|
| ✋ Open Hand | Gripper Opens |
| ✊ Closed Fist | Gripper Closes |
Install dependencies via pip:
pip install opencv-python mediapipe numpyAdditionally, install the Dynamixel SDK (Python):
cd ~/DynamixelSDK-3.7.31/python
python3 setup.py install- Connect your Dynamixel servo to your system via USB (default port:
/dev/ttyUSB0). - Ensure the Dynamixel ID and port are correct in
new_algorithm.py. - Run the script:
python new_algorithm.py- Show your hand to the webcam. Open or close it to control the gripper.
You can tune the following parameters in new_algorithm.py:
DXL_ID– Motor ID (default:1)DEVICENAME– Serial port (default:/dev/ttyUSB0)GOAL_CURRENT_VALUE– Current limit for complianceDXL_MINIMUM_POSITION_VALUE,DXL_MAXIMUM_POSITION_VALUE– Gripper open/close position rangethreshold– Distance threshold for gesture classification
hand_gesture_gripper_control/
├── new_algorithm.py # Main control script
├── README.md # Project documentation
└── requirements.txt # Optional Python dependencies list