urkit 0.3.9__tar.gz → 0.3.11__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. {urkit-0.3.9 → urkit-0.3.11}/PKG-INFO +5 -5
  2. {urkit-0.3.9 → urkit-0.3.11}/pyproject.toml +5 -5
  3. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/__init__.py +1 -1
  4. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/cli/teach.py +1 -1
  5. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/robot.py +48 -15
  6. {urkit-0.3.9 → urkit-0.3.11}/src/urkit.egg-info/PKG-INFO +5 -5
  7. urkit-0.3.11/src/urkit.egg-info/requires.txt +4 -0
  8. urkit-0.3.9/src/urkit.egg-info/requires.txt +0 -4
  9. {urkit-0.3.9 → urkit-0.3.11}/README.md +0 -0
  10. {urkit-0.3.9 → urkit-0.3.11}/setup.cfg +0 -0
  11. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/__main__.py +0 -0
  12. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/cli/__init__.py +0 -0
  13. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/cli/colors.py +0 -0
  14. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/cli/connection_monitor.py +0 -0
  15. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/cli/points.py +0 -0
  16. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/config.py +0 -0
  17. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/connection.py +0 -0
  18. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/exceptions.py +0 -0
  19. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/geometry.py +0 -0
  20. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/gripper/__init__.py +0 -0
  21. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/gripper/base.py +0 -0
  22. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/gripper/digital.py +0 -0
  23. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/gripper/presets.py +0 -0
  24. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/gripper/robotiq.py +0 -0
  25. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/gripper/robotiq_preamble.py +0 -0
  26. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/io.py +0 -0
  27. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/motion.py +0 -0
  28. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/points.py +0 -0
  29. {urkit-0.3.9 → urkit-0.3.11}/src/urkit/telemetry.py +0 -0
  30. {urkit-0.3.9 → urkit-0.3.11}/src/urkit.egg-info/SOURCES.txt +0 -0
  31. {urkit-0.3.9 → urkit-0.3.11}/src/urkit.egg-info/dependency_links.txt +0 -0
  32. {urkit-0.3.9 → urkit-0.3.11}/src/urkit.egg-info/entry_points.txt +0 -0
  33. {urkit-0.3.9 → urkit-0.3.11}/src/urkit.egg-info/top_level.txt +0 -0
  34. {urkit-0.3.9 → urkit-0.3.11}/tests/test_exceptions.py +0 -0
  35. {urkit-0.3.9 → urkit-0.3.11}/tests/test_geometry.py +0 -0
  36. {urkit-0.3.9 → urkit-0.3.11}/tests/test_gripper.py +0 -0
  37. {urkit-0.3.9 → urkit-0.3.11}/tests/test_gripper_factory.py +0 -0
  38. {urkit-0.3.9 → urkit-0.3.11}/tests/test_gripper_presets.py +0 -0
  39. {urkit-0.3.9 → urkit-0.3.11}/tests/test_points.py +0 -0
  40. {urkit-0.3.9 → urkit-0.3.11}/tests/test_robot_integration.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: urkit
3
- Version: 0.3.9
3
+ Version: 0.3.11
4
4
  Summary: Universal Robots e-Series control toolkit built on ur_rtde
5
5
  Author: URKit Contributors
6
6
  License: MIT
@@ -17,12 +17,12 @@ Classifier: Programming Language :: Python :: 3.11
17
17
  Classifier: Programming Language :: Python :: 3.12
18
18
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
19
  Classifier: Topic :: Scientific/Engineering :: Human Machine Interfaces
20
- Requires-Python: >=3.8
20
+ Requires-Python: >=3.10
21
21
  Description-Content-Type: text/markdown
22
- Requires-Dist: ur_rtde>=1.4.0
22
+ Requires-Dist: ur_rtde>=1.6
23
23
  Requires-Dist: pyyaml>=6.0
24
- Requires-Dist: colorama>=0.4.6
25
- Requires-Dist: rich>=13.0.0
24
+ Requires-Dist: colorama>=0.4
25
+ Requires-Dist: rich>=15
26
26
 
27
27
  # URKit
28
28
 
@@ -4,11 +4,11 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "urkit"
7
- version = "0.3.9"
7
+ version = "0.3.11"
8
8
  description = "Universal Robots e-Series control toolkit built on ur_rtde"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
11
- requires-python = ">=3.8"
11
+ requires-python = ">=3.10"
12
12
  authors = [
13
13
  {name = "URKit Contributors"},
14
14
  ]
@@ -44,10 +44,10 @@ classifiers = [
44
44
  "Topic :: Scientific/Engineering :: Human Machine Interfaces",
45
45
  ]
46
46
  dependencies = [
47
- "ur_rtde>=1.4.0",
47
+ "ur_rtde>=1.6",
48
48
  "pyyaml>=6.0",
49
- "colorama>=0.4.6",
50
- "rich>=13.0.0",
49
+ "colorama>=0.4",
50
+ "rich>=15",
51
51
  ]
52
52
 
53
53
  [project.urls]
@@ -24,7 +24,7 @@ Quick start::
24
24
 
25
25
  from __future__ import annotations
26
26
 
27
- __version__ = "0.3.9"
27
+ __version__ = "0.3.11"
28
28
 
29
29
  from urkit.config import load_config, resolve_config
30
30
  from urkit.exceptions import (
@@ -1445,7 +1445,7 @@ def teach_command(args) -> None:
1445
1445
  print(" Gripper activated.", flush=True)
1446
1446
  except ConnectionError as e:
1447
1447
  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):
1449
1449
  print(
1450
1450
  "\n The robot is reachable but RTDE could not connect.\n"
1451
1451
  " This usually means Remote Control is not enabled.\n"
@@ -176,23 +176,56 @@ class URRobot:
176
176
  time.sleep(5)
177
177
 
178
178
  # 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:
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
+ )
189
+
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
195
+ for attempt in range(1, rtde_attempts + 1):
182
196
  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."
197
+ self._rtde_c, self._rtde_r, self._rtde_io = _connect_rtde(
198
+ ip,
199
+ frequency=self._rtde_frequency,
189
200
  )
190
-
191
- # Connect RTDE
192
- self._rtde_c, self._rtde_r, self._rtde_io = _connect_rtde(
193
- ip,
194
- frequency=self._rtde_frequency,
195
- )
201
+ 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
218
+ except Exception as e:
219
+ if attempt < rtde_attempts:
220
+ logger.warning(
221
+ "[URRobot] RTDE connection attempt %d failed: %s. "
222
+ "Retrying in 5s...",
223
+ attempt,
224
+ e,
225
+ )
226
+ time.sleep(5)
227
+ else:
228
+ raise
196
229
 
197
230
  # Initialize subsystems
198
231
  self._telemetry = Telemetry(self._rtde_r)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: urkit
3
- Version: 0.3.9
3
+ Version: 0.3.11
4
4
  Summary: Universal Robots e-Series control toolkit built on ur_rtde
5
5
  Author: URKit Contributors
6
6
  License: MIT
@@ -17,12 +17,12 @@ Classifier: Programming Language :: Python :: 3.11
17
17
  Classifier: Programming Language :: Python :: 3.12
18
18
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
19
  Classifier: Topic :: Scientific/Engineering :: Human Machine Interfaces
20
- Requires-Python: >=3.8
20
+ Requires-Python: >=3.10
21
21
  Description-Content-Type: text/markdown
22
- Requires-Dist: ur_rtde>=1.4.0
22
+ Requires-Dist: ur_rtde>=1.6
23
23
  Requires-Dist: pyyaml>=6.0
24
- Requires-Dist: colorama>=0.4.6
25
- Requires-Dist: rich>=13.0.0
24
+ Requires-Dist: colorama>=0.4
25
+ Requires-Dist: rich>=15
26
26
 
27
27
  # URKit
28
28
 
@@ -0,0 +1,4 @@
1
+ ur_rtde>=1.6
2
+ pyyaml>=6.0
3
+ colorama>=0.4
4
+ rich>=15
@@ -1,4 +0,0 @@
1
- ur_rtde>=1.4.0
2
- pyyaml>=6.0
3
- colorama>=0.4.6
4
- rich>=13.0.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes