From: Meryem Esa Date: Wed, 16 Mar 2016 01:49:37 +0000 (-0700) Subject: use wait command and move if statements from shoot at high goal to resetcatapult X-Git-Url: http://challenge-bot.com/repos/?p=3501%2Fstronghold-2016;a=commitdiff_plain;h=3082b8095b18f21683ac5f79492d7d4503ec05d4 use wait command and move if statements from shoot at high goal to resetcatapult --- diff --git a/src/org/usfirst/frc/team3501/robot/commands/shooter/ResetCatapult.java b/src/org/usfirst/frc/team3501/robot/commands/shooter/ResetCatapult.java index 3c46bf4d..0651ce8f 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/shooter/ResetCatapult.java +++ b/src/org/usfirst/frc/team3501/robot/commands/shooter/ResetCatapult.java @@ -5,6 +5,11 @@ import org.usfirst.frc.team3501.robot.Robot; import edu.wpi.first.wpilibj.command.Command; +/*** + * + * This command will retract the catapult pistons. + * + */ public class ResetCatapult extends Command { public ResetCatapult() { diff --git a/src/org/usfirst/frc/team3501/robot/commands/shooter/ShootAtHighGoal.java b/src/org/usfirst/frc/team3501/robot/commands/shooter/ShootAtHighGoal.java index 70817273..6d15cde8 100755 --- a/src/org/usfirst/frc/team3501/robot/commands/shooter/ShootAtHighGoal.java +++ b/src/org/usfirst/frc/team3501/robot/commands/shooter/ShootAtHighGoal.java @@ -14,6 +14,7 @@ import edu.wpi.first.wpilibj.command.WaitCommand; * post-conditions: catapult is retracted, intake is extended */ public class ShootAtHighGoal extends CommandGroup { + private static final double WAIT_SECONDS = 0.4; public ShootAtHighGoal() { // make sure catapult is down @@ -29,7 +30,7 @@ public class ShootAtHighGoal extends CommandGroup { addSequential(new MoveIntakeArm(IntakeArm.EXTEND)); // wait a bit - addSequential(new WaitCommand(1.0)); + addSequential(new WaitCommand(WAIT_SECONDS)); // retract catapult pistons addSequential(new ResetCatapult()); diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java index c3500e2b..ef24614d 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java @@ -34,6 +34,7 @@ public class Shooter extends Subsystem { catapult2.set(Constants.Shooter.SHOOT); } + // Retracts catapult pistons public void resetCatapult() { catapult1.set(Constants.Shooter.RESET); catapult2.set(Constants.Shooter.RESET);