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 private SendableChooser autoChooser
;
27 private Command autonomousCommand
;
29 public void robotInit() {
32 drivetrain
= new Drivetrain();
36 pneumatics
= new Pneumatics();
41 public void disabledPeriodic() {
42 Scheduler
.getInstance().run();
45 public void autonomousInit() {
46 schedule(new TurnOnCompressor());
48 autonomousCommand
= (Command
) autoChooser
.getSelected();
49 autonomousCommand
.start();
52 public void autonomousPeriodic() {
53 Scheduler
.getInstance().run();
56 public void teleopInit() {
57 schedule(new TurnOnCompressor());
59 autonomousCommand
.cancel();
62 public void teleopPeriodic() {
63 Scheduler
.getInstance().run();
66 public void testPeriodic() {
70 public void disabledInit() {
71 schedule(new TurnOffCompressor());
74 private void chooseAuto() {
75 autoChooser
= new SendableChooser();
77 autoChooser
.addDefault("Pick up container", new ContainerOverStep());
78 autoChooser
.addObject("Drive over step", new DriveOverStep());
79 autoChooser
.addObject("Drive past step", new DrivePastStep());
81 SmartDashboard
.putData("Auto Mode", autoChooser
);
84 private void schedule(Command c
) {
85 Scheduler
.getInstance().add(c
);