37 lines
585 B
Python
37 lines
585 B
Python
from time import sleep
|
|
import robot
|
|
|
|
TURN_T = 0.079 # 10 degrees
|
|
DRIVE_T = 0.22 # 10 centimeter
|
|
|
|
RIGHT_WHEEL_OFFSET = 4
|
|
|
|
CLOCKWISE_OFFSET = 0.82
|
|
|
|
def loop(arlo):
|
|
while True:
|
|
arlo.go_diff(121, 42, 1, 1)
|
|
sleep(DRIVE_T * 19)
|
|
arlo.stop()
|
|
sleep(0.1)
|
|
|
|
arlo.go_diff(40, 127, 1, 1)
|
|
sleep(DRIVE_T * 19)
|
|
arlo.stop()
|
|
sleep(0.1)
|
|
|
|
def main():
|
|
# Initializes the robot and runs the
|
|
arlo = robot.Robot()
|
|
|
|
try:
|
|
loop(arlo)
|
|
|
|
except KeyboardInterrupt:
|
|
arlo.stop()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|