commented out 'switch front of drivetrain' stuff
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / Robot.java
CommitLineData
38a404b3
KZ
1package org.usfirst.frc.team3501.robot;
2
eeb6c3d9 3import org.usfirst.frc.team3501.robot.commands.driving.SetLowGear;
67af84eb 4import org.usfirst.frc.team3501.robot.commands.driving.TimeDrive;
047383c3 5import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
e47f0862 6import org.usfirst.frc.team3501.robot.subsystems.IntakeArm;
40348cab
E
7import org.usfirst.frc.team3501.robot.subsystems.Shooter;
8
67af84eb 9import edu.wpi.first.wpilibj.CameraServer;
38a404b3
KZ
10import edu.wpi.first.wpilibj.IterativeRobot;
11import edu.wpi.first.wpilibj.command.Scheduler;
9e9154af
HD
12import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
13import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
38a404b3
KZ
14
15public class Robot extends IterativeRobot {
16 public static OI oi;
17 public static DriveTrain driveTrain;
40348cab 18 public static Shooter shooter;
a96fa926 19 public static IntakeArm intakeArm;
3366a59a 20
67af84eb
KZ
21 SendableChooser frontChooser;
22 boolean isFront;
23
24 CameraServer cameraServer;
9e9154af 25
38a404b3
KZ
26 @Override
27 public void robotInit() {
9742fe2e 28 driveTrain = new DriveTrain();
40348cab 29 shooter = new Shooter();
a96fa926 30 intakeArm = new IntakeArm();
fab544eb
HD
31
32 oi = new OI();
67af84eb 33 isFront = true;
9e9154af 34
67af84eb
KZ
35 frontChooser = new SendableChooser();
36 frontChooser.addDefault("Intake is front", false);
37 frontChooser.addObject("Shooter is front", true);
9e9154af 38
67af84eb 39 SmartDashboard.putData("Front chooser", frontChooser);
9e9154af 40
67af84eb
KZ
41 cameraServer = CameraServer.getInstance();
42 cameraServer.setQuality(50);
43 cameraServer.startAutomaticCapture();
9e9154af 44
29d59f48
ME
45 }
46
38a404b3
KZ
47 @Override
48 public void autonomousInit() {
9e9154af 49 // get options chosen from drop down menu
67af84eb 50
fd8dfdfb 51 //isFront = (boolean) frontChooser.getSelected();
67af84eb 52
fd8dfdfb
CZ
53 //if (!isFront)
54 // driveTrain.toggleFlipped();
67af84eb
KZ
55
56 Scheduler.getInstance().add(new TimeDrive(.6, 4));
38a404b3
KZ
57 }
58
59 @Override
60 public void autonomousPeriodic() {
67af84eb 61
38a404b3 62 Scheduler.getInstance().run();
38a404b3
KZ
63 }
64
65 @Override
66 public void teleopInit() {
67af84eb
KZ
67 if (!isFront)
68 driveTrain.toggleFlipped();
eeb6c3d9 69 Scheduler.getInstance().add(new SetLowGear());
38a404b3
KZ
70 }
71
72 @Override
73 public void teleopPeriodic() {
74 Scheduler.getInstance().run();
1e039ebd
E
75 }
76
38a404b3 77}