| 1 | package org.usfirst.frc.team3501.robot; |
| 2 | |
| 3 | import org.usfirst.frc.team3501.robot.commands.auton.Auton; |
| 4 | import org.usfirst.frc.team3501.robot.commands.driving.SetLowGear; |
| 5 | import org.usfirst.frc.team3501.robot.subsystems.DriveTrain; |
| 6 | import org.usfirst.frc.team3501.robot.subsystems.IntakeArm; |
| 7 | import org.usfirst.frc.team3501.robot.subsystems.Shooter; |
| 8 | |
| 9 | import edu.wpi.first.wpilibj.CameraServer; |
| 10 | import edu.wpi.first.wpilibj.IterativeRobot; |
| 11 | import edu.wpi.first.wpilibj.command.Scheduler; |
| 12 | import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; |
| 13 | |
| 14 | public class Robot extends IterativeRobot { |
| 15 | public static OI oi; |
| 16 | public static DriveTrain driveTrain; |
| 17 | public static Shooter shooter; |
| 18 | public static IntakeArm intakeArm; |
| 19 | |
| 20 | // Sendable Choosers send a drop down menu to the Smart Dashboard. |
| 21 | private static SendableChooser frontChooser; |
| 22 | private static CameraServer camera; |
| 23 | |
| 24 | @Override |
| 25 | public void robotInit() { |
| 26 | driveTrain = new DriveTrain(); |
| 27 | shooter = new Shooter(); |
| 28 | intakeArm = new IntakeArm(); |
| 29 | |
| 30 | oi = new OI(); |
| 31 | |
| 32 | camera = CameraServer.getInstance(); |
| 33 | camera.setQuality(5); |
| 34 | camera.startAutomaticCapture("cam0"); |
| 35 | } |
| 36 | |
| 37 | @Override |
| 38 | public void autonomousInit() { |
| 39 | // |
| 40 | // Scheduler.getInstance().add(new |
| 41 | // MoveIntakeArm(Constants.IntakeArm.RETRACT)); |
| 42 | // Scheduler.getInstance().add(new TimeDrive(1, .6)); |
| 43 | // Scheduler.getInstance().add(new WaitCommand(1)); |
| 44 | // Scheduler.getInstance().add(new |
| 45 | // MoveIntakeArm(Constants.IntakeArm.EXTEND)); |
| 46 | Scheduler.getInstance().add(new Auton()); |
| 47 | } |
| 48 | |
| 49 | @Override |
| 50 | public void autonomousPeriodic() { |
| 51 | Scheduler.getInstance().run(); |
| 52 | } |
| 53 | |
| 54 | @Override |
| 55 | public void teleopInit() { |
| 56 | Scheduler.getInstance().add(new SetLowGear()); |
| 57 | } |
| 58 | |
| 59 | @Override |
| 60 | public void teleopPeriodic() { |
| 61 | Scheduler.getInstance().run(); |
| 62 | } |
| 63 | |
| 64 | } |