Home› Integration
Discussion
Back to discussions page
faizerd
Posts: 2 Recruit
Using 2 finger gripper attached to UR10 through ROS |
2.6K views
|
Answered | |
/ Most recent by akashp
in Integration
|
7 comments |

Hello,
We have a robot UR10 with a 2 finger gripper connected to the Robot controller through one of the USB port. We can manage to control the robot using the modern driver and ROS on another network computer. The gripper works using the teach pendant but we want to use ROS also to control the gripper and are unsure how to do this, as all the tutorials for using the gripper with ROS that we have found are for controlling it directly attached to a computer or network, not through a UR arm. Any idea where to start with this?
Thanks,
Faiz
We have a robot UR10 with a 2 finger gripper connected to the Robot controller through one of the USB port. We can manage to control the robot using the modern driver and ROS on another network computer. The gripper works using the teach pendant but we want to use ROS also to control the gripper and are unsure how to do this, as all the tutorials for using the gripper with ROS that we have found are for controlling it directly attached to a computer or network, not through a UR arm. Any idea where to start with this?
Thanks,
Faiz
Tagged:
There might be a way that you can try using the gripper connected to the teach pendant that don't use the robotiq ROS packages, but you'd still need the Robotiq URCaps. I've never tried this, but I think it might be feasible.
That driver subscribes to a topic called "ur_driver/URScript", where you can publish any script that you want and it'll execute on the robot side, including gripper commands by using the robotiq URcaps functions.
So what I would do, is to write in Polyscope the program you'd want to do. And then access the robot files and check the program you just made and see how the actual script is. That script you can send it via the topic mentioned above and it'll do exactly the same. You will see commands like these
Where all arguments goes from 0-1, for instance, or whatever other commands you use in your program.
It's very likely that you'd need to send also the Robotiq preamble that you will find in the URCaps files here, where all Robotiq functions are defined, and you might need to call "rq_init_connection(gripper_sid=9)" to init the gripper everytime...
Now that I'm writing it, it seems a bit of overwork with the only advantage that you don't have an USB until the PC. If that is not a strict constraint, I'd strongly suggest to integrate in the PC using ROS, given that you need it anyway for the UR.
@carlosjoserg, I am reading your post on controlling the gripper that is connected to the UR controller from a remote computer. I checked the .script file from a gripper open/close program, if I understand your idea correct, we need to send the preamble functions like the one below named "rq_set_pos"?
def rq_set_pos(pos, gripper_socket="1"):
end
There is a while loop here keep checking if pre==pos, do you think we can send this function and while loop line by line to the ur_driver/URScript node? B
I inserted the following functions into the UR teach pad, they work and the gripper can be activated and then close as I expected.
- socket_set_var(“ACT”, 0, “1”) # Deactivate gripper 1
- sleep(0.5) # Wait for 0.5 sec to write the registration “ACT”
- socket_set_var(“ATR”, 0, “1”) # Set the gripper as normal
- sleep(0.5) # Wait for 0.5 sec to write the registration “ATR”
- socket_set_var(“ACT”, 1, “1”) # Activate the gripper
- sleep(3.0) # Wait for 3 sec because the gripper will move in activation
- socket_set_var(“GTO”, 0, “1”) # Stop, don’t move
- sleep(0.5) # Wait for 0.5 sec to write the registration “GTO”
- socket_set_var(“POS”, 255, “1”) # Set the gripper position (0 is fully open, 255 is fully close)
- sleep(0.5) # Wait for 0.5 sec to write the registration “POS”
- socket_set_var(“GTO”, 1, “1”) # Move according to the POS setting
- sleep(5.0) # Wait for 5 sec for the gripper to move
- socket_set_var(“GTO”, 0, “1”) # Reset, don’t move when it is activated again next time
- sleep(0.5) # Wait for 0.5 sec to write the registration “GTO”
- socket_set_var(“POS”, 0, “1”) # Reset to fully open position
- sleep(0.5) # Wait for 0.5 sec to write the registration “POS”
Then I tried to follow @carlosjoserg idea of publishing these to the ur_driver/URScript topic. The gripper does not do anything.I tried to publish a "power off" to the topic, and it works, the power is turned off, so that topic is good.
I checked the log on the teach pad, whenever I send the "socket..." message, there is a "Program socket_set_var started", immediately followed by a "Program socket_set_var stopped". So I guess it is the timing issue? In order for it to work, it should not stop so quickly?
I am fairly new to ROS, so I could be doing something totally wrong, if anyone has any idea, please let me know.
Thanks.
Tianxiang
The commands I sent are:
For using the ur_driver/URScript ROS topic, I still couldn't make it work so far. It will be awesome if some experts here could try to let me know how that works.
Thanks everyone.
Tianxiang