Skip to content

PyDHgripper is a Python library that allows you to control the DH gripper with Python. This library is based on the Modbus protocol of the DH gripper. The support types of DH grippers includes AG-95, DH-3, RGD, and PGE series.

License

Notifications You must be signed in to change notification settings

han-xudong/pyDHgripper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyDHgripper: Control DH Gripper with Python

[EN] | [中文]

Description

PyDHgripper is a Python library that allows you to control the DH gripper with Python. The DH grippers are a series of robot grippers which is widely used in grasping tasks. This library is based on the Modbus protocol, and the support types of DH gripper includes AG-95, DH-3, RGD, and PGE series.

Hardware Requirements

  • DH gripper
  • USB-to-RS485 converter
  • 24V DC power supply

Here is a connection example for AG-95 gripper

Installation

The pyDHgripper library supports Python 2.x and Python 3.x. You can install the library using the following command:

pip install pydhgripper

Or you can install the library from the source code:

git clone https://github.com/han-xudong/pyDHgripper.git
cd pyDHgripper
pip install pip -U
pip install -r requirements.txt

Quick Start

For Linux, it's needed to set the serial port permission first:

sudo chmod 777 /dev/ttyUSB0
# For CTS-B1.0,
# sudo chmod 777 /dev/ttyACM0
sudo usermod -aG dialout {userName}
reboot

Several types of DH grippers can be controlled with pyDHgripper. For example, to control the AG-95 gripper:

from pydhgripper import AG95

gripper = AG95(port='/dev/ttyUSB0')

And here are some functions that can be used to control the gripper:

  • read_state: Read the state of the gripper.
gripper.read_state()
  • read_pos: Read the position of the gripper.
gripper.read_pos()
  • set_force: Set the force of the gripper.
gripper.set_force(val='{FORCE}')
  • set_pos: Set the position of the gripper.
gripper.set_pos(val='{POSITION}')
  • set_vel: Set the velocity of the gripper.
gripper.set_vel(val='{VELOCITY}')

For more functions, please refer to the source code.

Documentation

Here pyDHgripper provide user manuals for the DH grippers, including AG-95, DH-3, RGD, and PGE series.

AG Gripper Short Manual (Modbus-RTU)

DH-3 Short Manual

PGE Series Product Operation Manual

License and Acknowledgement

PyDHgripper is licensed under the MIT License.

Some core codes are developed based on DaHuan-FingerControl by Frank.

The DH grippers are developed by DH Robotics. For more information, please refer to the DH Robotics website.

About

PyDHgripper is a Python library that allows you to control the DH gripper with Python. This library is based on the Modbus protocol of the DH gripper. The support types of DH grippers includes AG-95, DH-3, RGD, and PGE series.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages