urkit 0.3.8__tar.gz → 0.3.9__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 (39) hide show
  1. {urkit-0.3.8 → urkit-0.3.9}/PKG-INFO +1 -1
  2. {urkit-0.3.8 → urkit-0.3.9}/pyproject.toml +1 -1
  3. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/__init__.py +1 -1
  4. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/robot.py +47 -12
  5. {urkit-0.3.8 → urkit-0.3.9}/src/urkit.egg-info/PKG-INFO +1 -1
  6. {urkit-0.3.8 → urkit-0.3.9}/README.md +0 -0
  7. {urkit-0.3.8 → urkit-0.3.9}/setup.cfg +0 -0
  8. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/__main__.py +0 -0
  9. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/cli/__init__.py +0 -0
  10. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/cli/colors.py +0 -0
  11. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/cli/connection_monitor.py +0 -0
  12. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/cli/points.py +0 -0
  13. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/cli/teach.py +0 -0
  14. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/config.py +0 -0
  15. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/connection.py +0 -0
  16. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/exceptions.py +0 -0
  17. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/geometry.py +0 -0
  18. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/gripper/__init__.py +0 -0
  19. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/gripper/base.py +0 -0
  20. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/gripper/digital.py +0 -0
  21. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/gripper/presets.py +0 -0
  22. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/gripper/robotiq.py +0 -0
  23. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/gripper/robotiq_preamble.py +0 -0
  24. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/io.py +0 -0
  25. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/motion.py +0 -0
  26. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/points.py +0 -0
  27. {urkit-0.3.8 → urkit-0.3.9}/src/urkit/telemetry.py +0 -0
  28. {urkit-0.3.8 → urkit-0.3.9}/src/urkit.egg-info/SOURCES.txt +0 -0
  29. {urkit-0.3.8 → urkit-0.3.9}/src/urkit.egg-info/dependency_links.txt +0 -0
  30. {urkit-0.3.8 → urkit-0.3.9}/src/urkit.egg-info/entry_points.txt +0 -0
  31. {urkit-0.3.8 → urkit-0.3.9}/src/urkit.egg-info/requires.txt +0 -0
  32. {urkit-0.3.8 → urkit-0.3.9}/src/urkit.egg-info/top_level.txt +0 -0
  33. {urkit-0.3.8 → urkit-0.3.9}/tests/test_exceptions.py +0 -0
  34. {urkit-0.3.8 → urkit-0.3.9}/tests/test_geometry.py +0 -0
  35. {urkit-0.3.8 → urkit-0.3.9}/tests/test_gripper.py +0 -0
  36. {urkit-0.3.8 → urkit-0.3.9}/tests/test_gripper_factory.py +0 -0
  37. {urkit-0.3.8 → urkit-0.3.9}/tests/test_gripper_presets.py +0 -0
  38. {urkit-0.3.8 → urkit-0.3.9}/tests/test_points.py +0 -0
  39. {urkit-0.3.8 → urkit-0.3.9}/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.8
3
+ Version: 0.3.9
4
4
  Summary: Universal Robots e-Series control toolkit built on ur_rtde
5
5
  Author: URKit Contributors
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "urkit"
7
- version = "0.3.8"
7
+ version = "0.3.9"
8
8
  description = "Universal Robots e-Series control toolkit built on ur_rtde"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -24,7 +24,7 @@ Quick start::
24
24
 
25
25
  from __future__ import annotations
26
26
 
27
- __version__ = "0.3.8"
27
+ __version__ = "0.3.9"
28
28
 
29
29
  from urkit.config import load_config, resolve_config
30
30
  from urkit.exceptions import (
@@ -163,7 +163,10 @@ class URRobot:
163
163
  # handles that case too.
164
164
  self._connect_dashboard()
165
165
  did_power_on = self.power_on()
166
- did_release = self.release_brakes()
166
+ # After power_on the robot is IDLE but brakes are still engaged —
167
+ # robotmode can't distinguish "IDLE braked" from "IDLE released",
168
+ # so force the brake release when we just powered on.
169
+ did_release = self.release_brakes(force=did_power_on)
167
170
  boot_needed = did_power_on or did_release
168
171
 
169
172
  # Settle after boot — the robot reports IDLE but the Secondary
@@ -584,9 +587,13 @@ class URRobot:
584
587
  if "Powering on" in response:
585
588
  _status("Powering on robot...", done=False)
586
589
  logger.info("Robot powering on, waiting for ready state...")
590
+ # Wait until the robot reaches IDLE (brakes engaged, ready for
591
+ # brake release). Stopping at "not POWER_OFF" is insufficient —
592
+ # the robot may still be in POWER_ON or BOOTING where the
593
+ # dashboard rejects "brake release" with a mounting error.
587
594
  self._poll_robotmode(
588
- lambda m: "POWER_OFF" not in m.upper(),
589
- timeout=30.0,
595
+ lambda m: "IDLE" in m.upper(),
596
+ timeout=15.0,
590
597
  )
591
598
  _status("Robot powered on", done=True)
592
599
  return True
@@ -613,11 +620,17 @@ class URRobot:
613
620
  except Exception as e:
614
621
  raise ConnectionError(f"Power off failed: {e}")
615
622
 
616
- def release_brakes(self) -> bool:
623
+ def release_brakes(self, *, force: bool = False) -> bool:
617
624
  """Release the robot brakes (enable control).
618
625
 
619
- Checks the current robot mode first. If the robot is already
620
- in IDLE or RUNNING, the command is skipped silently.
626
+ Checks the current mode first. If the robot is already
627
+ in RUNNING, the command is skipped silently. (IDLE cannot
628
+ distinguish braked from released — use *force* after power_on.)
629
+
630
+ Args:
631
+ force: Skip the mode check and send brake release regardless.
632
+ Should be True when called immediately after power_on(),
633
+ because robotmode reports IDLE for both braked and released.
621
634
 
622
635
  Polls until the robot reports IDLE or RUNNING mode.
623
636
 
@@ -629,20 +642,34 @@ class URRobot:
629
642
  ConnectionError: If brake release fails or times out.
630
643
  """
631
644
  try:
632
- # Check current mode first — skip if already released.
645
+ # Check current mode first — skip if already running.
646
+ # Note: IDLE is ambiguous (brakes may be engaged or released),
647
+ # so we only skip on RUNNING. When force=True (called after
648
+ # power_on), we skip the check entirely.
633
649
  mode = self._send_dashboard("robotmode").upper()
634
- if "IDLE" in mode or "RUNNING" in mode:
650
+ if not force and "RUNNING" in mode:
635
651
  logger.info("Brakes already released (mode: %s), skipping.", mode)
636
652
  return False
637
653
 
638
654
  response = self._send_dashboard("brake release")
639
655
  logger.info("Brake release: %s", response)
656
+
657
+ # Retry once if the mounting calibration wasn't ready.
658
+ if "mounting is not correct" in response:
659
+ logger.info(
660
+ "Brake release rejected (mounting not ready), "
661
+ "retrying after 3s..."
662
+ )
663
+ time.sleep(3)
664
+ response = self._send_dashboard("brake release")
665
+ logger.info("Brake release (retry): %s", response)
666
+
640
667
  if "Brake releasing" in response:
641
668
  _status("Releasing brakes...", done=False)
642
669
  logger.info("Brakes releasing, waiting for ready state...")
643
670
  self._poll_robotmode(
644
671
  lambda m: "IDLE" in m.upper() or "RUNNING" in m.upper(),
645
- timeout=30.0,
672
+ timeout=15.0,
646
673
  )
647
674
  _status("Brakes released", done=True)
648
675
  return True
@@ -916,6 +943,8 @@ class URRobot:
916
943
  current ``move_frame`` property (BASE or TOOL).
917
944
  vel: Velocity override. Falls back to default_vel.
918
945
  acc: Acceleration override. Falls back to default_acc.
946
+ asynchronous: If True, move runs in background and method returns
947
+ immediately (default False).
919
948
  offset_x: X offset in meters (default 0.0).
920
949
  offset_y: Y offset in meters (default 0.0).
921
950
  offset_z: Z offset in meters (default 0.0).
@@ -1039,6 +1068,7 @@ class URRobot:
1039
1068
  frame: MoveFrame | None = None,
1040
1069
  vel: float | None = None,
1041
1070
  acc: float | None = None,
1071
+ asynchronous: bool = False,
1042
1072
  delta_x: float = 0.0,
1043
1073
  delta_y: float = 0.0,
1044
1074
  delta_z: float = 0.0,
@@ -1060,6 +1090,8 @@ class URRobot:
1060
1090
  current ``move_frame`` property (BASE or TOOL).
1061
1091
  vel: Velocity override. Falls back to default_vel.
1062
1092
  acc: Acceleration override. Falls back to default_acc.
1093
+ asynchronous: If True, move runs in background and method returns
1094
+ immediately (default False).
1063
1095
  delta_x: X delta in meters (default 0.0).
1064
1096
  delta_y: Y delta in meters (default 0.0).
1065
1097
  delta_z: Z delta in meters (default 0.0).
@@ -1113,10 +1145,10 @@ class URRobot:
1113
1145
  target = transform_pose_delta(current, final_delta, effective_frame)
1114
1146
 
1115
1147
  if linear:
1116
- self._motion.movel(target, vel=vel, acc=acc)
1148
+ self._motion.movel(target, vel=vel, acc=acc, asynchronous=asynchronous)
1117
1149
  else:
1118
1150
  joints = self.inverse_kinematics(target)
1119
- self._motion.movej(joints, vel=vel, acc=acc)
1151
+ self._motion.movej(joints, vel=vel, acc=acc, asynchronous=asynchronous)
1120
1152
  except MotionError:
1121
1153
  raise
1122
1154
  except Exception as e:
@@ -1130,6 +1162,7 @@ class URRobot:
1130
1162
  blend_radius: float = 0.0,
1131
1163
  vel: float | None = None,
1132
1164
  acc: float | None = None,
1165
+ asynchronous: bool = False,
1133
1166
  ) -> None:
1134
1167
  """Move through a sequence of points with optional blending.
1135
1168
 
@@ -1151,6 +1184,8 @@ class URRobot:
1151
1184
  Applied to intermediate points only.
1152
1185
  vel: Velocity override. Falls back to default_vel.
1153
1186
  acc: Acceleration override. Falls back to default_acc.
1187
+ asynchronous: If True, sequence runs in background and method
1188
+ returns immediately (default False).
1154
1189
 
1155
1190
  Raises:
1156
1191
  MotionError: If the sequence fails or fewer than 2 targets.
@@ -1198,7 +1233,7 @@ class URRobot:
1198
1233
  )
1199
1234
 
1200
1235
  try:
1201
- self._rtde_c.movePath(path, False) # False = synchronous
1236
+ self._rtde_c.movePath(path, not asynchronous)
1202
1237
  except Exception as e:
1203
1238
  raise MotionError(f"move_sequence failed: {e}")
1204
1239
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: urkit
3
- Version: 0.3.8
3
+ Version: 0.3.9
4
4
  Summary: Universal Robots e-Series control toolkit built on ur_rtde
5
5
  Author: URKit Contributors
6
6
  License: MIT
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
File without changes