24eca3c88ea8f863ad58c6b612f7d527dae930e6
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
;
21 public void robotInit() {
22 driveTrain
= DriveTrain
.getDriveTrain();
24 shooter
= Shooter
.getShooter();
25 intake
= Intake
.getIntake();
26 CameraServer server
= CameraServer
.getInstance();
27 UsbCamera climberCam
= server
.startAutomaticCapture("climbercam", 0);
28 UsbCamera intakeCam
= server
.startAutomaticCapture("intakecam", 1);
31 public static DriveTrain
getDriveTrain() {
32 return DriveTrain
.getDriveTrain();
35 public static Shooter
getShooter() {
36 return Shooter
.getShooter();
39 public static OI
getOI() {
43 public static Intake
getIntake() {
44 return Intake
.getIntake();
47 // If the gear values do not match in the left and right piston, then they are
48 // both set to high gear
50 public void autonomousInit() {
51 driveTrain
.setHighGear();
55 public void autonomousPeriodic() {
56 Scheduler
.getInstance().run();
60 public void teleopInit() {
64 public void teleopPeriodic() {
65 Scheduler
.getInstance().run();
66 updateSmartDashboard();
69 public void updateSmartDashboard() {
70 SmartDashboard
.putNumber("angle", driveTrain
.getAngle());
71 SmartDashboard
.putNumber("voltage",
72 DriverStation
.getInstance().getBatteryVoltage());
73 SmartDashboard
.putNumber("rpm", shooter
.getShooterRPM());
74 SmartDashboard
.putNumber("motor value", shooter
.getTargetShootingSpeed());