How to control a Robotiq 2F-85 in ROS via the UR Tool I/O
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:
- install the official UR ROS driver: https://github.com/UniversalRobots/Universal_Robots_ROS_Driver
- install the robotiq driver being maintained by Clearpath: https://github.com/clearpathrobotics/robotiq
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 tooldevicename 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 (robotiqactionserver.launch):
- set respawn=true
- set the comport to /tmp/ttyTool
Startup/Launch order:
- power on the arm, release brakes, etc
- roslaunch urrobotdriver ur5e_bringup.launch (the UR launch file you customized)
- wait 10-15 seconds for the UR driver to finish launching
- roslaunch robotiq2fgrippercontrol robotiqaction_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
Asked by jeff-o on 2022-04-25 14:32:07 UTC
Comments
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 forarg
s by creating a wrapper.launch
and passing them to theinclude
d.launch
files.ROS Answers isn't really an issue tracker. I'd suggest to report this on the
UniversalRobots
issue tracker instead.Asked by gvdhoorn on 2022-04-26 01:47:25 UTC
I needed to remove the Robtiq URCap from the UR Controller to make it work!
Asked by bi3ri on 2022-06-22 04:49:22 UTC
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
Asked by Ted_Morell on 2023-01-27 11:17:04 UTC
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
Asked by Ted_Morell on 2023-02-07 09:43:00 UTC
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
Asked by AJain on 2023-07-04 04:10:02 UTC