forked from pranavdasan/FLL2022
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
57 lines (45 loc) · 1.66 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python3
import ev3dev.ev3
from ev3dev2.sound import Sound
from ev3dev2.sensor import INPUT_1, INPUT_2, INPUT_3, INPUT_4
from ev3dev2.motor import LargeMotor, OUTPUT_A, OUTPUT_D, OUTPUT_B, OUTPUT_C, MoveTank, SpeedPercent, follow_for_ms, MoveSteering
from ev3dev2.sensor.lego import ColorSensor, GyroSensor
import Navigation
import time
from time import sleep
from ev3dev2.motor import OUTPUT_B, MediumMotor
import init
# tank = Navigation.tank_init()
# Navigation.distance_goer(tank, 50, 35, 0)
def test():
tank = Navigation.tank_init()
#tank.on_for_rotations(50, 50, 4)
tank.gyro.reset()
Navigation.distance_goer(tank, 50, -30, 0)
# for x in range(1):
# Navigation.distance_goer(tank, 50, 30, 0)
# sleep(1)
# init.debug_print(tank.gyro.angle)
# Navigation.distance_goer(tank, 50, -20, 0)
# init.debug_print(tank.gyro.angle)
# sleep(1)
#tank.on_for_rotations(-30, -30, 1)
# init.debug_print(tank.gyro.angle)
# tank.turn_degrees(5, -90, True, .1)
# init.debug_print(tank.gyro.angle)
# tank.turn_degrees(5, -90, True, .1)
# init.debug_print(tank.gyro.angle)
# tank.turn_degrees(5, -90, True, .1)
# init.debug_print(tank.gyro.angle)
# tank.turn_degrees(5, -90, True, .1)
# init.debug_print(tank.gyro.angle)
# tank.turn_degrees(5, 90, True, .1)
# init.debug_print(tank.gyro.angle)
# tank.turn_degrees(5, 90, True, .1)
# init.debug_print(tank.gyro.angle)
# tank.turn_degrees(5, 90, True, .1)
# init.debug_print(tank.gyro.angle)
# tank.turn_degrees(5, 90, True, .1)
# init.debug_print(tank.gyro.angle)
if __name__ == "__main__":
test()