Robotics StackExchange | Archived questions

Robotiq Gripper via Universal Robot Failure

Hi,

I am attempting to use the Robotiq Hand-E gripper on a UR3e. Unfortunately, there seems to be a connection issue to the Robotiq gripper.

The following command seems to run successfully. Communication with the UR is enabled, communication with the gripper seems successful as the file at /tmp/ttyUR is created. There are variables I have omitted because their default values are correct (baud, parity, etc)

$ roslaunch ur_robot_driver ur3e_bringup.launch robot_ip:=192.168.1.94 use_tool_communication:=true tool_device_name:=/tmp/ttyUR

The following node fails and afterward the file no longer exists at /tmp/ttyUR

$ rosrun robotiq_2f_gripper_control Robotiq2FGripperRtuNode.py /tmp/ttyUR

Error:

/home/xavier/august_demo_ws/src/robot_arm_demo_v2/robotiq/robotiq_2f_gripper_control/nodes/Robotiq2FGripperRtuNode.py:65: SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'. Please see http://wiki.ros.org/rospy/Overview/Publishers%20and%20Subscribers for more information.
  pub = rospy.Publisher('Robotiq2FGripperRobotInput', inputMsg.Robotiq2FGripper_robot_input)
Traceback (most recent call last):
  File "/home/xavier/august_demo_ws/src/robot_arm_demo_v2/robotiq/robotiq_2f_gripper_control/nodes/Robotiq2FGripperRtuNode.py", line 89, in <module>
    mainLoop(sys.argv[1])
  File "/home/xavier/august_demo_ws/src/robot_arm_demo_v2/robotiq/robotiq_2f_gripper_control/nodes/Robotiq2FGripperRtuNode.py", line 75, in mainLoop
    status = gripper.getStatus()
  File "/home/xavier/august_demo_ws/src/robot_arm_demo_v2/robotiq/robotiq_2f_gripper_control/src/robotiq_2f_gripper_control/baseRobotiq2FGripper.py", line 107, in getStatus
    status = self.client.getStatus(6);
  File "/home/xavier/august_demo_ws/src/robot_arm_demo_v2/robotiq/robotiq_modbus_rtu/src/robotiq_modbus_rtu/comModbusRtu.py", line 95, in getStatus
       output.append((response.getRegister(i) & 0xFF00) >> 8)
AttributeError: 'ModbusIOException' object has no attribute 'getRegister'

Extra Info:

xavier@xavier-desktop:~$ ls -l /tmp/ttyUR
lrwxrwxrwx 1 xavier xavier 10 May 18 10:44 /tmp/ttyUR -> /dev/pts/0

Asked by fruitbot on 2021-05-18 13:07:39 UTC

Comments

I've experienced similar issues when using a 3F-Gripper from robotiq, but the device wasn't gone for me after the failed startup. In the end, multiple retries eventually made it work, but this is, of course, not a solution. See also this issue

Asked by fexner on 2021-05-19 03:42:04 UTC

Answers

So instead of enabling gripper communication through the UR package, I ended up SSH-ing directly into the UR computer and forwarding the USB port (that connects to the gripper) to my ROS host computer.

From ROS Host:

$ roscore
$ sudo socat pty,link=/dev/ttyTool,raw,ignoreeof,waitslave tcp:<robot-ip>:54321

From UR Computer:

$ socat tcp-l:54321,reuseaddr,fork file:/dev/ttyTool,nonblock,raw,waitlock=/var/run/tty

From Ros Host

$ sudo chmod 777 /dev/ttyTool
$ rosrun robotiq_2f_gripper_control Robotiq2FGripperRtuNode.py /dev/ttyTool
$ rosrun robotiq_2f_gripper_control Robotiq2FGripperSimpleController.py

Additional Notes:

  1. To Access the UR computer ssh root@<robot-ip>. The default UR password is easybot
  2. socat was not installed on the UR computer by default. I had to install it from a .deb file found here
  3. I am not sure if it made a difference, but I deleted the rs-485 URCAP from the touchpad

I am currently rewriting this as a bash script that I can call from a roslaunch file. It isn't the most beautiful solution, but it works :)

I got the socat stuff from this Robotiq DOF thread: https://dof.robotiq.com/discussion/comment/5714#Comment_5714

Asked by fruitbot on 2021-06-09 14:00:24 UTC

Comments

I'm happy for you that it works, but this is basically what ur_robot_driver does. It even uses socat ..

See tool_communication.

Asked by gvdhoorn on 2021-06-09 14:07:36 UTC

If your solution works, but using the tool_communication didn't that's strange, as the driver's tool_communication mechanism uses exactly the same socat commands. we should compare the socat arguments and maybe improve tool_communication from the driver, then. As @gvdhoorn wrote, this is exactly how the driver's tool communication works.

The urcap runs socat using this line

Asked by fexner on 2021-06-10 02:26:07 UTC

@gvdhoorn @fexner Thanks for the feedback. I am not sure what is causing the error in my configuration. I see that many other people have set this up successfully. If I find out what was tripping me up I will update here.

Asked by fruitbot on 2021-06-10 10:55:51 UTC