添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
阳刚的数据线  ·  Device Manager ...·  2 月前    · 
独立的李子  ·  TypeError: must be ...·  2 月前    · 

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]

@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:

xxwang@MS-7A54:~/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!


Hi @jproberge !!!

I tried to do all this stepsm but i was not able to do the step #5. After ssh into ur controller, i received the error message socat command not found. Can you help me please?

My problems starts since i want to connect and control the 2f_85 gripper through my pc ros, and so i connected it directly to the usn port. Then I started the node Robotiq2fGripperRtuNode.py /dev/ttyUSB0 after that i did chmod 777 /dev/ttyUSB0, but i always get the same error: "AttributeError: 'ModbusIOException' object has no attribute 'getRegister'".

Could you please help me to solve this problem?

Best regardsm
Franci