Registry / http-networking / ur-rtde

ur-rtde

JSON →
library1.6.3pypypi✓ verified 86d ago

ur-rtde is a Python interface for controlling and receiving data from Universal Robots (UR) manipulators using the Real-Time Data Exchange (RTDE) interface of the robot. It is a C++ library with Python bindings, providing fast and lightweight communication. The current version is 1.6.3, released on March 13, 2026. The library is actively maintained with a somewhat regular, though not strictly fixed, release cadence.

pip install ur-rtde
INSTALL
IMPORT
SIG · UR-RTDE
U
ur-rtde
http-networkingpythonv1.6.3
Install
2.0s avg
Import
Disk
31MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.6.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 1.83s
py 3.11
✕ build_error
✓ 1.88s
py 3.12
✕ build_error
✓ 1.65s
py 3.13
✕ build_error
✕ build_error
py 3.9
✕ build_error
✓ 2.53s
31MB installed
● package 31MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RTDEControlInterface
from rtde_control import RTDEControlInterface
RTDEReceiveInterface
from rtde_receive import RTDEReceiveInterface
RTDEIOInterface
from rtde_io import RTDEIOInterface

This quickstart demonstrates how to connect to a Universal Robot using the RTDE Receive and Control interfaces, retrieve current joint positions, and prepare for sending commands. Ensure your robot's IP address is correct and the 'External Control' URCap is running on the robot controller for control commands. The commented-out sections show examples of moving the robot and controlling I/O. **Always ensure robot movements are safe before execution.**

import rtde_control import rtde_receive import rtde_io import time # Replace with your robot's IP address ROBOT_IP = os.environ.get('UR_ROBOT_IP', '192.168.1.10') try: # Initialize RTDE interfaces rtde_r = rtde_receive.RTDEReceiveInterface(ROBOT_IP) rtde_c = rtde_control.RTDEControlInterface(ROBOT_IP) rtde_io_ = rtde_io.RTDEIOInterface(ROBOT_IP) if not rtde_r.isConnected(): print(f"Could not connect to RTDE Receive interface at {ROBOT_IP}") exit() if not rtde_c.isConnected(): print(f"Could not connect to RTDE Control interface at {ROBOT_IP}") exit() print("Successfully connected to the robot.") # Start synchronization rtde_r.startFileSynchronization("") # No recipe file for quickstart, use default rtde_c.sendStart() # Example: Read a robot state (joint positions) print(f"Current Joint Positions: {rtde_r.getActualQ()}") # Example: Send a simple move command (blocking) # NOTE: Ensure the robot is in 'Remote Control' mode and 'External Control' URCap is running on the robot. # This example assumes the robot is ready to receive commands. # Make sure this move is safe for your robot setup. # target_q = [-1.5, -1.8, 1.8, -1.8, -1.5, 0.0] # Example joint configuration in radians # if rtde_c.moveJ(target_q, 0.5, 0.3): # speed, acceleration # print("Robot moved to target joint configuration.") # else: # print("Failed to move robot.") # Example: Set a digital output # rtde_io_.setStandardDigitalOut(0, True) # print("Set digital output 0 to True") # time.sleep(1) # rtde_io_.setStandardDigitalOut(0, False) # print("Set digital output 0 to False") finally: # Stop RTDE communication and disconnect if 'rtde_c' in locals() and rtde_c.isConnected(): rtde_c.sendPause() rtde_c.disconnect() print("Disconnected RTDE Control Interface.") if 'rtde_r' in locals() and rtde_r.isConnected(): rtde_r.disconnect() print("Disconnected RTDE Receive Interface.")
Debug
Known issues
breakingThe RTDE protocol may be updated by Universal Robots. New UR software versions can introduce protocol changes, potentially leading to incompatibility with older `ur-rtde` versions or requiring clients to explicitly request compatible protocol versions.
fix
Always check the `ur-rtde` documentation for compatibility with your robot's PolyScope software version. Update `ur-rtde` to the latest version. Monitor Universal Robots' official communication for RTDE protocol updates.
affects: All versions, depending on robot PolyScope software version.
gotchaThe `RTDEControlInterface` is explicitly stated as *not thread-safe*. Concurrent calls from multiple threads without proper synchronization can lead to unpredictable behavior, including connection issues or robot control errors.
fix
Implement external synchronization mechanisms (e.g., mutexes, locks) if using `RTDEControlInterface` in a multi-threaded application to ensure only one thread accesses it at a time.
affects: All versions.
gotchaFor precise and safe real-time control, particularly under high system load, `ur-rtde` highly recommends running on an operating system with a real-time kernel.
fix
For Linux, install and enable a real-time kernel (e.g., `PREEMPT_RT`). Follow OS-specific guides for real-time setup to improve performance and stability.
affects: All versions.
gotchaInstallation via `pip` can fail if your `pip` version is older than 19.3.
fix
Upgrade your pip version before installing `ur-rtde`: `pip install --upgrade pip`.
affects: < 1.6.3, but generally good practice to have a recent pip.
gotchaIncorrect network configuration (e.g., robot and PC not in the same IP subnet, active firewalls) is a frequent cause of connection failures.
fix
Ensure the robot controller and the computer running `ur-rtde` are on the same IP subnet with compatible IP addresses. Disable firewalls temporarily for testing, then configure rules to allow communication on necessary ports (e.g., 30004, 30001, 50002).
affects: All versions.
Errors
Common errors & fixes
RTDEControlInterface: Could not receive data from robot... read: End of file / RTDEControlInterface: Lost connection to robot... write: Broken pipe / Segmentation fault (core dumped)
Loss of network connection, underlying C++ library issues, or an unexpected state on the robot controller.
fix
Check network cable and connections. Verify the robot's IP and network settings. Ensure no other applications are interfering with the RTDE ports. Restart the robot controller and your Python script. Consider running on a real-time OS.
RTDEControlInterface: RTDE control script is not running!
The external control script required by the RTDEControlInterface is not active on the Universal Robot controller. This often happens after a connection drop and subsequent reconnection attempt.
fix
Manually start or ensure the 'External Control' URCap (or equivalent PolyScope program) is running on the robot controller. Some `ur-rtde` functions automatically upload and start this script, but a manual check might be necessary after disconnections.
RuntimeError: One of the RTDE input registers are already in use!
Attempting to write to an RTDE input register that is already being controlled by another RTDE client or a URCap on the robot.
fix
Ensure only one client is configured to control a specific input register at a time. Review all running programs on the robot and any other connected RTDE clients.
Unpredictable Analog Output Voltage / Cannot read Digital Input (values are incorrect or always 0)
Misunderstanding the scaling or behavior of analog/digital I/O functions, or potential library-specific quirks in certain versions.
fix
Consult the specific `ur-rtde` version's API documentation and examples for I/O handling. Verify the robot's I/O configuration in PolyScope. Test with simpler, known-good I/O examples if available.
Upgrade
Version history
1.6.3latest on PyPI · released Mar 13, 2026
Audit
Dependencies
librtderequiredThe Python interface is built on C++ bindings; the underlying C++ library is required for full functionality and often for development, though `pip install ur-rtde` typically handles this for Python users.
Agent activity
26 hits · last 30 days
node
24
OpenAI (training)
1
Resources
ur-rtde — pip install ur-rtde · libregistry