-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from arduino/dev
0.1.0
- Loading branch information
Showing
16 changed files
with
642 additions
and
116 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from arduino_alvik import ArduinoAlvik | ||
from time import sleep_ms | ||
import sys | ||
|
||
alvik = ArduinoAlvik() | ||
alvik.begin() | ||
|
||
while True: | ||
try: | ||
alvik.left_wheel.set_speed(10) | ||
sleep_ms(1000) | ||
print(f'LSP: {alvik.left_wheel.get_speed()}') | ||
print(f'RSP: {alvik.right_wheel.get_speed()}') | ||
|
||
alvik.right_wheel.set_speed(10) | ||
sleep_ms(1000) | ||
|
||
print(f'LSP: {alvik.left_wheel.get_speed()}') | ||
print(f'RSP: {alvik.right_wheel.get_speed()}') | ||
|
||
alvik.left_wheel.set_speed(20) | ||
sleep_ms(1000) | ||
|
||
print(f'LSP: {alvik.left_wheel.get_speed()}') | ||
print(f'RSP: {alvik.right_wheel.get_speed()}') | ||
|
||
alvik.right_wheel.set_speed(20) | ||
sleep_ms(1000) | ||
|
||
print(f'LSP: {alvik.left_wheel.get_speed()}') | ||
print(f'RSP: {alvik.right_wheel.get_speed()}') | ||
|
||
except KeyboardInterrupt as e: | ||
print('over') | ||
alvik.stop() | ||
sys.exit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
from arduino_alvik import ArduinoAlvik | ||
from time import sleep_ms | ||
import sys | ||
|
||
alvik = ArduinoAlvik() | ||
alvik.begin() | ||
|
||
while True: | ||
try: | ||
|
||
alvik.move(100.0) | ||
print("on target after move") | ||
|
||
alvik.move(50.0) | ||
print("on target after move") | ||
|
||
alvik.rotate(90.0) | ||
print("on target after rotation") | ||
|
||
alvik.rotate(-45.00) | ||
print("on target after rotation") | ||
|
||
x, y, theta = alvik.get_pose() | ||
print(f'Current pose is x={x}, y={y} ,theta={theta}') | ||
|
||
alvik.reset_pose(0, 0, 0) | ||
|
||
x, y, theta = alvik.get_pose() | ||
print(f'Updated pose is x={x}, y={y} ,theta={theta}') | ||
sleep_ms(500) | ||
|
||
print("___________NON-BLOCKING__________________") | ||
|
||
alvik.move(50.0, blocking=False) | ||
while not alvik.is_target_reached(): | ||
print(f"Not yet on target received:{alvik.last_ack}") | ||
print("on target after move") | ||
|
||
alvik.rotate(45.0, blocking=False) | ||
while not alvik.is_target_reached(): | ||
print(f"Not yet on target received:{alvik.last_ack}") | ||
print("on target after rotation") | ||
|
||
alvik.move(100.0, blocking=False) | ||
while not alvik.is_target_reached(): | ||
print(f"Not yet on target received:{alvik.last_ack}") | ||
print("on target after move") | ||
|
||
alvik.rotate(-90.00, blocking=False) | ||
while not alvik.is_target_reached(): | ||
print(f"Not yet on target received:{alvik.last_ack}") | ||
print("on target after rotation") | ||
|
||
x, y, theta = alvik.get_pose() | ||
print(f'Current pose is x={x}, y={y} ,theta={theta}') | ||
|
||
alvik.reset_pose(0, 0, 0) | ||
|
||
x, y, theta = alvik.get_pose() | ||
print(f'Updated pose is x={x}, y={y} ,theta={theta}') | ||
sleep_ms(500) | ||
|
||
alvik.stop() | ||
sys.exit() | ||
|
||
except KeyboardInterrupt as e: | ||
print('over') | ||
alvik.stop() | ||
sys.exit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from arduino_alvik import ArduinoAlvik | ||
from time import sleep_ms | ||
import sys | ||
|
||
alvik = ArduinoAlvik() | ||
alvik.begin() | ||
speed = 0 | ||
|
||
while True: | ||
try: | ||
ax, ay, az = alvik.get_accelerations() | ||
gx, gy, gz = alvik.get_gyros() | ||
print(f'ax: {ax}, ay: {ay}, az: {az}, gx: {gx}, gy: {gy}, gz: {gz}') | ||
sleep_ms(100) | ||
except KeyboardInterrupt as e: | ||
print('over') | ||
alvik.stop() | ||
sys.exit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from arduino_alvik import ArduinoAlvik | ||
from time import sleep | ||
import sys | ||
|
||
alvik = ArduinoAlvik() | ||
alvik.begin() | ||
|
||
alvik.left_wheel.reset() | ||
alvik.right_wheel.reset() | ||
|
||
while True: | ||
try: | ||
alvik.left_wheel.set_position(30) | ||
sleep(2) | ||
print(f'Left wheel degs: {alvik.left_wheel.get_position()}') | ||
print(f'Right wheel degs: {alvik.right_wheel.get_position()}') | ||
|
||
alvik.right_wheel.set_position(10) | ||
sleep(2) | ||
print(f'Left wheel degs: {alvik.left_wheel.get_position()}') | ||
print(f'Right wheel degs: {alvik.right_wheel.get_position()}') | ||
|
||
alvik.left_wheel.set_position(180) | ||
sleep(2) | ||
print(f'Left wheel degs: {alvik.left_wheel.get_position()}') | ||
print(f'Right wheel degs: {alvik.right_wheel.get_position()}') | ||
|
||
alvik.right_wheel.set_position(270) | ||
sleep(2) | ||
print(f'Left wheel degs: {alvik.left_wheel.get_position()}') | ||
print(f'Right wheel degs: {alvik.right_wheel.get_position()}') | ||
|
||
except KeyboardInterrupt as e: | ||
print('over') | ||
alvik.stop() | ||
sys.exit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
], | ||
"deps": [ | ||
], | ||
"version": "0.0.7" | ||
"version": "0.1.0" | ||
} |
Oops, something went wrong.