remove wait_until_stopped method

This commit is contained in:
Ilya Uraev 2025-05-22 17:23:30 +03:00
parent 9eaf89faec
commit 14e16cc6e8

View file

@ -103,24 +103,6 @@ class RobotClient:
# 4. Выполняем линейное перемещение
self.move_line(joint_target)
self.wait_until_stopped()
def wait_until_stopped(self, timeout=10.0, poll_interval=0.2):
start = time.time()
last_status = None
while time.time() - start < timeout:
try:
status = self.get_robot_state()
if status != last_status:
print(f"DEBUG: Robot status changed to {status}")
last_status = status
if status == RobotStatus.Stopped:
print("DEBUG: Robot is stopped.")
return
except Exception as e:
print(f"DEBUG: Failed to get robot status: {e}")
time.sleep(poll_interval)
raise TimeoutError("Timeout: Robot did not reach 'Stopped' status within timeout")
def add_waypoint(self, joint_radian: list):
cmd = {"command": "add_waypoint", "joint_radian": joint_radian}