-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrobot.py
36 lines (31 loc) · 1 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
from commandbased import CommandBasedRobot
import wpilib
class MyRobot(CommandBasedRobot):
def robotInit(self):
CommandBasedRobot.robotInit(self)
from commands.groupDriveStraight import GroupDriveStraight
from commands.teleDrive import TeleDrive
from common.oi import oi
self.autonomousCommand = GroupDriveStraight()
self.teleDrive = TeleDrive()
self.oi = oi
def disabledInit(self):
pass
def autonomousInit(self):
super().autonomousInit()
self.autonomousCommand.start()
def autonomousPeriodic(self):
super().autonomousPeriodic()
def teleopInit(self):
super().teleopInit()
self.autonomousCommand.cancel()
self.teleDrive.start()
def teleopPeriodic(self):
super().teleopPeriodic()
self.oi.backwardsCheck()
def testInit(self):
super().testInit()
def testPeriodic(self):
super().testPeriodic()
if __name__ == '__main__':
wpilib.run(MyRobot)