Chapter 2: Installation and Connection Setup
About This Chapter
This chapter describes how to connect a PC to a UR robot and configure the system so that Python can communicate with the robot.
After completing this chapter, you should be able to:
Communicate with the robot
Configure Remote Control
Verify connectivity from Python
2.1 System Configuration
This documentation combines Universal Robots’ official communication interfaces with the third-party open-source SDU Robotics ur_rtde library. The assumed configuration is:
+--------------------+
| Python PC |
| |
| ur_ctrl.py |
| ur_rtde |
+---------+----------+
|
Ethernet
|
+---------+----------+
| UR Robot |
| |
| Control Box |
| Teach Pendant |
+--------------------+
Connect the PC and robot with an Ethernet cable. A network switch may also be used.
2.2 Required Software
Python 3.10 or later is recommended.
For PC-side motion control, state acquisition, and I/O, this documentation uses SDU Robotics ur_rtde. Although it is not an official Universal Robots SDK, it communicates using the official Universal Robots RTDE protocol.
Install the required library:
pip install ur_rtde
The following interfaces are used:
RTDEControlInterfaceRTDEReceiveInterfaceRTDEIOInterface
2.3 Installation by Operating System
Windows
Installation is generally straightforward:
pip install ur_rtde
The Visual C++ Runtime may be required.
Ubuntu
On Ubuntu, dependencies such as Boost may be necessary. For example:
sudo apt install \
build-essential \
cmake \
libboost-all-dev
Then run:
pip install ur_rtde
macOS
Use Homebrew:
brew install cmake
brew install boost
If necessary, configure the environment:
export PATH=/opt/homebrew/bin:$PATH
Depending on the environment, a source build may be required. Note that library paths differ between Intel Macs and Apple Silicon Macs.
2.4 Robot IP Address
On the Teach Pendant, open:
Settings
↓
System
↓
Network
Check the IP address, for example:
192.168.0.10
Configure the PC on the same subnet. For example:
Robot
192.168.0.10
PC
192.168.0.100
The subnet mask is usually:
255.255.255.0
2.5 Verifying Network Connectivity
First, verify that the robot responds to ping.
Linux/macOS:
ping 192.168.0.10
Windows:
ping 192.168.0.10
If a response is received, basic network connectivity is working.
2.6 What Is Remote Control?
To send motion commands from Python, Remote Control must be enabled.
If it is not enabled, the following error may occur:
Please enable remote control on the robot!
This is one of the most common errors returned by ur_rtde.
2.7 Enabling Remote Control
On e-Series robots, enable Remote Control under:
Settings
↓
System
↓
Remote Control
Then switch the robot to Remote Mode. External control is unavailable in Local Mode.
2.8 Remote Mode
The upper-right corner of the Teach Pendant displays either:
Local
or:
Remote
For Python-based control, it must display:
Remote
2.9 Connecting from Python
A minimal example is:
from rtde_control import RTDEControlInterface
ROBOT_IP = "192.168.0.10"
rtde = RTDEControlInterface(ROBOT_IP)
print("Connected")
If no exception occurs, the connection has succeeded.
2.10 Receive Interface
Robot state is obtained through a separate interface:
from rtde_receive import RTDEReceiveInterface
rtde_r = RTDEReceiveInterface(ROBOT_IP)
print(rtde_r.getActualQ())
If joint angles are returned, the interface is working.
2.11 IO Interface
Use the following interface to control digital I/O:
from rtde_io import RTDEIOInterface
rtde_io = RTDEIOInterface(ROBOT_IP)
2.12 Common Errors
Please enable remote control on the robot!
Remote Control is disabled.
Connection refused
The IP address is incorrect, or the network configuration does not match.
Robot is not running
The robot is not powered on or running. This may also occur when Emergency Stop is active.
Protective Stop
A safety stop is active. Clear it using the Teach Pendant. If necessary, execute Unlock Protective Stop through the Dashboard Server.
2.13 Connection Checklist
If the connection fails, check the following:
[ ] Ethernet cable
[ ] Ping response
[ ] IP address
[ ] Firewall
[ ] Remote Control
[ ] Remote Mode
[ ] Robot Power ON
[ ] Brake Release completed
[ ] Emergency Stop cleared
[ ] Protective Stop cleared
Checking these items in order helps isolate many common problems.
Next Chapter
The next chapter explains the following in detail:
How RTDE works
RTDEControl
RTDEReceive
RTDEIO