Connection to Robot keeps breaking unexpectedly
Hi there. I'm using a pair of UR robots for my thesis, (a UR3 and a UR3e), and I'm having issues with the UR3e. I'm using the robots to take measurements from different locations on the surface of materials. I'm using python to connect to the robots and control them using MoveL. However, occasionally, and seemingly randomly, the connection to the UR3e will break somehow, without throwing any actionable errors.
The following are symptoms of the issue that I have experienced:
-
Occasionally a
read: End of file
will appear in the terminal, which often coincides with the robot doing skipping movements, or seemingly offsetting its position from what is intended. -
Sometimes the connection will break with:
RTDEControlInterface: Could not receive data from robot...
read: End of file
RTDEControlInterface: Robot is disconnected, reconnecting...
RTDEControlInterface: Successfully reconnected!
after which it will throw RTDEControlInterface: RTDE control script is not running!
almost every time a command is sent to that robot, but not every time - about one in ten commands will work as intended, while the others throw that error.
- I've received this output:
RTDEControlInterface: Lost connection to robot...
write: Broken pipe
RTDEControlInterface: Robot is disconnected, reconnecting...
Which just hangs, never doing anything. I've also noticed that this locks up the UR Teach pendant, causing the interface to become unresponsive. My guess is that there's a near infinite loop somewhere blocking the ui.
- Sometimes it will just crash my program outright with:
RTDEControlInterface: Lost connection to robot...
write: Broken pipe
RTDEControlInterface: Robot is disconnected, reconnecting...
Segmentation fault (core dumped)
As far as I can tell, my code is working fine, because I've had no issues with the UR3, it's just the UR3e that's having the issues.
Here's a cut down version of the only place where I actually use the robot in my code. I check if the controller is connected before every single move to try to make sure it will work, but seeing as I never see anything printed, it seems like the controller is always connected until everything breaks.
def Move(self, x, y, z):
rotation = self.rot
if not self.controller.isConnected():
print("Trying to reestablish robot connection")
self.controller.disconnect()
self.controller.reconnect()
self.controller.moveL([x, y, z, rotation[0], rotation[1], rotation[2]], 0.5, 0.5)
I'm running ur-rtde v1.4.1 with python 3.8.5 on ubuntu 20.04 under WSL on windows 10.
I can't make sense of this, do you have any suggestions?