# dh_gripper_driver_ros2
**Repository Path**: xibeisiber/dh_gripper_driver_ros2
## Basic Information
- **Project Name**: dh_gripper_driver_ros2
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-09-10
- **Last Updated**: 2024-09-10
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Gripper controller
### Description
This is the control interface for the gripper.
文档为原ROS1文档,需要修改
### Installation
1. Make sure you have already installed and Configured Your [ROS](http://wiki.ros.org/ROS/Tutorials/InstallingandConfiguringROSEnvironment) Environment
2. Create and build a [catkin workspace](http://wiki.ros.org/catkin/workspaces): (you can skip this step , if you have already created it)
```
$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/
$ catkin_make
```
4. Clone the whole directory( `dh_gripper_driver_ros` ) to your catkin's workspace src folder
5. Compile the code
```
$ cd ~/catkin_ws/
$ catkin_make
```
6. Add the path including to the `ROS_PACKAGE_PATH` environment variable. Open `~/.bashrc` file and add at the end the following line.
```
source ~/catkin_ws/devel/setup.bash
```
------
### Instructions
1. ##### Connect all hardware and Turn on the power
2. ##### Modify launch file and Running controller
First , Modify the `dh_gripper.launch` file in according to the product model
```
//gripperID default 1
//gripper Model
//grippper USB Port Name
//gripper Baudrate defalut : 115200
```
Now , you can running controller
```
$ ros2 launch dh_gripper_driver dh_gripper.launch
```
> If If it runs successfully , you will see the initialization of the gripper,and then auto close and open
3. ##### Disable test run ,and use topic
Modify the `dh_gripper.launch` file, and roslaunch `dh_gripper.launch`
```
```
use topic to control
```
$ros2 topic pub /gripper/ctrl dh_gripper_msgs/GripperCtrl "initialize: false
position: 0.0
force: 100.0
speed: 100.0"
```
4. ##### Study how to use it
you can read the ` dh_gripper_Test.cpp` in `/dh_hand_driver/src` folder to study
5. ##### Enjoy it