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

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