Controlling robot gripper Rg2 with Python

Hello everyone,

I am currently working on a project involving two Universal Robots (UR3 and UR5). I am faceing difficulties controlling the GR2 gripper (Onrobot) using Python. Despite attempting various libraries such as Robotiq and URX, I have not observed any response from the gripper.

I am using ethernet cable as connection between PC and robots.

My objective is to achieve basic functionality: simply opening and closing the gripper.

I would greatly appreciate any insights or advice on how to control the RG2 gripper with Python.

Thank you in advance for your assistance.
Hedieh

1 Like

Try to use URScript Commands ( see: 6.3.1)

User_Manual_For_UR_Robots_HEX-E_H_QC_RG2_v1.16.0_EN.pdf (6.7 MB)

I made a simple library that you can use for this that does not require onRobot’s compute box which many sources fail to mention including the onrobot documentation.

I am regularly extending its functionality to cover more onRobot grippers, if you need support for a specific gripper submit an issue on github.

Here is the library: GitHub - RyanPaulMcKenna/onRobot: A simple gripper library for UR robot with onRobot gripper, no onrobot compute box needed!

No need to clone, you can simply pip install with:

pip install onRobot

unfortunately, it doesn’t work, I don’t know if I need install any other library.
I successfully runned lots of urscript commands like move the robot and set the IO, but when I run the onrobot urscript commands there’s no any response.
did I do sth worng? I’d appreciate it if someone could give me a guidance!
Thanks