diff --git a/org/bitbuckets/frc2014/RobotMain.java b/org/bitbuckets/frc2014/RobotMain.java index d522dd8..5fac9c4 100644 --- a/org/bitbuckets/frc2014/RobotMain.java +++ b/org/bitbuckets/frc2014/RobotMain.java @@ -20,6 +20,8 @@ * @author Default */ public class RobotMain extends IterativeRobot { + /** Autonomous command **/ + private Command autonCommand; /** The compressor. */ private Compressor compressor = new Compressor(RobotMap.PRESSURE_SWITCH, RobotMap.COMPRESSOR_RELAY); @@ -40,12 +42,15 @@ public void robotInit() { CommandBase.oi.intakeButton.whenPressed(new IntakeBall()); CommandBase.oi.intakeButton.whenReleased(new IntakeBallOff()); //CommandBase.oi.lightsOnOffButton.whenPressed(new SimpleLights()); + + autonCommand = new TwoBallAuto(); } /** * The method run when autonomous is started. */ public void autonomousInit() { + autonCommand.start(); } /** diff --git a/org/bitbuckets/frc2014/commands/TwoBallAuto.java b/org/bitbuckets/frc2014/commands/TwoBallAuto.java new file mode 100644 index 0000000..21ebea6 --- /dev/null +++ b/org/bitbuckets/frc2014/commands/TwoBallAuto.java @@ -0,0 +1,39 @@ +/* FRC 4183 - The Bit Buckets + * Tucson, AZ + * + * FRC 2014 Codebase + */ + +package org.bitbuckets.frc2014.commands; + +/** + * @author Cal Miller cal@bpmpc.net + * + * + */ + +import edu.wpi.first.wpilibj.command.CommandGroup; + +/** + * + * @author Cal Miller + */ +public class TwoBallAuto extends CommandGroup { + public TwoBallAuto() { + //need to change Fire and ArmCatapult commands. I'm using them as suggested in issue #25 on Github. + addSequential(new ArmCatapult()); + addSequential(new DriveStraight(24,36)); + addSequential(new Fire()); + addSequential(new RollerOn()); + addSequential(new WaitMillis(1000)); + addSequential(new RetractIntake()); + addSequential(new WaitMillis(500)); + addSequential(new ArmCatapult()); + addSequential(new Fire()); + addSequential(new DriveStraight(36,36)); + addParallel(new RetractIntake()); + addSequential(new DriveTurn(180,270)); + + } + +}