-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrobot.py
40 lines (24 loc) · 844 Bytes
/
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
import commands2
import wpilib
from robotcontainer import RobotContainer
class MrSteeltastic(commands2.TimedCommandRobot):
def robotInit(self):
self.container = RobotContainer()
self.autoCommand = self.container.getAutonomousCommand()
def robotPeriodic(self):
commands2.CommandScheduler.getInstance().run()
def autonomousInit(self):
self.autoCommand = self.container.getAutonomousCommand()
if self.autoCommand:
self.autoCommand.schedule()
def autonomousPeriodic(self):
pass
def teleopInit(self):
if self.autoCommand:
self.autoCommand.cancel()
def teleopPeriodic(self):
pass
def testInit(self):
commands2.CommandScheduler.getInstance().cancelAll()
if __name__ == "__main__":
wpilib.run(MrSteeltastic)