Add code to toggle agitator pistons in RunIndexWheelContinuous
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / Robot.java
CommitLineData
38a404b3
KZ
1package org.usfirst.frc.team3501.robot;
2
cca02549 3import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
6f3b6d29 4import org.usfirst.frc.team3501.robot.subsystems.Intake;
079a8cb6 5import org.usfirst.frc.team3501.robot.subsystems.Shooter;
6acd1f1b 6
5d967c55
CZ
7import edu.wpi.cscore.UsbCamera;
8import edu.wpi.first.wpilibj.CameraServer;
1782cbad 9import edu.wpi.first.wpilibj.DriverStation;
38a404b3
KZ
10import edu.wpi.first.wpilibj.IterativeRobot;
11import edu.wpi.first.wpilibj.command.Scheduler;
1782cbad 12import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
38a404b3
KZ
13
14public class Robot extends IterativeRobot {
6acd1f1b 15 private static DriveTrain driveTrain;
414d5638 16 private static Shooter shooter;
6acd1f1b 17 private static OI oi;
6f3b6d29 18 private static Intake intake;
99930d53 19 private static CameraServer server;
38a404b3
KZ
20
21 @Override
22 public void robotInit() {
6acd1f1b
CZ
23 driveTrain = DriveTrain.getDriveTrain();
24 oi = OI.getOI();
079a8cb6 25 shooter = Shooter.getShooter();
6f3b6d29 26 intake = Intake.getIntake();
99930d53 27 server = CameraServer.getInstance();
5d967c55
CZ
28 UsbCamera climberCam = server.startAutomaticCapture("climbercam", 0);
29 UsbCamera intakeCam = server.startAutomaticCapture("intakecam", 1);
cca02549 30 }
6acd1f1b
CZ
31
32 public static DriveTrain getDriveTrain() {
005d6bf0 33
6acd1f1b 34 return DriveTrain.getDriveTrain();
cca02549 35 }
6acd1f1b 36
414d5638 37 public static Shooter getShooter() {
38 return Shooter.getShooter();
39 }
40
6acd1f1b
CZ
41 public static OI getOI() {
42 return OI.getOI();
38a404b3
KZ
43 }
44
6f3b6d29 45 public static Intake getIntake() {
7992f152
AD
46 return Intake.getIntake();
47 }
48
99930d53
RR
49 public static void swapCameraFeed() {
50 UsbCamera climberCam = server.startAutomaticCapture("climbercam", 1);
51 UsbCamera intakeCam = server.startAutomaticCapture("intakecam", 0);
52 }
53
538715b1
AD
54 // If the gear values do not match in the left and right piston, then they are
55 // both set to high gear
38a404b3
KZ
56 @Override
57 public void autonomousInit() {
2d810c3c 58 driveTrain.setHighGear();
38a404b3
KZ
59 }
60
61 @Override
62 public void autonomousPeriodic() {
63 Scheduler.getInstance().run();
38a404b3
KZ
64 }
65
66 @Override
67 public void teleopInit() {
68 }
69
70 @Override
71 public void teleopPeriodic() {
88ecb8d3 72 Scheduler.getInstance().run();
1782cbad
CZ
73 updateSmartDashboard();
74 }
75
76 public void updateSmartDashboard() {
77 SmartDashboard.putNumber("angle", driveTrain.getAngle());
78 SmartDashboard.putNumber("voltage",
79 DriverStation.getInstance().getBatteryVoltage());
80 SmartDashboard.putNumber("rpm", shooter.getShooterRPM());
81 SmartDashboard.putNumber("motor value", shooter.getCurrentShootingSpeed());
38a404b3
KZ
82 }
83}