From f41ea7b569e35fba4657faa61ae91ae0396bbd02 Mon Sep 17 00:00:00 2001 From: z-beeblebrox Date: Sun, 16 Feb 2014 08:44:49 -0700 Subject: [PATCH 1/2] Added script for two ball autonomous mode. --- org/bitbuckets/frc2014/RobotMain.java | 1 + .../frc2014/commands/TwoBallAuto.java | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 org/bitbuckets/frc2014/commands/TwoBallAuto.java diff --git a/org/bitbuckets/frc2014/RobotMain.java b/org/bitbuckets/frc2014/RobotMain.java index d522dd8..f61cc67 100644 --- a/org/bitbuckets/frc2014/RobotMain.java +++ b/org/bitbuckets/frc2014/RobotMain.java @@ -46,6 +46,7 @@ public void robotInit() { * The method run when autonomous is started. */ public void autonomousInit() { + Scheduler.getInstance().add(new TwoBallAuto()); } /** 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)); + + } + +} From 3683d2d2682296b2dc483a53a6619280bc5e8cd0 Mon Sep 17 00:00:00 2001 From: z-beeblebrox Date: Sun, 16 Feb 2014 10:10:54 -0700 Subject: [PATCH 2/2] Fixed how autonomous command is run. --- org/bitbuckets/frc2014/RobotMain.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/org/bitbuckets/frc2014/RobotMain.java b/org/bitbuckets/frc2014/RobotMain.java index f61cc67..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,13 +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() { - Scheduler.getInstance().add(new TwoBallAuto()); + autonCommand.start(); } /**