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
.first
.wpilibj
.IterativeRobot
;
8 import edu
.wpi
.first
.wpilibj
.command
.Scheduler
;
9 import edu
.wpi
.first
.wpilibj
.smartdashboard
.SmartDashboard
;
11 public class Robot
extends IterativeRobot
{
12 private static DriveTrain driveTrain
;
13 private static Shooter shooter
;
15 private static Intake intake
;
18 public void robotInit() {
19 driveTrain
= DriveTrain
.getDriveTrain();
21 shooter
= Shooter
.getShooter();
22 intake
= Intake
.getIntake();
25 public static DriveTrain
getDriveTrain() {
26 return DriveTrain
.getDriveTrain();
29 public static Shooter
getShooter() {
30 return Shooter
.getShooter();
33 public static OI
getOI() {
37 public static Intake
getIntake() {
38 return Intake
.getIntake();
41 // If the gear values do not match in the left and right piston, then they are
42 // both set to high gear
44 public void autonomousInit() {
45 driveTrain
.setHighGear();
47 SmartDashboard
.putNumber(Constants
.DriveTrain
.DRIVE_P_Val
, 0);
48 SmartDashboard
.putNumber(Constants
.DriveTrain
.DRIVE_I_Val
, 0);
49 SmartDashboard
.putNumber(Constants
.DriveTrain
.DRIVE_D_Val
, 0);
50 SmartDashboard
.putNumber(Constants
.DriveTrain
.DRIVE_TARGET_DIST
, 50);
51 SmartDashboard
.putNumber(Constants
.DriveTrain
.DRIVE_MOTOR_VAL
, 0.5);
56 public void autonomousPeriodic() {
57 Scheduler
.getInstance().run();
59 double P
= SmartDashboard
.getNumber(Constants
.DriveTrain
.DRIVE_D_Val
,
60 Constants
.DriveTrain
.PID_ERROR
);
61 double I
= SmartDashboard
.getNumber(Constants
.DriveTrain
.DRIVE_I_Val
,
62 Constants
.DriveTrain
.PID_ERROR
);
63 double D
= SmartDashboard
.getNumber(Constants
.DriveTrain
.DRIVE_D_Val
,
64 Constants
.DriveTrain
.PID_ERROR
);
65 double P
= SmartDashboard
.getNumber(Constants
.DriveTrain
.GYRO_P_Val
,
66 Constants
.DriveTrain
.PID_ERROR
);
67 double I
= SmartDashboard
.getNumber(Constants
.DriveTrain
.GYRO_I_Val
,
68 Constants
.DriveTrain
.PID_ERROR
);
69 double D
= SmartDashboard
.getNumber(Constants
.DriveTrain
.GYRO_D_Val
,
71 Constants
.DriveTrain
.PID_ERROR
);
73 DriveTrain
.getDriveTrain().getDriveController().setConstants(DriveP
, DriveI
,
76 // new DriveDistance(SETPOINT, SPEED).start();
80 public void teleopInit() {
85 public void teleopPeriodic() {
86 Scheduler
.getInstance().run();