How do I use the RTDE with Python?

I have been trying to understand the RTDE, following the guides and example code but I do not understand how to implement the RTDE in such a way that I can read a signal from the UR cobot. I am completely lost.

Hello everyone,

I face a similar situation, but probably we should ask a specific question so that others can help more easily. I’ll give it a shot, maybe it describes your problem as well @ncoope13.

So, with all the example files and a nice youtube playlist explaining their meaning, I still wonder…

  1. which parts of the code I actually need to modify. In my case, I don’t care yet about the exact moves of the robot. My point is just to have SOME data to be read out into a csv file (or anything else), as a proof of concept that I can make RTDE work. All else will follow.
    I know that the IP of the robot must be set in the parameter robot_host in, but I’m not sure what else I need to change. Any idea?

  2. Which of the files will I have to execute to initiate RTDE once all parameters are set, and how? Just run files within the IDE while being connected to the UR?

Sorry for my beginner’s knowledge only (quite new with Python programming, and totally new to UR), and sorry for intervening in your thread @ncoope13, but I guess we are looking for the same kind of answers.

1 Like

I am happy to see that videos I made were useful for some :slight_smile:
After 2 years of working with the UR5e I can tell you the following:

  • if you really need to work in 500HZ then go with RTDE
  • else I recommend to use this code (Bitbucket) I have been using it for a while now, and was able to implement quite sophisticated control methods with success but in slower rate (125HZ)

Try using this script:

All you need to do is to connect your Pc with your cobot via ethernet, change the IP-address in line 38 from the file, it should be the same as the one you gave ur cobot and you need to change the ipv4-address from your ethernet port into an ip-address with the same sub network.