This is the control interface for the gripper.
-
Make sure you have already installed and Configured Your ROS Environment
-
Create and build a catkin workspace: (you can skip this step , if you have already created it)
$ mkdir -p ~/catkin_ws/src $ cd ~/catkin_ws/ $ catkin_make -
Clone the whole directory(
dh_gripper_driver_ros) to your catkin's workspace src folder -
Compile the code
$ cd ~/catkin_ws/ $ catkin_make -
Add the path including to the
ROS_PACKAGE_PATHenvironment variable. Open~/.bashrcfile and add at the end the following line.$ source ~/catkin_ws/devel/setup.bash
-
First , Modify the
dh_gripper.launchfile in according to the product model//gripperID default 1 <arg name="GripperID" default="1"/> //gripper Model <arg name="GripperModel" default="PGE"/> //grippper USB Port Name <arg name="Connectport" default="/dev/ttyUSB0"/> //gripper Baudrate defalut : 115200 <arg name="Baudrate" default="115200"/>Now , you can running controller
$ roslaunch dh_gripper_driver dh_gripper.launchIf If it runs successfully , you will see the initialization of the gripper,and then auto close and open
-
Modify the
dh_gripper.launchfile, and roslaunchdh_gripper.launch<arg name="test_run" default="false"/>use topic to control
$rostopic pub /gripper/ctrl dh_gripper_msgs/GripperCtrl "initialize: false position: 0.0 force: 100.0 speed: 100.0" -
you can read the
dh_gripper_Test.cppin/dh_hand_driver/srcfolder to study
$ sudo apt-get install ros-kinetic-gazebo-ros-pkgs ros-kinetic-gazebo-ros-control
$ catkin_make