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.
Hi @David_Gariepy,
can I use this script to controll the gripper at the same time as using the ur_robot_driver, which controlls the arm?
If I try it my way with the headless mode of the ur_robot_driver package, my ur_robot_driver loses connection.
Thanks!
Hi @Lukas97
Sorry, I have no idea. I haven't have the chance to play with it yet.
Regards
@David_Gariepy Thank you soooo much for this. It works like a charm.
@David_Gariepy In my GUI I need to repeatedly send commands for the HandE gripper and Epick vacuum, sending the whole file to the robot works depending on which commands I uncomment. However, do I need to resend the whole file every time I want to send a command or is there a way where I only send it once and then control the tools though the commands when needed.
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!