Problem using pip to install RTDE

I am currently trying to install the RTDE python package to communicate with UR10e Cobot, but keep getting errors.

When I type in “pip install --user ur-rtde”, I get errors. I have attached a picture with the error message, as it is too big to fit into a post.

I want to use RTDE to help with received data. I currently have been experimenting with using a socket connection in python and setting digital inputs and outputs. I want to start sending integer variables to the cobot and read received data. I know how to receive data from the cobot using the socket connection, but I don’t understand anything that I receive back from the cobot. It is just a big hex string.

So I have 3 questions:

  1. Is there some pre-requisite that I have to do before I try to install this? Is there another way to install this withou pip?
  2. Does anyone have any information on how to send integer values using python socket library?
  3. Does anyone have any information on how to interpret the data received using the socket.recv(1024) command? The
    received data looks something like

It looks like this particular library requires cmake that is not installed.
There is official RTDE library available on Real-Time Data Exchange (RTDE) Guide - 22229

Hi Sean

Please ask these questions on the issue tracker related to ur_rtde. Regarding your specific question, there is currently an issue with pip installation of ur_rtde on Windows, until I fix this you can try to build it from source.

Same Problem here, didn’t find the solution. Cmake is installed though.

I need to get this working, I already tried it on different systems/OS like Raspberry Pi and Windows 10.
I wasn’t able to build it from source as I didn’t manage to complete the cmake/boost part.

‘the source does not appear to contain CMakeLists.txt’

How did you guys get it running? I would like to use it on Win 10 with Python 3.10
I would love to use an alternative to ur_rtde but couldn’t find one.

I got it to install it in a Linux Subsystem for Windows, so it runs in a Ubuntu terminal, which is not really Windows, so here is what I did:

  1. Enabled WSL from the Control Panel and installed the Ubuntu 20 terminal from Microsoft Store (here’s a tutorial).
  2. Install Python and update/upgrade some packages that I use often.
  3. Install the ur_rtde package following the Quick Install:
sudo add-apt-repository ppa:sdurobotics/ur-rtde
sudo apt-get update
sudo apt install librtde librtde-dev

I use the WSL for other purposes, but I still did steps 1 and 2. I have a Virtual Machine with Ubuntu 20 that I use for the RTDE, but for this post I tried to run the commands from step 3 on the Ubuntu terminal in Windows and it worked, so I hope you can do it too.

The disadvantage from using the WSL is that it still counts as a separate OS, so sharing files can be tricky. On the other hand, since they are both running on the same machine, they both can access and share data through the internal IP address, so you can make server/client functions to send/receive data in separate processes. For example, you can use the terminal to access the RTDE server, get the TCP position from the UR and stream or re-send the data to a data-logger through UDP, TCP, XML-RPC, ROS topics…

In case you like this approach, this is how I work with the WSL:

  1. Installed Visual Code in Windows and added the Python and remote-WSL extensions.
  2. Use Visual Code to edit programs in Python and run them from the Visual Code terminal.

For the RTDE, I follow this tutorial for beginners on how to use UR-RTDE on python. I use the VM, but I see no difference between using Visual Code inside a VM with Ubuntu 20 and using Visual Code with a Ubuntu 20 terminal on Windows.

And how to set up vscode so it’s running/compiling using the linux subsystem? That’s my last step missing. Will try with a VM later as well.

Once you have installed the Ubuntu terminal and the extension on VCode, you’ll see a new option on the left bar, which is for connecting to the WSL. Then VCode will connect to it and re-open from the WSL directory.
Afterwards, you can navigate and edit files located in the Linux subsystem. If you open a terminal, it’ll be a Ubuntu terminal, and you can run Linux commands on it.


EDIT: as a final tip, whenever you want to try a VM, I’d go for the Starter Package, which is a VM from UR that comes already with URSim installed.

Unfortunately it doesn’t find the ur-rtde package, altough it seems to be correctly installed

how did you set up rtde in the ur vm?

We are using this library but there isn’t possibility to read I/O’s in python via rtde. Do you have any recommendation?