Control Gripper (Onrobot RG2) Using UrScript

Hello, good afternoon. I would like to ask, how can I control the gripper (OnRobot RG2) using URScript? I have tried several programs, and even if there are no errors in the program, the gripper does not move at all. Could you provide a solution or an example program?

Thank you for your concern.

We have RG6 grippers - there is an old version (R1) and a newer version (R2).
These use different commands and URCaps.
I’m not sure if the RG2 also was available in the old version, and I’m assuming they use the same commands.

The primary function it uses is rg_grip(width, force, depth_comp)

We created a function to grip the ID of a round part, where we’ve pre-defined a variable OD_inches:


def Grip_ID():

ID_grip=(ID_inches*25.4)-5
rg_grip(ID_grip,30,depth_comp=True)
end


Make sure that you have the finger dimensions correct in the setup - check the OnRobot dropdown on the pendant to make sure the gripper opening dimensions make sense.