-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrobot.py
executable file
·44 lines (29 loc) · 1.02 KB
/
robot.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
#!/usr/bin/env python3
import wpilib
import commands2
from robotcontainer import RobotContainer
class MyRobot(commands2.TimedCommandRobot):
container = None
def robotInit(self):
wpilib.LiveWindow.disableAllTelemetry()
self.container = RobotContainer()
def disabledInit(self):
commands2.CommandScheduler.getInstance().cancelAll()
def disabledPeriodic(self):
pass
def autonomousInit(self):
self.container.getAutonomousCommand().schedule()
self.container.getResetCommand().schedule()
self.container.getStateMachineCommand().schedule()
def autonomousPeriodic(self):
pass
def teleopInit(self):
commands2.CommandScheduler.getInstance().cancelAll()
self.container.getResetCommand().schedule()
self.container.getStateMachineCommand().schedule()
def teleopPeriodic(self):
pass
def testInit(self):
commands2.CommandScheduler.getInstance().cancelAll()
if __name__ == "__main__":
wpilib.run(MyRobot)