Skip to content

Commit 1357c33

Browse files
committed
bump version to 0.3.11
1 parent 6da8404 commit 1357c33

5 files changed

Lines changed: 41 additions & 17 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.3.11] — 2026-07-10
9+
10+
### Fixed
11+
- Always stop running program via Dashboard before RTDE connect (was: only after boot) — handles crashed sessions leaving ExternalControl running
12+
- RTDE connection retries (2×5s) with clear error message pointing to controller reboot when registers are locked
13+
- CLI no longer shows misleading "Remote Control not enabled" hint when the real issue is locked RTDE registers
14+
815
## [0.3.10] — 2026-07-10
916

1017
### Fixed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "urkit"
7-
version = "0.3.10"
7+
version = "0.3.11"
88
description = "Universal Robots e-Series control toolkit built on ur_rtde"
99
readme = "README.md"
1010
license = {text = "MIT"}

src/urkit/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
from __future__ import annotations
2626

27-
__version__ = "0.3.10"
27+
__version__ = "0.3.11"
2828

2929
from urkit.config import load_config, resolve_config
3030
from urkit.exceptions import (

src/urkit/cli/teach.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ def teach_command(args) -> None:
14451445
print(" Gripper activated.", flush=True)
14461446
except ConnectionError as e:
14471447
print(f"Connection error: {e}")
1448-
if "RTDE" in str(e):
1448+
if "RTDE" in str(e) and "registers are locked" not in str(e):
14491449
print(
14501450
"\n The robot is reachable but RTDE could not connect.\n"
14511451
" This usually means Remote Control is not enabled.\n"

src/urkit/robot.py

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -176,28 +176,45 @@ def __init__(
176176
time.sleep(5)
177177

178178
# Stop any running program — RTDE cannot upload its control script
179-
# while a program is occupying the Secondary Interface. Only needed
180-
# after a boot (a program left running by another client is their problem).
181-
if boot_needed:
182-
try:
183-
self._stop_program()
184-
time.sleep(2)
185-
except ConnectionError:
186-
logger.warning(
187-
"[URRobot] Could not stop program via Dashboard. "
188-
"Continuing — RTDE connection may fail if a program is running."
189-
)
179+
# while a program occupies the Secondary Interface. Always try, since
180+
# a previous session may have left ExternalControl running.
181+
try:
182+
self._stop_program()
183+
time.sleep(2)
184+
except ConnectionError:
185+
logger.warning(
186+
"[URRobot] Could not stop program via Dashboard. "
187+
"Continuing — RTDE connection may fail if a program is running."
188+
)
190189

191-
# Connect RTDE — retry after boot, the Secondary Interface may need
192-
# extra time to accept connections even after the robot is IDLE.
193-
rtde_attempts = 2 if boot_needed else 1
190+
# Connect RTDE — retry, the Secondary Interface may need time to
191+
# release registers after program stop or boot.
192+
from urkit.exceptions import RtdeRegisterConflictError
193+
194+
rtde_attempts = 2
194195
for attempt in range(1, rtde_attempts + 1):
195196
try:
196197
self._rtde_c, self._rtde_r, self._rtde_io = _connect_rtde(
197198
ip,
198199
frequency=self._rtde_frequency,
199200
)
200201
break
202+
except RtdeRegisterConflictError as e:
203+
if attempt < rtde_attempts:
204+
logger.warning(
205+
"[URRobot] RTDE registers in use (attempt %d/%d). "
206+
"Retrying in 5s...",
207+
attempt,
208+
rtde_attempts,
209+
)
210+
time.sleep(5)
211+
else:
212+
raise ConnectionError(
213+
f"RTDE registers are locked on robot at {ip}. "
214+
"A previous session crashed without releasing its connection.\n"
215+
"Fix: fully shut down the robot controller "
216+
"(Settings → System → Shutdown), wait 10s, power on."
217+
) from e
201218
except Exception as e:
202219
if attempt < rtde_attempts:
203220
logger.warning(

0 commit comments

Comments
 (0)