|
8 | 8 | while True:
|
9 | 9 | try:
|
10 | 10 |
|
11 |
| - alvik.move(100.0) |
| 11 | + alvik.move(100.0, 'mm') |
12 | 12 | print("on target after move")
|
13 | 13 |
|
14 |
| - alvik.move(50.0) |
| 14 | + alvik.move(50.0, 'mm') |
15 | 15 | print("on target after move")
|
16 | 16 |
|
17 |
| - alvik.rotate(90.0) |
| 17 | + alvik.rotate(90.0, 'deg') |
18 | 18 | print("on target after rotation")
|
19 | 19 |
|
20 |
| - alvik.rotate(-45.00) |
| 20 | + alvik.rotate(-45.00, 'deg') |
21 | 21 | print("on target after rotation")
|
22 | 22 |
|
23 | 23 | x, y, theta = alvik.get_pose()
|
24 |
| - print(f'Current pose is x={x}, y={y} ,theta={theta}') |
| 24 | + print(f'Current pose is x(cm)={x}, y(cm)={y}, theta(deg)={theta}') |
25 | 25 |
|
26 | 26 | alvik.reset_pose(0, 0, 0)
|
27 | 27 |
|
28 | 28 | x, y, theta = alvik.get_pose()
|
29 |
| - print(f'Updated pose is x={x}, y={y} ,theta={theta}') |
| 29 | + print(f'Updated pose is x(cm)={x}, y(cm)={y}, theta(deg)={theta}') |
30 | 30 | sleep_ms(500)
|
31 | 31 |
|
32 | 32 | print("___________NON-BLOCKING__________________")
|
33 | 33 |
|
34 |
| - alvik.move(50.0, blocking=False) |
35 |
| - while not alvik.is_target_reached(): |
36 |
| - print(f"Not yet on target received:{alvik.last_ack}") |
| 34 | + alvik.move(50.0, 'mm', blocking=False) |
37 | 35 | print("on target after move")
|
38 | 36 |
|
39 |
| - alvik.rotate(45.0, blocking=False) |
40 |
| - while not alvik.is_target_reached(): |
41 |
| - print(f"Not yet on target received:{alvik.last_ack}") |
| 37 | + alvik.rotate(45.0, 'deg', blocking=False) |
42 | 38 | print("on target after rotation")
|
43 | 39 |
|
44 |
| - alvik.move(100.0, blocking=False) |
45 |
| - while not alvik.is_target_reached(): |
46 |
| - print(f"Not yet on target received:{alvik.last_ack}") |
| 40 | + alvik.move(100.0, 'mm', blocking=False) |
47 | 41 | print("on target after move")
|
48 | 42 |
|
49 |
| - alvik.rotate(-90.00, blocking=False) |
50 |
| - while not alvik.is_target_reached(): |
51 |
| - print(f"Not yet on target received:{alvik.last_ack}") |
| 43 | + alvik.rotate(-90.00, 'deg', blocking=False) |
52 | 44 | print("on target after rotation")
|
53 | 45 |
|
54 | 46 | x, y, theta = alvik.get_pose()
|
55 |
| - print(f'Current pose is x={x}, y={y} ,theta={theta}') |
| 47 | + print(f'Current pose is x(cm)={x}, y(cm)={y}, theta(deg)={theta}') |
56 | 48 |
|
57 | 49 | alvik.reset_pose(0, 0, 0)
|
58 | 50 |
|
59 | 51 | x, y, theta = alvik.get_pose()
|
60 |
| - print(f'Updated pose is x={x}, y={y} ,theta={theta}') |
| 52 | + print(f'Updated pose is x={x}, y={y}, theta(deg)={theta}') |
61 | 53 | sleep_ms(500)
|
62 | 54 |
|
63 | 55 | alvik.stop()
|
|
0 commit comments