# Universal Robots RTDE C++/Python Interface

**URL:** https://forum.universal-robots.com/t/universal-robots-rtde-c-python-interface/4228
**Category:** Robot Communication
**Created:** [May 5, 2019, 11:55am UTC](https://forum.universal-robots.com/t/universal-robots-rtde-c-python-interface/4228 "2019-05-05T11:55:56Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![anpl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/anpl/32/4494_2.png) [@anpl](https://forum.universal-robots.com/u/anpl)
#### Post date: [May 5, 2019, 11:55am UTC](https://forum.universal-robots.com/t/universal-robots-rtde-c-python-interface/4228/1 "2019-05-05T11:55:56Z")

</div>

### ur\_rtde

A C++ interface that uses the [Real-Time Data Exchange (RTDE)](https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/real-time-data-exchange-rtde-guide-22229/) interface of the robot for sending and receiving data. The interface can also by used with python, through the provided python bindings.

### Motivation

No widely available C++ interface that utilizes the RTDE of the UR’s exists or have been made public yet. Most of the available ROS interfaces lacks a lot of features or are very restricted in terms of control and has poor support for the new e-Series. This interface is meant to be usable with various robot frameworks, which is why the receive and control interface relies only on STL datatypes. One can choose to convert to STL types or simply rewrite the control and receive interfaces to the desired datatypes to avoid any overhead. The interface aims to make all the functions on the controller available externally in C++ and Python with bindings. Finally the plan is to make a more complete ROS1/ROS2 interface based on this project. However, I am aware of the effort towards making a new ROS interface mentioned [here](https://static1.squarespace.com/static/51df34b1e4b08840dcfd2841/t/5c4090b470a6adde64a153c2/1547735256433/2018.12.12_Anders_Billesoe_Beck.pdf) and perhaps this project could serve as an inspiration.

You can find project here: [SDU Robotics / ur\_rtde · GitLab](https://gitlab.com/sdurobotics/ur_rtde)

Documentation with examples and API resides at:  
[Universal Robots RTDE C++ Interface — ur\_rtde 1.6.2 documentation](https://sdurobotics.gitlab.io/ur_rtde/).

Let me know what you think and feel free to contribute!

---

<div class="post-metadata">

### Author: ![inu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/inu/32/732_2.png) [@inu](https://forum.universal-robots.com/u/inu)
#### Post date: [May 5, 2019, 2:03pm UTC](https://forum.universal-robots.com/t/universal-robots-rtde-c-python-interface/4228/2 "2019-05-05T14:03:08Z")

</div>

Thanks for sharing! Sounds like a useful tool, I’m looking forward to checking it out!

---

<div class="post-metadata">

### Author: ![slon](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@slon](https://forum.universal-robots.com/u/slon)
#### Post date: [April 30, 2021, 12:01pm UTC](https://forum.universal-robots.com/t/universal-robots-rtde-c-python-interface/4228/3 "2021-04-30T12:01:09Z")

</div>

Hello, every example file includes rtde\_export header but its not anywhere - where do I get it?

---

<div class="post-metadata">

### Author: ![anpl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/anpl/32/4494_2.png) [@anpl](https://forum.universal-robots.com/u/anpl)
#### Post date: [May 3, 2021, 11:45am UTC](https://forum.universal-robots.com/t/universal-robots-rtde-c-python-interface/4228/4 "2021-05-03T11:45:32Z")

</div>

Hi Peter

Please post issues specifically related to ur\_rtde on the issues page of ur\_rtde [here](https://gitlab.com/sdurobotics/ur_rtde/-/issues) then its easier for me to help you. With that being said, the rtde\_export header is generated by CMake, when you compile the project. Did you follow the instructions given in the [documentation](https://sdurobotics.gitlab.io/ur_rtde/)?

Best regards  
Anders

---

<div class="post-metadata">

### Author: ![anon62377786](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@anon62377786](https://forum.universal-robots.com/u/anon62377786)
#### Post date: [December 9, 2021, 6:04am UTC](https://forum.universal-robots.com/t/universal-robots-rtde-c-python-interface/4228/5 "2021-12-09T06:04:31Z")

</div>

Hello, I try to use ur\_ Does rtde need to install any ur cap on the teaching pendant to control the ur5e robot?

---

<div class="post-metadata">

### Author: ![anon62377786](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@anon62377786](https://forum.universal-robots.com/u/anon62377786)
#### Post date: [December 9, 2021, 6:09am UTC](https://forum.universal-robots.com/t/universal-robots-rtde-c-python-interface/4228/6 "2021-12-09T06:09:53Z")

</div>

import rtde\_control  
import rtde\_receive  
import time  
rtde\_c = rtde\_control.RTDEControlInterface(“172.16.17.6”)  
rtde\_c.moveL([-0.143, -0.435, 0.20, 0, 2.22, -2.22], 0.5, 0.3)

error： rtde\_c = rtde\_control.RTDEControlInterface(“172.16.17.6”)  
RuntimeError: ur\_rtde: Please enable remote control on the robot!

---

<div class="post-metadata">

### Author: ![anon69570378](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@anon69570378](https://forum.universal-robots.com/u/anon69570378)
#### Post date: [September 14, 2022, 7:53am UTC](https://forum.universal-robots.com/t/universal-robots-rtde-c-python-interface/4228/7 "2022-09-14T07:53:51Z")

</div>

Hello, I tried one of the examples with ur\_rtde interface in python using virtual machine and it worked, but i wanted to know is it possible to get the robot’s position in real time as I want to use it with reinforcement learning.

As I went through documentation I did not see many commands. Is it possible with the interface to get tcp position in real time or after its finished moving??

---

<div class="post-metadata">

### Author: ![anpl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/anpl/32/4494_2.png) [@anpl](https://forum.universal-robots.com/u/anpl)
#### Post date: [September 16, 2022, 10:55am UTC](https://forum.universal-robots.com/t/universal-robots-rtde-c-python-interface/4228/8 "2022-09-16T10:55:17Z")

</div>

Hi Adarsh

You can get the robot position or pose in real-time through the RTDEReceiveInterface with the function [getActualTCPPose()](https://sdurobotics.gitlab.io/ur_rtde/api/api.html?highlight=getactualtcp#_CPPv4N7ur_rtde20RTDEReceiveInterface16getActualTCPPoseEv)

---

<div class="post-metadata">

### Author: ![anon17324251](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anon17324251](https://forum.universal-robots.com/u/anon17324251)
#### Post date: [December 23, 2022, 12:20pm UTC](https://forum.universal-robots.com/t/universal-robots-rtde-c-python-interface/4228/9 "2022-12-23T12:20:20Z")

</div>

Hello,  
I am trying build a DLL out of this library so that it can be used in LabVIEW, but for that all the header files are needed and I have found all of them except one which is “rtde\_export.h” please can you help me by sharing this file or letting me know where I can find this header file?

---

<div class="post-metadata">

### Author: ![bedwards](https://avatars.discourse-cdn.com/v4/letter/b/e19b73/32.png) [@bedwards](https://forum.universal-robots.com/u/bedwards)
#### Post date: [December 28, 2022, 2:13pm UTC](https://forum.universal-robots.com/t/universal-robots-rtde-c-python-interface/4228/10 "2022-12-28T14:13:38Z")

</div>

To get “rtde\_export.h”, you’ll need to build the project using CMake. This part of the ur\_rtde [documentation](https://sdurobotics.gitlab.io/ur_rtde/installation/installation.html#build) should help guide you in the right direction.

---

<div class="post-metadata">

### Author: ![anon17324251](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anon17324251](https://forum.universal-robots.com/u/anon17324251)
#### Post date: [December 30, 2022, 5:25am UTC](https://forum.universal-robots.com/t/universal-robots-rtde-c-python-interface/4228/11 "2022-12-30T05:25:16Z")

</div>

This project can be built in the windows OS as well, right?
