DoF - a Robotiq Community
Warning sign
The Dof Community was shut down in June 2023. This is a read-only archive.
If you have questions about Robotiq products please reach our support team.
carlosjoserg

Hi @faizerd, by "modern driver" you mean this one: https://github.com/ThomasTimm/ur_modern_driver   right?

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 

rq_set_pos_norm(pos_norm)
rq_set_speed_norm(speed_norm)
rq_set_force_norm(force_norm)
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.



tianxiang


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...


@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"):
    rq_set_var(GTO,0, gripper_socket)
    rq_set_var(POS, pos, gripper_socket)
    gPRE = rq_get_var(PRE, 3, gripper_socket)
    pre = (gPRE[1] - 48)*100 + (gPRE[2] -48)*10 + gPRE[3] - 48
    sync()
    while (pre != pos):
          rq_set_var(POS, pos, gripper_socket)
          gPRE = rq_get_var(PRE, 3, gripper_socket)
          pre = (gPRE[1] - 48)*100 + (gPRE[2] -48)*10 + gPRE[3] - 48
          sync()
   end
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

tianxiang

I haven't been able to use the ROS topic ur_driver/URScript to control the gripper.

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