import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import org.usfirst.frc.team3501.robot.autons.*;
+import org.usfirst.frc.team3501.robot.commands.*;
import org.usfirst.frc.team3501.robot.subsystems.*;
public class Robot extends IterativeRobot {
- public static final Drivetrain drivetrain = new Drivetrain();
- public static final Arm arm = new Arm();
- public static final Claw claw = new Claw();
+ public static Drivetrain drivetrain;
+ public static Arm arm;
+ public static Claw claw;
+
+ public static Pneumatics pneumatics;
public static OI oi;
public void robotInit() {
oi = new OI();
+ drivetrain = new Drivetrain();
+ arm = new Arm();
+ claw = new Claw();
+
+ pneumatics = new Pneumatics();
+
chooseAuto();
}
}
public void autonomousInit() {
+ schedule(new TurnOnCompressor());
+
autonomousCommand = (Command) autoChooser.getSelected();
autonomousCommand.start();
}
}
public void teleopInit() {
+ schedule(new TurnOnCompressor());
+
autonomousCommand.cancel();
}
private void chooseAuto() {
autoChooser = new SendableChooser();
- autoChooser.addDefault("Drive over step", new DriveOverStep());
- autoChooser.addObject("Drive past step", new DrivePastStep());
+ autoChooser.addDefault("Pick up container", new ContainerOverStep());
+ autoChooser.addObject("Drive over step", new DriveOverStep());
+ autoChooser.addObject("Drive past step", new DrivePastStep());
SmartDashboard.putData("Auto Mode", autoChooser);
}
+
+ private void schedule(Command c) {
+ Scheduler.getInstance().add(c);
+ }
}