I’m currently trying to simulate the script on the simulator on the VM that I downloaded from universal-robots.com.
When I run the example script from PyCharm, I get the following error:
Traceback (most recent call last):
File “E:\Universal Robots\Universal Robots\RTDE_Python_Client_Library-main\examples\example_control_loop.py”, line 50, in
con.connect()
File “E:\Universal Robots\Universal Robots\RTDE_Python_Client_Library-main\rtde\rtde.py”, line 98, in connect
self.__sock.connect((self.hostname, self.port))
TimeoutError: timed out
Any idea what could be causing this error and how I could fix it? Sorry to bother you for such silly errors, I just started using these robots at the company I work for.
Looks like the connection is just timing out, probably meaning you have an IP address or port wrong. Make sure whatever IP you have in your python script matches what’s on the simulated robot. I would think “localhost” would suffice though.
Unless you assign it differently somewhere else (or I’m looking at it wrong) the error is being thrown from the call to .connect() and you’re passing self.hostname and self.port to the function. But there you show you’re assigning these values to different variable names (ROBOT_HOST and ROBOT_PORT respectively). Maybe you just need to change the name of the argument you’re passing to the connect() function?
Could easily be a VM configuration issue too. I suffer from those A LOT. Whether the VM is sharing my host’s IP address or not, yadda yadda. Definitely still sounds like you’re dealing with more “basic” networking issues as opposed to anything code-writing wise. You’re on the right track though. I wouldn’t worry about your python code until you can ping the robot from your PC