How to control a Robotiq 2F-85 in ROS via the UR Tool I/O

asked 2022-04-25 14:32:07 -0500

jeff-o gravatar image

updated 2022-04-25 14:37:33 -0500

This started out as a question but I ended up solving the problem myself! So I thought I'd post it here in case anyone is looking for the solution. So far this has only been tested in Melodic.

The setup is this: A Robotiq 2F-85 gripper connected to a UR arm via the Robotiq GRP-ES-CPL-062 Gripper Coupler. Control is via the Robotiq ROS driver, and NOT via the Robotiq URCap. The benefit here is that the UR controller takes care of the 24VDC supply that the gripper requires, along with the RS485 communications, all while eliminating the ugly and complicated external cable. Communications in the background is handled by a virtual com port set up by socat.

On the UR computer:

  • Install the rs485 URCap from the official Universal Robots GitHubrepo. This URcap creates a socat interface on the UR computer.
  • Install the external control URCap from the official Universal Robots GitHub repo. This allows ROS control of the UR arm.
  • Give the UR a static IP address (say, 192.168.131.40)

In Installation>General>Tool I/O:

  • set the tool output voltage to 24V
  • enable “communication Interface” and use defaults

On the ROS computer:

In the UR launch file (ur5e_bringup.launch):

  • define the UR's static IP address
  • set tool communication to true. This creates a virtual device link using socat.
  • change the tool_device_name to /tmp/ttyTool (the default is /dev which introduces all sorts of permissions nonsense)
  • download the calibration parameters from the arm and save them to the computer. Point the launch file at that path.

In the robotiq launch file (robotiq_action_server.launch):

  • set respawn=true
  • set the comport to /tmp/ttyTool

Startup/Launch order:

  • power on the arm, release brakes, etc
  • roslaunch ur_robot_driver ur5e_bringup.launch (the UR launch file you customized)
  • wait 10-15 seconds for the UR driver to finish launching
  • roslaunch robotiq_2f_gripper_control robotiq_action_server.launch (The robotiq launch file you customized)
  • wait for the robotiq driver to start. It may take a dozen respawns before it finally makes a connection. Or it might take one. You'll see lots of modbus exception errors, but it should eventually connect. After that the light on the gripper will turn blue and the connection should be pretty solid. (if anyone would like to take a crack at making the rs485 URCap + robotiq driver combo more robust, I'm sure everyone would sing your praises!)
    • start the external_control program on the UR
edit retag flag offensive close merge delete

Comments

1

I would really suggest to post your solution as an answer, instead of as part of the text describing the question.

Right now this looks like a question without an answer, which is not ideal on ROS Answers.

Additionally, but this is also just a suggestion: try to not edit upstream .launch and/or config files. It makes updates more complex than they need to be, and is typically impossible with packages installed using package managers (as they will be in read-only locations).

Especially with .launch files, you should be able to provide alternative values for args by creating a wrapper .launch and passing them to the included .launch files.

if anyone would like to take a crack at making the rs485 URCap + robotiq driver combo more robust, I'm sure everyone would sing your praises!)

ROS Answers isn't really an issue tracker. I'd suggest to ...(more)

gvdhoorn gravatar image gvdhoorn  ( 2022-04-26 01:47:25 -0500 )edit
1

I needed to remove the Robtiq URCap from the UR Controller to make it work!

bi3ri gravatar image bi3ri  ( 2022-06-22 04:49:22 -0500 )edit
1

Hi,

First of all I would like thank you for this post because it helped me a lot ! I am going to all the step you have mentioned. I have the gripper connected and I can send command to it by publishing a goal on the topic. However, once I start the external_control program on the UR I get the following error: Modbus Error: [input/Output] No response received from the remote unit/Unable to decode response [FATAL] Failed to contact gripper on port: /tmp/ttyTool Please, let me know if you had this issue before

Best Regards, Ted

Ted_Morell gravatar image Ted_Morell  ( 2023-01-27 10:17:04 -0500 )edit
1

Hi, Just in case someone else has the same issue as I had. In the in the UR launch file (ur5e_bringup.launch), the value of the "tool_voltage" argument needed to be 24. It was 0 by default. Best Regards, Ted

Ted_Morell gravatar image Ted_Morell  ( 2023-02-07 08:43:00 -0500 )edit

I had to change my Pymodbus library version from 3.3.2 to 2.2.0 and it worked !!! Otherwise, I was getting a Modbus error that no response was received. Thanks for the post-@jeff-o

AJain gravatar image AJain  ( 2023-07-04 04:10:02 -0500 )edit