✨
This commit is contained in:
14
turn_test.py
14
turn_test.py
@ -2,24 +2,16 @@ from time import sleep
|
|||||||
import robot
|
import robot
|
||||||
|
|
||||||
POWER = 70
|
POWER = 70
|
||||||
TURN_A = 5.3 # 10 degrees turn at power 1
|
TURN_T = 0.079 # 10 degrees turn at given power
|
||||||
TURN_COUNTER_OFFSET = 1.042
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# Calculates sleep times for the robot
|
turn_degrees = input(":")
|
||||||
turn_t = 0.076 # 10 degrees turn at given power
|
|
||||||
|
|
||||||
# Initializes the robot and runs the
|
# Initializes the robot and runs the
|
||||||
arlo = robot.Robot()
|
arlo = robot.Robot()
|
||||||
|
|
||||||
arlo.go_diff(POWER, POWER, 0, 1)
|
arlo.go_diff(POWER, POWER, 0, 1)
|
||||||
sleep(turn_t * 36 * TURN_COUNTER_OFFSET)
|
sleep(TURN_T * (turn_degrees/10))
|
||||||
|
|
||||||
arlo.stop()
|
|
||||||
sleep(1)
|
|
||||||
|
|
||||||
arlo.go_diff(POWER, POWER, 1, 0)
|
|
||||||
sleep(turn_t * 36)
|
|
||||||
|
|
||||||
arlo.stop()
|
arlo.stop()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user