Home Integration

Discussion

Left ArrowBack to discussions page
AbduAbdu Posts: 2 Recruit
Hello
I wonder if its possible to use ros-driver to control Robotiq 2-F-85 gripper mounted on UR5 CB3 (polyscope 3.10) and connected it thru wrist connector of UR5 ?. I have checked the ros-industrial/robotiq and I found that the gripper has to be connected thru usb.

Any help please?

Comments

  • jprobergejproberge Tactile Sensor Beta Testers Posts: 41 Crew
    Hello @Abdu ,

    Thanks for reaching out to us! Indeed, for CB3 UR5, Robotiq currently only officially supports using ROS with the gripper directly connected to the ROS machine. In fact, if you connect the gripper to the wrist, it becomes a serial device connected to the UR5 controller, hence not directly accessible from your ROS machine anymore. 

    However, to be honest with you, your question coincidentally occurs at the same time I'm actually trying to help another customer trying to do the exact same thing as you. I cannot give any guarantee right now that this will work (or be easy) since it's the first time I'm trying to solve this, but I feel what you are trying to do should be feasible using socat relays.  if you are willing to give this a try, you could start by trying the following:

    1. Run the socat command (sudo socat pty,link=/dev/ttyUSB0,raw,ignoreeof,waitslave tcp:<robot-ip>:54321) on your ROS machine and confirm that you have /dev/ttyUSB0 device afterwards. Also, make sure to replace <robot-ip> with the true IP address of your robot.
    2. Still on your ROS machine, run: "chmod 777 /dev/ttyUSB0" to provide the symbolic link read and write permissions
    3. Then, ssh into the ur controller (with username=root and password=easybot) and confirm there is a /dev/ttyUSB0 device there too.
    4. Still on the UR Robot, give read and write permissions to the device for everybody: sudo chmod 777 /dev/ttyUSB0
    5. Then run the following socat command meant specifically for the ur: socat tcp-l:54321,reuseaddr,fork file:/dev/ttyUSB0,nonblock,raw,waitlock=/var/run/tty
    6. Then, back on your ROS machine: rosrun robotiq_2f_gripper_control Robotiq2FGripperRtuNode.py /dev/ttyUSB0 which hopefully will run with no errors (only a warning). You should now also see the gripper's led color switch from red to blue.
    7. On your ROS machine, you can now try running the simple controller script: rosrun robotiq_2f_gripper_control Robotiq2FGripperSimpleController.py to interact with the gripper.

    This method is very much inspired from how peripheral forwarding works on eseries UR robot. Basically, what this does is the redirection of everything Robotiq2FGripperRtuNode.py was trying to send to /dev/ttyUSB0 directly to your robot, using its IP address and a free arbitrary port (54321). Then, on the robot side, everything your robot will receive on port 54321 will be redirected to /dev/ttyUSB0, which should be your physical device. Please note that you should make sure both socat commands run at the same time on both ends (your computer & the UR controller). Make sure /dev/ttyUSB0 exists on both ends too. Additionally, for debug purposes and/or to make sure everything is alright, you could ssh in the robot, run its associated socat command (see step #5 above) and then check the output of:

    sudo netstat -tulpn | grep LISTEN | grep 54321

    This command should output only one line, confirming that the port "54321" is indeed opened and listening. If you are able to see the gripper's led switching from red to blue at step #6 above, this is a very good sign (i.e. communication is working). However, chances are you could still suffer from latency issues afterwards too. If you reach that point however, I will most likely be able to provide a patch for you to make it work. 

    I know this is a lot of information and I would still recommend to connect your gripper directly to your ROS machine if possible. Doing so, you will most probably avoid a lot of potential troubles. However, if it is impossible for you to do so, I'll be happy to assist you the best I can, however without any guarantee unfortunately I'm afraid.

    Please don't hesitate to write back to me, should you have any other questions or concerns.

    Best regards,

    Jean-Philippe Roberge,
    ROS Package Developper / Maintainer
    [email protected]
  • xxwangxxwang Unconfirmed Posts: 1 Recruit
    @jproberge I sucessfully ran `Robotiq2FGripperRtuNode.py` and `Robotiq2FGripperSimpleController.py` following your instructions which is extremely detailed, thanks so much!!  I'm using a AUBO i5 robot instead UR robot. At first `rosrun robotiq_2f_gripper_control Robotiq2FGripperRtuNode.py /dev/ttyUSB0` gave me an Attribute Error:

    [email protected]:~/ROS_Workspaces/ros_k4a_auboi5_ws$ rosrun robotiq_2f_gripper_control Robotiq2FGripperRtuNode.py /dev/ttyUSB0

    Traceback (most recent call last):

      File "/home/xxwang/ROS_Workspaces/ros_k4a_auboi5_ws/src/robotiq/robotiq_2f_gripper_control/nodes/Robotiq2FGripperRtuNode.py", line 89, in <module>

        mainLoop(sys.argv[1])

      File "/home/xxwang/ROS_Workspaces/ros_k4a_auboi5_ws/src/robotiq/robotiq_2f_gripper_control/nodes/Robotiq2FGripperRtuNode.py", line 75, in mainLoop

        status = gripper.getStatus()

      File "/home/xxwang/ROS_Workspaces/ros_k4a_auboi5_ws/src/robotiq/robotiq_2f_gripper_control/src/robotiq_2f_gripper_control/baseRobotiq2FGripper.py", line 107, in getStatus

        status = self.client.getStatus(6);

      File "/home/xxwang/ROS_Workspaces/ros_k4a_auboi5_ws/src/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'

    Then I found I'm not the only one running into this trouble, plenty of users reported the same or similar issues on github, and I found no general solution to this. I reckoned then this `getRegister` error is quite obscure, and it can be due to a bunch of more specific errors. I tried every method [previously mentioned](https://github.com/ros-industrial/robotiq/issues/167) but none did resolve this issue. I finally found the true error for me is that the gripper not being 'connected' with the AUBO Robot (controller) —— 'connect' button inside gripper plugin must be pressed on Robot teach pendant before running `Robotiq2FGripperRtuNode.py`.

    Above is my feedback and a little supplementary, and thank you for your suggestions!

Sign In or Register to comment.
Left ArrowBack to discussions page