From 3082b8095b18f21683ac5f79492d7d4503ec05d4 Mon Sep 17 00:00:00 2001 From: Meryem Esa Date: Tue, 15 Mar 2016 18:49:37 -0700 Subject: [PATCH] use wait command and move if statements from shoot at high goal to resetcatapult --- .../frc/team3501/robot/commands/shooter/ResetCatapult.java | 5 +++++ .../frc/team3501/robot/commands/shooter/ShootAtHighGoal.java | 3 ++- src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) 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); -- 2.30.2