Skip to main content

universal-robots-clients

universal-robots-clients provides small, functional Python clients for Universal Robots controller protocols and URP program catalogues. Each capability is an explicit module, so call sites retain context and applications install only the optional protocol dependencies they use.

Installation

python -m pip install --upgrade pip
python -m pip install universal-robots-clients

Install optional SFTP or RTDE support:

python -m pip install "universal-robots-clients[sftp]"
python -m pip install "universal-robots-clients[rtde]"
python -m pip install "universal-robots-clients[all]"

Python 3.8.3 and later are supported. Upgrade the old pip bundled with Python 3.8.3 before installing optional binary dependencies.

Modules

Module Responsibility Optional dependency
dashboard_client Send Dashboard Server commands and program operations None
urp_discovery_client Select local or SFTP discovery from runtime configuration SFTP when selected
urp_discovery_local_client Discover URP files through a local filesystem None
urp_discovery_sftp_client Discover URP files through caller-owned or managed SFTP Paramiko
rtde_client Read telemetry, control tool I/O, and exchange registers ur-rtde

The package root deliberately re-exports no operations. Importing capability modules keeps ownership visible:

import universal_robots_clients.dashboard_client as dashboard_client

response = dashboard_client.load_and_play_program("192.0.2.10", "Production/PickPart.urp")

Dashboard client

Every Dashboard command uses one short-lived TCP connection. Responses are returned as stripped protocol text because Dashboard success and failure formats vary by command.

import universal_robots_clients.dashboard_client as dashboard_client

dashboard_client.load_program("192.0.2.10", "Main.urp")
dashboard_client.play_program("192.0.2.10")
state = dashboard_client.get_program_state("192.0.2.10")
dashboard_client.pause_program("192.0.2.10")
dashboard_client.stop_program("192.0.2.10")

send_command() remains available for Dashboard operations that do not yet have a named helper.

URP discovery clients

Use the selector when configuration chooses the backend at runtime:

import universal_robots_clients.urp_discovery_client as urp_discovery_client

programs = urp_discovery_client.discover_programs("local", "/programs")

Use a backend directly when it is already known:

import universal_robots_clients.urp_discovery_local_client as urp_discovery_local_client
import universal_robots_clients.urp_discovery_sftp_client as urp_discovery_sftp_client

local_programs = urp_discovery_local_client.discover_programs("/programs")
sftp_programs = urp_discovery_sftp_client.connect_and_discover_programs(
    host="192.0.2.10",
    root="/programs",
    username="root",
    password="secret",
)

Both backends recursively find case-insensitive .urp files, return paths relative to the configured root, normalize separators to /, and sort the result. Advanced callers can pass an existing connected SFTP client to urp_discovery_sftp_client.discover_programs().

RTDE client

The RTDE module wraps the optional ur-rtde receive and I/O interfaces behind a functional API. A Client data class owns the persistent resources; module functions own all behavior.

import universal_robots_clients.rtde_client as rtde_client

client = rtde_client.connect("192.0.2.10")

try:
    pose = rtde_client.read_actual_tcp_pose(client)
    joints = rtde_client.read_actual_joint_positions(client)
    effective_speed = rtde_client.read_speed_scaling(client)

    # ur-rtde represents the speed slider as a fraction: 0.5 means 50%.
    rtde_client.write_speed_slider_fraction(client, 0.5)

    # Tool inputs/outputs 0 and 1 can carry gripper-specific feedback and commands.
    gripper_feedback = rtde_client.read_tool_digital_input(client, 0)
    rtde_client.write_tool_digital_output(client, 0, True)

    rtde_client.write_input_int_register(client, 42, 7)
    rtde_client.write_input_double_register(client, 43, 1.25)
    counter = rtde_client.read_output_int_register(client, 42)
    result = rtde_client.read_output_double_register(client, 43)
finally:
    rtde_client.disconnect(client)

Upper registers 42 through 46 are selected by default for external RTDE clients. Pass use_upper_range_registers=False to select registers 18 through 22. Register allocation, invocation handshakes, and robot-side program conventions remain application policy.

TCP pose is returned as [x, y, z, rx, ry, rz], with translation in metres and the rotation vector in radians. Joint positions are radians, and all vector results are ordinary list[float] values. Tool digital channels are deliberately generic: a gripper's open/closed, object-detected, or fault meaning depends on how that gripper is wired and configured. The read functions expose actual I/O state; write functions request output state and raise if RTDE rejects the write.

Security

  • Dashboard and RTDE connections are unencrypted controller protocols and should be used on a controlled robot network.
  • SFTP loads system host keys and rejects unknown hosts by default.
  • trust_unknown_host_keys=True is an explicit opt-in intended only for controlled environments.
  • Applications own credential storage, authorization, retry, and command-success policy.

Development

From this package directory:

python -m pip install -e ".[dev]"
python -m pytest -m "not system"
python -m mypy
python -m build
python -m twine check dist/*

Unit tests do not require a robot or Docker. They cover protocol framing, validation, lifecycle failures, typed conversion, local filesystem traversal, SFTP traversal, backend selection, and connection configuration with deterministic fakes.

Real system tests

The package owns its protocol-level integration tests as well as its unit tests. On Linux amd64, with Docker running:

python -m pip install -e ".[system-test]"
python -m pytest -m system tests/system

This starts the pinned official universalrobots/ursim_e-series:5.25.2 image and really loads, plays, pauses, and stops no-motion URP programs through the Dashboard Server. A separate RTDE contract opens the native receive and I/O connections and exercises telemetry, speed-slider control, tool I/O, and typed registers. The discovery contract compares the same catalogue through the local filesystem client and a disposable Debian OpenSSH/SFTP container. CI runs all three contracts; the gateway repository keeps only the higher-level cross-package OPC UA workflow.

Release history is recorded in the changelog. The gateway integration and real URSim contract are validated independently in ur_dashboard_to_opcua_gateway.

License

This project is licensed under the MIT License. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

universal_robots_clients-0.3.0.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

universal_robots_clients-0.3.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file universal_robots_clients-0.3.0.tar.gz.

File metadata

  • Download URL: universal_robots_clients-0.3.0.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for universal_robots_clients-0.3.0.tar.gz
Algorithm Hash digest
SHA256 fddf5630421a5f2aa4f39ced828fd0a77d9e38d25c7c9d95306e304f723f52b0
MD5 7f66779b1df7676bfd869075a39a78ec
BLAKE2b-256 62d3e1c2b1d809737117236dd5b0883ba99c359e9869b9b3b01f138a5063550d

See more details on using hashes here.

Provenance

The following attestation bundles were made for universal_robots_clients-0.3.0.tar.gz:

Publisher: release.yml on CraigBuilds/universal-robots-clients

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file universal_robots_clients-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for universal_robots_clients-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b9472cad81de170cf92900f0308145a7675459d3da1b02e4432458d20fc1116
MD5 a20bd71655c2a39e21ddf6434cd9f3b1
BLAKE2b-256 03072c0dcc20c08d7fc9d204c6ec5a05fed403f95eac4c07987732c82b62b63a

See more details on using hashes here.

Provenance

The following attestation bundles were made for universal_robots_clients-0.3.0-py3-none-any.whl:

Publisher: release.yml on CraigBuilds/universal-robots-clients

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.4.0

2 files

This release

0.3.0 This release

2 files

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