This commit is contained in:
NikolajDanger
2022-09-07 12:02:45 +02:00
parent 2b19bc117d
commit 393e3e3ea2
2 changed files with 7 additions and 20 deletions

View File

@ -1,37 +1,24 @@
from time import sleep
import robot
POWER = 70
TURN_A = 5.3 # 10 degrees turn at power 1
TURN_COUNTER_OFFSET = 1.042
def main():
# Gets the power for the robot
power = input("Power (64):")
if power == "":
power = 64
else:
power = int(power)
# Gets the offset for the robot
offset = input("Offset (4):")
if offset == "":
offset = 64
else:
offset = int(offset)
# Calculates sleep times for the robot
turn_t = 0.076 # 10 degrees turn at given power
# Initializes the robot and runs the
arlo = robot.Robot()
arlo.go_diff(power, power + offset, 0, 1)
arlo.go_diff(POWER, POWER, 0, 1)
sleep(turn_t * 36 * TURN_COUNTER_OFFSET)
arlo.stop()
sleep(1)
arlo.go_diff(power, power + offset, 1, 0)
arlo.go_diff(POWER, POWER, 1, 0)
sleep(turn_t * 36)
arlo.stop()