Skip to content

Commit ccb9401

Browse files
committed
Spin in the UI thread
1 parent df013d2 commit ccb9401

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

clearpath_tests/clearpath_tests/estop_test.py

Lines changed: 5 additions & 4 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-
pass
144+
rclpy.spin_once(self.node)
145145

146146
if self.estop_engaged is None:
147147
results.append(ClearpathTestResult(
@@ -221,8 +221,8 @@ def run_ui(self):
221221
# if needed; this affects Ridgeback primarily
222222
timeout = Duration(seconds=2)
223223
start_time = self.get_clock().now()
224-
while self.get_clock.now() - start_time < timeout:
225-
pass
224+
while self.get_clock().now() - start_time < timeout:
225+
rclpy.spin_once(self.node)
226226

227227
self.command_wheels()
228228
user_input = self.promptYN('Did the wheels rotate?')
@@ -247,7 +247,7 @@ def command_wheels(self):
247247
start_time = self.get_clock().now()
248248
duration = Duration(seconds=2)
249249
while (self.get_clock().now() - start_time) < duration:
250-
pass
250+
rclpy.spin_once(self.node)
251251

252252
self.cmd_vel.twist.linear.x = 0.0
253253

@@ -268,5 +268,6 @@ def wait_for_estop(self, state, timeout_seconds=10):
268268
(now - start_time) < timeout
269269
):
270270
now = self.get_clock().now()
271+
rclpy.spin_once(self.node)
271272

272273
return self.estop_engaged == state

0 commit comments

Comments
 (0)