pyDHgripper: Control DH Gripper with Python
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.
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.
Metadata
Release files for pydhgripper 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pydhgripper-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for pydhgripper-1.0.2-py3-none-any.whl |
Release files / pydhgripper-1.0.2-py3-none-any.whl
| Download URL | pydhgripper-1.0.2-py3-none-any.whl |
|---|---|
| Size | 12.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b3f1dfc7233bb8d31487e89c401b908ed3f290eb96fa6eae0f4a31120d462022
|
|
BLAKE2b-256 checksum How to use checksums |
bce3be1450561f068d0c21ec706e592d6af190a46bd6af1cbfd0c06446f26154
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.14
|
Security for pydhgripper 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.