This is a repository for Python API of OnRobot grippers. The script
folder includes modules for RG2, 2GF7 and VGC10 gripper models.
Modules:
- Device:
device.py
- RG2:
rg2.py
- 2GF7:
twofg.py
- VGC10:
vgc10.py
Status | Description |
---|---|
0 | Stable |
-1 | Error |
-2 | Connection Failed |
Methods | Description | Input |
---|---|---|
grip | Moves the gripper to the desired position | t_width: Default=20.0 (mm), n_force: Default=20 (N), p_speed: Default=10(%), f_wait: Default=True |
move | Moves the gripper to the desired position | t_width: Default=20.0 (mm), f_wait: Default=True |
stop | Stops the action | - |
isConnected | Returns True if the gripper is connected, False otherwise | - |
isBusy | Returns True if there is an obstacle during operation, False otherwise | - |
isGripped | Returns True if an object is gripped, False otherwise | - |
getStatus | Returns current status of the gripper (No connection=-2, Error=-1, Stable=0) | - |
get_ext_width | Returns current width between fingers | - |
get_force | Returns current force on the gripper (in Newton) | - |
get_min_ext_width | Returns minimum gripping width | - |
get_max_ext_width | Returns minimum gripping width | - |
- t_width: width to move the gripper to in mm's (float)
- n_force: force to move the gripper width in N (float)
- p_speed: speed of the gripper in % compared to full speed (int)
- f_wait: wait for the gripper to end or not (Boolean)
from device import Device
from twofg import TWOFG
device = Device()
gripper = TWOFG(device)
gripper.isConnected() # for checking connection
run api_byte2script.py
to create api_original.py
in the current directory
python3 /path/to/onrobot-api/api_byte2script.py