remove wait_until_stopped method
This commit is contained in:
parent
9eaf89faec
commit
14e16cc6e8
1 changed files with 0 additions and 18 deletions
18
utils.py
18
utils.py
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue