Skip to content

Commit df013d2

Browse files
committed
Remove sleeps from the e-stop test
1 parent e7e2084 commit df013d2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

clearpath_tests/clearpath_tests/estop_test.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def run_ui(self):
141141
self.estop_engaged is None and
142142
(self.get_clock().now() - start_time) < timeout
143143
):
144-
time.sleep(0.1)
144+
pass
145145

146146
if self.estop_engaged is None:
147147
results.append(ClearpathTestResult(
@@ -219,7 +219,10 @@ def run_ui(self):
219219
if safe_to_drive:
220220
# wait 2s after clearing the e-stop to allow CAN connections to come back up
221221
# if needed; this affects Ridgeback primarily
222-
time.sleep(2.0)
222+
timeout = Duration(seconds=2)
223+
start_time = self.get_clock().now()
224+
while self.get_clock.now() - start_time < timeout:
225+
pass
223226

224227
self.command_wheels()
225228
user_input = self.promptYN('Did the wheels rotate?')

0 commit comments

Comments
 (0)