fix stuff
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / Robot.java
1 package org.usfirst.frc.team3501.robot;
2
3 import org.usfirst.frc.team3501.robot.commandgroups.AutonGearThenBaselinePegCloseToBoiler;
4 import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
5 import org.usfirst.frc.team3501.robot.subsystems.Intake;
6 import org.usfirst.frc.team3501.robot.subsystems.Shooter;
7
8 import edu.wpi.cscore.UsbCamera;
9 import edu.wpi.first.wpilibj.CameraServer;
10 import edu.wpi.first.wpilibj.IterativeRobot;
11 import edu.wpi.first.wpilibj.command.Scheduler;
12
13 public class Robot extends IterativeRobot {
14 private static DriveTrain driveTrain;
15 private static Shooter shooter;
16 private static OI oi;
17 private static Intake intake;
18
19 @Override
20 public void robotInit() {
21 driveTrain = DriveTrain.getDriveTrain();
22 oi = OI.getOI();
23 shooter = Shooter.getShooter();
24 intake = Intake.getIntake();
25 CameraServer server = CameraServer.getInstance();
26 UsbCamera climberCam = server.startAutomaticCapture("climbercam", 0);
27 UsbCamera intakeCam = server.startAutomaticCapture("intakecam", 1);
28 }
29
30 public static DriveTrain getDriveTrain() {
31 return DriveTrain.getDriveTrain();
32 }
33
34 public static Shooter getShooter() {
35 return Shooter.getShooter();
36 }
37
38 public static OI getOI() {
39 return OI.getOI();
40 }
41
42 public static Intake getIntake() {
43 return Intake.getIntake();
44 }
45
46 // If the gear values do not match in the left and right piston, then they are
47 // both set to high gear
48 @Override
49 public void autonomousInit() {
50 driveTrain.setHighGear();
51 Scheduler.getInstance()
52 .add(new AutonGearThenBaselinePegCloseToBoiler("RETRIEVAL", 0));
53 }
54
55 @Override
56 public void autonomousPeriodic() {
57 Scheduler.getInstance().run();
58 }
59
60 @Override
61 public void teleopInit() {
62 Scheduler.getInstance().removeAll();
63 }
64
65 @Override
66 public void teleopPeriodic() {
67 Scheduler.getInstance().run();
68 }
69 }