1 package org
.usfirst
.frc
.team3501
.robot
;
3 import org
.usfirst
.frc
.team3501
.robot
.subsystems
.DriveTrain
;
4 import org
.usfirst
.frc
.team3501
.robot
.subsystems
.Intake
;
5 import org
.usfirst
.frc
.team3501
.robot
.subsystems
.Shooter
;
7 import edu
.wpi
.cscore
.UsbCamera
;
8 import edu
.wpi
.first
.wpilibj
.CameraServer
;
9 import edu
.wpi
.first
.wpilibj
.DriverStation
;
10 import edu
.wpi
.first
.wpilibj
.IterativeRobot
;
11 import edu
.wpi
.first
.wpilibj
.command
.Scheduler
;
12 import edu
.wpi
.first
.wpilibj
.smartdashboard
.SmartDashboard
;
14 public class Robot
extends IterativeRobot
{
15 private static DriveTrain driveTrain
;
16 private static Shooter shooter
;
18 private static Intake intake
;
19 private static CameraServer server
;
22 public void robotInit() {
23 driveTrain
= DriveTrain
.getDriveTrain();
25 shooter
= Shooter
.getShooter();
26 intake
= Intake
.getIntake();
27 server
= CameraServer
.getInstance();
28 UsbCamera climberCam
= server
.startAutomaticCapture("climbercam", 0);
29 UsbCamera intakeCam
= server
.startAutomaticCapture("intakecam", 1);
32 public static DriveTrain
getDriveTrain() {
34 return DriveTrain
.getDriveTrain();
37 public static Shooter
getShooter() {
38 return Shooter
.getShooter();
41 public static OI
getOI() {
45 public static Intake
getIntake() {
46 return Intake
.getIntake();
49 public static void swapCameraFeed() {
50 UsbCamera climberCam
= server
.startAutomaticCapture("climbercam", 1);
51 UsbCamera intakeCam
= server
.startAutomaticCapture("intakecam", 0);
54 // If the gear values do not match in the left and right piston, then they are
55 // both set to high gear
57 public void autonomousInit() {
58 driveTrain
.setHighGear();
62 public void autonomousPeriodic() {
63 Scheduler
.getInstance().run();
67 public void teleopInit() {
71 public void teleopPeriodic() {
72 Scheduler
.getInstance().run();
73 updateSmartDashboard();
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());