Open Tonidor opened 2 years ago
Are there any updates? I'm facing a similar issue with the OnRobot RG2-FT gripper. You can find my post in ROS Answers. I'm grateful for any help.
After a long time trying different approaches, we managed to find a solution that works. We switched to using the ur_rtde library which enabled simultaneous remote control of the gripper and the UR5 robot.
Here are some related links:
For us, Option 3 of connecting to the gripper mentioned in the robotiq gripper guide worked. Although what we do different than in the tutorial is to activate the gripper on the UR5 control pad manually and leave out the code line gripper.activate()
. Somehow the script seems to get stuck on this point so we switched to our workaround.
My guess to why the simultaneous control of the gripper and the UR5 robot works with the ur_rtde library is that it implements the Real-Time Data Exchange (RTDE) interface. Probably some of the workings behind this interface differ from our previous approaches but I'm not sure about this in detail.
If this alternative is suitable and works for you too, I would be curious to know. :) Feel free to ask if you have any further questions regarding the topic!
Thanks for your quick reply. So you aren't using the Universal_Robots_ROS2_Driver at all?
Since I would like to use Moveit2 and other ROS2 packages, I could use the Universal_Robots_ROS2_Driver to control the arm and the ur_rtde library to control the gripper and wrap the required code into a ROS node, right?
Yes, we don't use the driver anymore. I'm not sure weather it's possible to use the driver and the ur_rtde library together since I've experienced that the driver stops working when I tried other approaches (like using sockets) to control the gripper simultaneously. I would expect that it doesn't work because the driver kind of "compromises" many (all?) ports on the robot. Although, it would be interesting to know if it works in case of the ur_rtde library. I have no experience with Moveit2 but I would probably try to wrap the ur_rtde library with ROS2 and use it together with Moveit2 rather than mixing control methods (driver + ur_rtde).
Just as a sidenote: This driver implements and uses the RTDE interface.
ur_rtde
seems to have a wrapper for robitiq grippers. As you can see in their gripper example it connects to the modbus port directly. So, you should be able to use this driver and the gripper connection side-by-side.
That's good to know, thanks for the comment!
Hey I just wanted to know if it is possible to use Universal_Robots_ROS2_Driver and the ur_rtde library together. Did anyone try verifying if it works or not. Thanks in advance fir your reply
@anuj018 , @fmauch , Hey, recently i tried to control rg2 gripper with ur_rtde library following https://gitlab.com/sdurobotics/ur_rtde/-/issues/108 and https://sdurobotics.gitlab.io/ur_rtde/examples/examples.html#use-with-custom-script . In this way, i can't use Universal_Robots_ROS2_Driver any more once the ur_rtde is running. I am curious that if you have solved the problem or get more informations? Hope for your reply.
@Abelpy1 No we have not solved the ur-rtde(made by SDU)/ROS conflict. I am not 100% sure, but it is most likely because we both try to control the digital outputs. This is the same reason why the ROS driver and fieldbus's (ProfiNet and EtherNet support) does not work together.
But after I have read this thread again, I thing that there are different other possible workarounds:
Problem
Currently, we are trying to control the Robotiq Gripper which is connected via USB to a UR5 remotely using the Universal_Robots_ROS2_Driver but couldn't manage to do so. Regarding this topic, we would appreciate some instructions.
Setup
PC OS: Ubuntu 20.4 ROS Distribution: Foxy UR model: UR5
What we tried
Apart from using the ROS2 driver, we tried using the URX library. The approach of this library is to connect via a TCP socket on port 30002 and send a URScript that controls the gripper. This was successful. But if we run the ROS2 driver and send a trajectory to the UR5n and start controlling the gripper using the URX library, the driver loses connection. This gets printed in the consol where the driver runs:
In order to make sure, there is nothing else happening in the URX library that distracts the ROS2 driver, we extracted a minimal example in python on how the gripper is controlled:
gripper_control.py
And this is the URScript that is loaded from 'gripper_close.txt' (the code between myProg and end should be indented):
gripper_close.txt
Still with this minimal version, the ROS2 driver loses connection, when we run this example when sending a trajectory through the ros interface.
We haven't tried that yet but we are also thinking about forwarding the port of the grippe (63352), so we can access it remotely.
What we understand so far
There are different ports used for communicating with the UR:
50002: primary interface, remote computer sends URScript to the UR that is interpreted by the URCap, 125Hz 50001: UR requests the the remote computer to send URScript 30003: UR sends the current status of the robot in real-time 30002: secondary interface, remote computer sends URScript that contains commands that are not interfering with commands from the primary interface, 10Hz 54321: port of the tool communication interface for a remote computer to use tools connected to the UR?, not available for the UR5 but for UR5e?
Is this interpretation correct? Is there anything else happening on these ports that is important for our problem?
We searched in the ROS2 driver repository for more clues on why using port 30002 from another program interferes with the ROS2 driver but we couldn't find a clue. Maybe we missed something.
Ideally, we would like to use a controller with a topic where we can publish control messages for the Robotiq gripper. Is this possible or are there any other workarounds to achieve remote control of the gripper?
We would much appreciate some tips and explanations.