-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrobot.py
More file actions
55 lines (37 loc) · 1.36 KB
/
robot.py
File metadata and controls
55 lines (37 loc) · 1.36 KB
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
49
50
51
52
53
54
55
import wpilib
from networktables import NetworkTables
from drivetrain import DrivetrainController
from pivot import pivot_arm
from throw import FrisbeeThrower
class MyRobot(wpilib.TimedRobot):
def robotInit(self):
self.sd = NetworkTables.getTable('SmartDashboard')
#Joystick/gamepad setup
self.stick1 = wpilib.Joystick(1) #Right
self.stick2 = wpilib.Joystick(2) #Left
self.gamepad = wpilib.Joystick(3) #Operator Controller
#Drivetrain Controller Setup, create the drive control object for the robot
self.drivetrainController = DrivetrainController(self)
#Frisbee Thrower Setup
self.frisbeeThrower = FrisbeeThrower(self)
#Thower Angle Setup
self.pivotArm = pivot_arm(self)
def autonomousInit(self):
pass
def autonomousPeriodic(self):
self.teleopPeriodic()
def disabledInit(self):
pass
def disabledPeriodic(self):
pass
def teleopInit(self):
pass
def teleopPeriodic(self):
#Drivetrain Controller
self.drivetrainController.teleopPeriodic(self)
#Flywheel and Kicker
self.frisbeeThrower.teleopPeriodic(self)
#Pivot Angle
self.pivotArm.teleopPeriodic(self)
if __name__ == '__main__':
wpilib.run(MyRobot)