This repository contains a ROS (Robot Operating System) node written in Python that integrates MediaPipe for perception tasks and controls relays based on detected hand gestures. The node subscribes to a specific ROS topic, processes hand tracking data using MediaPipe, and sends HTTP POST requests to a specified API endpoint to control relay states accordingly.
- ROS1 (tested with [ROS1 distribution])
- Python 3.6+
- MediaPipe
rospy
,requests
,loguru
Python packages
The node subscribes to the perception/hand_petak
topic to receive Int32
messages indicating which relay to control. It uses MediaPipe for hand tracking and gesture recognition, and controls relay states by sending HTTP POST requests to a configurable API endpoint.
- ROS Integration: Subscribes to
perception/hand_petak
topic. - MediaPipe Integration: Uses MediaPipe for hand tracking and gesture recognition.
- Relay Control: Sends HTTP POST requests to control relay states.
- Logging: Utilizes the
loguru
library for logging. - Configurable API Endpoint: API endpoint for relay control is configurable via command-line argument.
Follow these steps to install and set up the package:
-
Clone the repository:
git clone [email protected]:agus-darmawan/ros-ur5-controller-mediapipe.git cd ros-ur5-controller-mediapipe
-
Build the package:
catkin_make
-
Source the setup script:
source devel/setup.bash
To run the system, follow these steps:
-
Run the Perception node:
rosrun ur_perception hand_tracker_node.py 'source'
note : source can be path of video file of source of the camera
-
Run the Controller node:
rosrun ur_controller ur_controller_node.py 'API'
note : API url post comand of esp inside the UR