-
Notifications
You must be signed in to change notification settings - Fork 0
/
robot-min.py
49 lines (36 loc) · 1.23 KB
/
robot-min.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
from math import copysign
from os.path import dirname, basename
from wpilib import Joystick, run, TimedRobot, CameraServer
from wpimath.trajectory import TrajectoryUtil
from glob import glob as files
import time
filenames = files(dirname(__file__) + "/paths-good/*.json")
try:
filenames.sort(key=lambda filename: int(basename(filename).split(".")[0]))
except:
raise Exception(
"Files in `path` folder MUST follow 'INTEGER.*.json' pattern, where `INTEGER` is any integer value")
print("Path filenames are:", filenames)
trajectories = list(map(TrajectoryUtil.fromPathweaverJson, filenames))
@run
class Kthugdess(TimedRobot):
def robotInit(self):
# CameraServer.launch()
self.chassis = Chassis()
def reset(self):
self.turret.reset()
self.auto.reset()
self.auto.start(self.chassis, self.gyro)
autonomousInit = reset
teleopInit = reset
def autonomousPeriodic(self):\
# Start the turret zeroing process. Make sure it's almost zeroed already (manually)
pass
def teleopPeriodic(self):
pass
def disabledInit(self):
# self.turret.hood_goto(0)
pass
def disabledPeriodic(self):
# print("Disabling periodic!")
pass