-
Notifications
You must be signed in to change notification settings - Fork 0
/
pami.py
33 lines (27 loc) · 883 Bytes
/
pami.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
import time, math, sys
import handlers, comm
NUC_IP = "192.168.8.125"
#NUC_IP = None
INST_WAIT = 0
BLUE_SIDE = sys.argv[1] == "b"
START_X = handlers.TABLE_LENGTH + ((-450.0/2.0+50) if BLUE_SIDE else (450/2.0-50))
START_Y = handlers.TABLE_WIDTH - handlers.PAMINABLE_ENCODER_OFFSET_TO_FRONT
START_THETA = math.radians(90)
ULTRA_ENABLE = False
ULTRA_RESTART = False
ULTRA_DST = 300.0
ULTRA_MARGIN = 10.0
class CustomScenario(handlers.PaminableScenario):
def play(self):
#for i in range(200):
# self.turn(90)
# time.sleep(4)
time.sleep(90.0)
self.move(-300)
self.turn(-90 if BLUE_SIDE else 90)
self.move(-(1000+50))
print(f"Running {'Blue' if BLUE_SIDE else 'Yellow'} side scenario.")
asserv = comm.make_asserv()
scenar = CustomScenario(asserv, START_X, START_Y, START_THETA, INST_WAIT,
ULTRA_ENABLE, ULTRA_RESTART, ULTRA_DST, ULTRA_MARGIN, NUC_IP)
scenar.run()