Commit | Line | Data |
---|---|---|
38a404b3 KZ |
1 | package org.usfirst.frc.team3501.robot; |
2 | ||
cca02549 | 3 | import org.usfirst.frc.team3501.robot.subsystems.DriveTrain; |
6f3b6d29 | 4 | import org.usfirst.frc.team3501.robot.subsystems.Intake; |
079a8cb6 | 5 | import org.usfirst.frc.team3501.robot.subsystems.Shooter; |
6acd1f1b | 6 | |
5d967c55 CZ |
7 | import edu.wpi.cscore.UsbCamera; |
8 | import edu.wpi.first.wpilibj.CameraServer; | |
1782cbad | 9 | import edu.wpi.first.wpilibj.DriverStation; |
38a404b3 KZ |
10 | import edu.wpi.first.wpilibj.IterativeRobot; |
11 | import edu.wpi.first.wpilibj.command.Scheduler; | |
1782cbad | 12 | import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; |
38a404b3 KZ |
13 | |
14 | public 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() { | |
005d6bf0 | 32 | |
6acd1f1b | 33 | return DriveTrain.getDriveTrain(); |
cca02549 | 34 | } |
6acd1f1b | 35 | |
414d5638 | 36 | public static Shooter getShooter() { |
37 | return Shooter.getShooter(); | |
38 | } | |
39 | ||
6acd1f1b CZ |
40 | public static OI getOI() { |
41 | return OI.getOI(); | |
38a404b3 KZ |
42 | } |
43 | ||
6f3b6d29 | 44 | public static Intake getIntake() { |
7992f152 AD |
45 | return Intake.getIntake(); |
46 | } | |
47 | ||
538715b1 AD |
48 | // If the gear values do not match in the left and right piston, then they are |
49 | // both set to high gear | |
38a404b3 KZ |
50 | @Override |
51 | public void autonomousInit() { | |
202468a5 | 52 | driveTrain.setHighGear(); |
38a404b3 KZ |
53 | } |
54 | ||
55 | @Override | |
56 | public void autonomousPeriodic() { | |
57 | Scheduler.getInstance().run(); | |
38a404b3 KZ |
58 | } |
59 | ||
60 | @Override | |
61 | public void teleopInit() { | |
62 | } | |
63 | ||
64 | @Override | |
65 | public void teleopPeriodic() { | |
88ecb8d3 | 66 | Scheduler.getInstance().run(); |
1782cbad CZ |
67 | updateSmartDashboard(); |
68 | } | |
69 | ||
70 | public void updateSmartDashboard() { | |
71 | SmartDashboard.putNumber("angle", driveTrain.getAngle()); | |
72 | SmartDashboard.putNumber("voltage", | |
73 | DriverStation.getInstance().getBatteryVoltage()); | |
74 | SmartDashboard.putNumber("rpm", shooter.getShooterRPM()); | |
75 | SmartDashboard.putNumber("motor value", shooter.getCurrentShootingSpeed()); | |
38a404b3 KZ |
76 | } |
77 | } |