code review changes
[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;
38a404b3
KZ
19
20 @Override
21 public void robotInit() {
6acd1f1b
CZ
22 driveTrain = DriveTrain.getDriveTrain();
23 oi = OI.getOI();
079a8cb6 24 shooter = Shooter.getShooter();
6f3b6d29 25 intake = Intake.getIntake();
5d967c55
CZ
26 CameraServer server = CameraServer.getInstance();
27 UsbCamera climberCam = server.startAutomaticCapture("climbercam", 0);
28 UsbCamera intakeCam = server.startAutomaticCapture("intakecam", 1);
cca02549 29 }
6acd1f1b
CZ
30
31 public static DriveTrain getDriveTrain() {
32 return DriveTrain.getDriveTrain();
cca02549 33 }
6acd1f1b 34
414d5638 35 public static Shooter getShooter() {
36 return Shooter.getShooter();
37 }
38
6acd1f1b
CZ
39 public static OI getOI() {
40 return OI.getOI();
38a404b3
KZ
41 }
42
6f3b6d29 43 public static Intake getIntake() {
7992f152
AD
44 return Intake.getIntake();
45 }
46
538715b1
AD
47 // If the gear values do not match in the left and right piston, then they are
48 // both set to high gear
38a404b3
KZ
49 @Override
50 public void autonomousInit() {
202468a5 51 driveTrain.setHighGear();
38a404b3
KZ
52 }
53
54 @Override
55 public void autonomousPeriodic() {
56 Scheduler.getInstance().run();
38a404b3
KZ
57 }
58
59 @Override
60 public void teleopInit() {
61 }
62
63 @Override
64 public void teleopPeriodic() {
88ecb8d3 65 Scheduler.getInstance().run();
1782cbad
CZ
66 updateSmartDashboard();
67 }
68
69 public void updateSmartDashboard() {
70 SmartDashboard.putNumber("angle", driveTrain.getAngle());
71 SmartDashboard.putNumber("voltage",
72 DriverStation.getInstance().getBatteryVoltage());
73 SmartDashboard.putNumber("rpm", shooter.getShooterRPM());
b70398a7 74 SmartDashboard.putNumber("motor value", shooter.getTargetShootingSpeed());
38a404b3
KZ
75 }
76}