Discussion

Left ArrowBack to discussions page
David_GariepyDavid_Gariepy Beta Tester Beetle, Wrist Camera URCap 1.3.0, Vacuum Beta tester Posts: 183 Handy
edited February 25 in General

Hello everyone, 

The following describes the procedure If you are looking to remotely control a Robotiq Gripper through port 30002 on universal robot. 

Native UR command like moveL or servoJ can be sent directly to port 30002.  All functions implemented by a URCap like the Robotiq Gripper function are unknown even if the URCap is installed.  When a program is written on the teach pendant, all URCap function definitions are implemented in this program each time it is compiled and executed by the UR controller.  This means if you try to send the command line rq_move_and_wait(58) function to the controller by the port 30002, it will never work because it's unknown to the controller.  To achieve a gripper function, the definition of this function must also be sent.  

In the compressed file included below, you’ll find a file named gripper.script. The file contains the definition of all the available Robotiq gripper functions. At the bottom of the file, you’ll see a list of all the functions ready to be used. If the file is sent as is to the controller, the connected gripper will open and close based on lines 2364 and 2366, assuming the gripper is already activated. 


Simply insert an “#” sign in front of the function you want to be ignored and remove the “#” sign in front of the functions you want to be executed. 


The file can then be sent to the controller and be executed. To do so, we’ll use python program which can be downloaded here. In the compressed file, you’ll also find a small python program called socket UR send file.py used to send the gripper.script file to the UR controller through port 30002. You’ll need to change the IP address of the robot in the socket UR send file.py to match your robot IP address.


Be sure to have both the socket UR send file.py and gripper.script file in the same folder and execute socket UR send file.py. The action(s) enabled in the gripper.script file will then be executed. 

Enjoy!

David Gariépy
Integration Coach

Comments

  • David_GariepyDavid_Gariepy Beta Tester Beetle, Wrist Camera URCap 1.3.0, Vacuum Beta tester Posts: 183 Handy
    You could also generate your own script file if needed, for example you would like to use a new function added to a future release of the URCap. You could create a simple .urp program that contains only the script function you want to execute and saved it to a flash drive. You’ll then find a .urp version of your program, a .txt version, and a .script version.  You can then use the .script version of that program and sent it to the robot controller.
    David Gariépy
    Integration Coach
  • KarthikKarthik Posts: 5 Apprentice
    Hi,

    Thanks for the explanation!

    I am working on ROS to control the UR and gripper. I tried your method through ROS as well as tried it as a standalone, the way you explained. The python script executes but the gripper doesn't open and close as the script file says. I activated the gripper before sending the script file. May I know if there is workaround or am I missing something?


  • David_GariepyDavid_Gariepy Beta Tester Beetle, Wrist Camera URCap 1.3.0, Vacuum Beta tester Posts: 183 Handy
    Hi @Karthik

    Did you verify that the robot is accessible on the network? Try to ping the IP address to be sure you can communicate with the robot.  
    Also be sure that if you are on e-series, the remote mode is enabled, otherwise, it won't allow the script to be executed on the robot. 

    Best regards
    David Gariépy
    Integration Coach
  • KarthikKarthik Posts: 5 Apprentice
    The remote mode was disabled. It works!
    But since I am controlling through ROS, disabling the local mode will not connect the UR and the PC.

    This is a good method, but not suitable for my application. Thanks a lot for your support!

    Do you happen to know how to send this whole gripper script through a secondary program?
    Can I do it as below.

    sec secondaryProgram():
         def Gripper():
         .
         .
         .
         .
        end
    end

    I will give this a try. will this work?


Sign In or Register to comment.
Left ArrowBack to discussions page