This commit is contained in:
NikolajDanger
2022-09-07 14:35:30 +02:00
parent 9111deb81b
commit 57d4fdb35c

35
wiggle.py Normal file
View File

@ -0,0 +1,35 @@
from time import sleep
import robot
POWER = 70
TURN_T = 0.079 # 10 degrees
DRIVE_T = 0.22 # 10 centimeter
RIGHT_WHEEL_OFFSET = 4
CLOCKWISE_OFFSET = 0.82
def loop(arlo):
arlo.go_diff(POWER, POWER + RIGHT_WHEEL_OFFSET, 1, 0)
sleep(TURN_T * CLOCKWISE_OFFSET)
arlo.stop()
sleep(0.2)
arlo.go_diff(POWER, POWER + RIGHT_WHEEL_OFFSET, 0, 1)
sleep(TURN_T)
arlo.stop()
def main():
# Initializes the robot and runs the
arlo = robot.Robot()
try:
loop(arlo)
except KeyboardInterrupt:
arlo.stop()
if __name__ == "__main__":
main()