-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrobot.py
More file actions
63 lines (43 loc) · 1.81 KB
/
robot.py
File metadata and controls
63 lines (43 loc) · 1.81 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
56
57
58
59
60
61
62
63
import wpilib
from networktables import NetworkTables
from drivetrain import DrivetrainController
#from arm import ArmController
from climber import ClimberController
from armPID import armPIDController
class MyRobot(wpilib.TimedRobot):
def robotInit(self):
self.sd = NetworkTables.getTable('SmartDashboard')
wpilib.CameraServer.launch('vision.py:main')
#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)
#Arm Controller Setup, create the arm control object for the robot
#self.armController = ArmController()
#Arm PID Loop Setup
self.armPIDController = armPIDController()
#Climber Controller Setup, create the climber control object for the robot
# self.climberController = ClimberController()
def autonomousInit(self):
self.drivetrainController.autonomousInit(self)
def autonomousPeriodic(self):
self.teleopPeriodic()
def disabledInit(self):
pass
def disabledPeriodic(self):
pass
def teleopInit(self):
self.drivetrainController.autonomousInit(self)
def teleopPeriodic(self):
#Drivetrain Controller
self.drivetrainController.teleopPeriodic(self)
#Arm Controller
#self.armController.teleopPeriodic(self)
#ArmPID
self.armPIDController.teleopPeriodic(self)
#Climber Controller
# self.climberController.teleopPeriodic(self)
if __name__ == '__main__':
wpilib.run(MyRobot)