Skip to content

Commit 6538c58

Browse files
committed
exmaples: pose_example.py with wait if non-blocking
1 parent 921e59b commit 6538c58

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

examples/pose_example.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,39 @@
3434
alvik.move(50.0, 'mm', blocking=False)
3535
print("on target after move")
3636

37+
while not alvik.is_target_reached():
38+
alvik.left_led.set_color(1, 0, 0)
39+
sleep_ms(500)
40+
alvik.left_led.set_color(0, 0, 0)
41+
sleep_ms(500)
42+
3743
alvik.rotate(45.0, 'deg', blocking=False)
3844
print("on target after rotation")
3945

46+
while not alvik.is_target_reached():
47+
alvik.left_led.set_color(1, 0, 0)
48+
sleep_ms(500)
49+
alvik.left_led.set_color(0, 0, 0)
50+
sleep_ms(500)
51+
4052
alvik.move(100.0, 'mm', blocking=False)
4153
print("on target after move")
4254

55+
while not alvik.is_target_reached():
56+
alvik.left_led.set_color(1, 0, 0)
57+
sleep_ms(500)
58+
alvik.left_led.set_color(0, 0, 0)
59+
sleep_ms(500)
60+
4361
alvik.rotate(-90.00, 'deg', blocking=False)
4462
print("on target after rotation")
4563

64+
while not alvik.is_target_reached():
65+
alvik.left_led.set_color(1, 0, 0)
66+
sleep_ms(500)
67+
alvik.left_led.set_color(0, 0, 0)
68+
sleep_ms(500)
69+
4670
x, y, theta = alvik.get_pose()
4771
print(f'Current pose is x(cm)={x}, y(cm)={y}, theta(deg)={theta}')
4872

0 commit comments

Comments
 (0)