2 package org
.usfirst
.frc
.team3501
.robot
;
4 import edu
.wpi
.first
.wpilibj
.IterativeRobot
;
5 import edu
.wpi
.first
.wpilibj
.command
.Command
;
6 import edu
.wpi
.first
.wpilibj
.command
.Scheduler
;
7 import edu
.wpi
.first
.wpilibj
.livewindow
.LiveWindow
;
8 import edu
.wpi
.first
.wpilibj
.smartdashboard
.SendableChooser
;
9 import edu
.wpi
.first
.wpilibj
.smartdashboard
.SmartDashboard
;
11 import org
.usfirst
.frc
.team3501
.robot
.autons
.*;
12 import org
.usfirst
.frc
.team3501
.robot
.commands
.*;
13 import org
.usfirst
.frc
.team3501
.robot
.subsystems
.*;
15 public class Robot
extends IterativeRobot
{
17 public static Drivetrain drivetrain
;
18 public static Arm arm
;
19 public static Claw claw
;
21 public static Pneumatics pneumatics
;
25 public static AutonData autonData
;
27 private SendableChooser autonChooser
;
28 private Command autonomousCommand
;
30 public void robotInit() {
33 drivetrain
= new Drivetrain();
37 pneumatics
= new Pneumatics();
39 autonData
= new AutonData();
44 public void disabledPeriodic() {
45 Scheduler
.getInstance().run();
48 public void autonomousInit() {
49 schedule(new TurnOnCompressor());
53 autonomousCommand
= (Command
) autonChooser
.getSelected();
54 autonomousCommand
.start();
57 public void autonomousPeriodic() {
58 Scheduler
.getInstance().run();
61 public void teleopInit() {
62 schedule(new TurnOnCompressor());
64 autonomousCommand
.cancel();
67 public void teleopPeriodic() {
68 Scheduler
.getInstance().run();
71 public void testPeriodic() {
75 private void chooseAuto() {
76 autonChooser
= new SendableChooser();
78 autonChooser
.addDefault("Pick up container", new ContainerOverStep());
79 autonChooser
.addObject("Drive over step", new DriveOverStep());
80 autonChooser
.addObject("Drive past step", new DrivePastStep());
82 SmartDashboard
.putData("Auto Mode", autonChooser
);
85 private void schedule(Command c
) {
86 Scheduler
.getInstance().add(c
);