Skip to main content

ur5lib

Modular Python library for controlling UR5 robots — supports both a real robot (via RTDE) and a built-in simulator.

Requirements

  • Python >= 3.7
  • numpy
  • ur_rtde (only required when connecting to a real robot)

Installation

Clone the repo and install in editable mode:

git clone <repo-url>
cd ur5lib
pip install -e .

Or install directly:

pip install .

For real robot support, also install the RTDE package:

pip install ur_rtde

Quick Start

Simulator mode

from ur5lib.io.simulator import UR5Sim
from ur5lib.motion.executor import MotionExecutor
from ur5lib.types.common_types import JointAngles, Pose

# Create and connect a simulated robot
robot = UR5Sim()
robot.connect_()

executor = MotionExecutor(robot)

# Move to a joint configuration (angles in radians)
target = JointAngles(joints=[0.1, -0.5, 0.3, -1.2, 1.5, 0.0])
executor.move_to_joint_position(target)

# Move to a Cartesian pose (x, y, z, rx, ry, rz)
pose = Pose(0.4, -0.2, 0.3, 0.0, 3.14, 0.0)
executor.move_to_pose(pose)

Real robot mode (RTDE)

from ur5lib.io.ur_rtde import UR5RTDE
from ur5lib.motion.executor import MotionExecutor
from ur5lib.types.common_types import JointAngles

robot = UR5RTDE(config={"robot_ip": "192.168.0.100"})
robot.connect_()

executor = MotionExecutor(robot)
target = JointAngles(joints=[0.0, -1.57, 1.57, -1.57, -1.57, 0.0])
executor.move_to_joint_position(target)

CLI

After installation, a ur5lib-cli command is available:

# Simulator — move joints to specified angles (radians)
ur5lib-cli --sim --move-joints 0.1 -0.5 0.3 -1.2 1.5 0.0

# Real robot — specify IP and target joint angles
ur5lib-cli --ip 192.168.0.100 --move-joints 0.0 -1.57 1.57 -1.57 -1.57 0.0

Key Types

Type Fields Description
JointAngles joints: List[float] Six joint angles in radians
Pose x, y, z, rx, ry, rz TCP pose in meters / axis-angle rotation

Project Structure

ur5lib/
├── core.py              # Abstract base class UR5Base
├── cli.py               # Command-line interface
├── io/
│   ├── simulator.py     # UR5Sim — software-only simulator
│   └── ur_rtde.py       # UR5RTDE — real robot via RTDE
├── motion/
│   ├── planner.py       # MotionPlanner — joint & Cartesian interpolation
│   └── executor.py      # MotionExecutor — plan + execute moves
├── types/
│   └── common_types.py  # JointAngles, Pose
├── examples/
│   └── demo_joint_motion.py
└── config/
    └── default_config.yaml

Running the Example

python examples/demo_joint_motion.py

Extending the Library

To add a new robot backend, subclass UR5Base and implement the three abstract methods:

from ur5lib.core import UR5Base

class MyRobot(UR5Base):
    def connect_rtde(self): ...
    def get_joint_angles(self): ...
    def get_current_pose(self): ...
    def run_motion(self, motion_plan): ...

Metadata

Release files for ur5lib 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ur5lib 1.0.3
File Size Uploaded Provenance Actions
ur5lib-1.0.3.tar.gz 28.6 kB Without provenance Details for ur5lib-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ur5lib 1.0.3
File Interpreter ABI Platform Actions
ur5lib-1.0.3-py3-none-any.whl Python 3 none any Details for ur5lib-1.0.3-py3-none-any.whl

Total release size: 66.0 kB

Release files / ur5lib-1.0.3.tar.gz

Download URL ur5lib-1.0.3.tar.gz
Size 28.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e57bd6cc6e5badf9e6d5bfc66dc6b57936f5a1e941ee52ad00735962b6b5fbe0
BLAKE2b-256 checksum
How to use checksums
c4e5a88ecddc56b57bab1242b52c648282a32f4da774a065bb9006d1a08f3ef9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release files / ur5lib-1.0.3-py3-none-any.whl

Download URL ur5lib-1.0.3-py3-none-any.whl
Size 37.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7bcc5e027f19f3ff71bebcadae2c74bd3be34911de7f949562b77f95f986bec2
BLAKE2b-256 checksum
How to use checksums
1f32f4599409b344d3be7525f5151d4671ef24a6e60a05dc33a1f622f27ba0a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Security for ur5lib 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page