diff --git a/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/HatchFlip.java b/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/DeployHatchIntake.java similarity index 60% rename from 2019robot/src/main/java/org/usfirst/frc4388/robot/commands/HatchFlip.java rename to 2019robot/src/main/java/org/usfirst/frc4388/robot/commands/DeployHatchIntake.java index 29c5a71..d3b4c3d 100644 --- a/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/HatchFlip.java +++ b/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/DeployHatchIntake.java @@ -3,21 +3,19 @@ package org.usfirst.frc4388.robot.commands; import org.usfirst.frc4388.robot.Robot; import edu.wpi.first.wpilibj.command.Command; -/** - * @deprecated use HatchAndBallSet insted for all setting of hatch and ball intakes - */ -public class HatchFlip extends Command + +public class DeployHatchIntake extends Command { - public boolean PickingUp; + public boolean deployed; - public HatchFlip(boolean PickingUP) { - this.PickingUp=PickingUP; + public DeployHatchIntake(boolean deployed) { + this.deployed = !deployed; requires(Robot.pnumatics); } @Override protected void initialize() { - Robot.pnumatics.setHatchIntakeState(PickingUp); + Robot.pnumatics.setHatchIntakeState(deployed); } @Override diff --git a/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/HatchAndBallSet.java b/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/HatchAndBallSet.java index 922413f..b034036 100644 --- a/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/HatchAndBallSet.java +++ b/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/HatchAndBallSet.java @@ -10,52 +10,24 @@ package org.usfirst.frc4388.robot.commands; import org.usfirst.frc4388.robot.Robot; import org.usfirst.frc4388.robot.subsystems.Pneumatics; -import edu.wpi.first.wpilibj.command.Command; +import edu.wpi.first.wpilibj.command.CommandGroup; -/** - * Sets the hatch intake and ball intake to the boolean values passed in. - * This will have no effect if called and both subsystems are already in the desired state. - * @param hatch true is deployed, false is undeployed - * @param ball true is deployed, false is undeployed - */ +public class HatchAndBallSet extends CommandGroup { -public class HatchAndBallSet extends Command { - - private boolean hatchposition; - private boolean ballposition; + private boolean hatch; + private boolean ball; + /** + * Sets the hatch intake and ball intake to the boolean values passed in. + * This will have no effect if called and both subsystems are already in the desired state. + * @param hatch true is deploy, false is undeploy + * @param ball true is deploy, false is undeploy + */ public HatchAndBallSet(boolean hatch, boolean ball) { requires(Robot.pnumatics); - hatchposition = !hatch; - ballposition = ball; - } - - // Called just before this Command runs the first time - @Override - protected void initialize() { - Robot.pnumatics.setBallIntake(ballposition); - Robot.pnumatics.setHatchIntakeState(hatchposition); - } - - // Called repeatedly when this Command is scheduled to run - @Override - protected void execute() { - } - - // Make this return true when this Command no longer needs to run execute() - @Override - protected boolean isFinished() { - return false; - } - - // Called once after isFinished returns true - @Override - protected void end() { - } - - // Called when another command which requires one or more of the same - // subsystems is scheduled to run - @Override - protected void interrupted() { + this.hatch = hatch; + this.ball = ball; + addSequential(new DeployHatchIntake(hatch)); + addParallel(new DeployBallIntake(ball)); } } \ No newline at end of file diff --git a/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/HatchAndBallUp.java b/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/HatchAndBallUp.java index 15cdb27..b24b0fb 100644 --- a/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/HatchAndBallUp.java +++ b/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/HatchAndBallUp.java @@ -16,7 +16,7 @@ public class HatchAndBallUp extends CommandGroup { * Add your docs here. */ public HatchAndBallUp() { - addSequential(new HatchFlip(true)); + addSequential(new DeployHatchIntake(true)); addParallel(new DeployBallIntake(false)); // e.g. addSequential(new Command1()); // addSequential(new Command2()); diff --git a/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/LiftBallDropHatch.java b/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/LiftBallDropHatch.java index 26cd35b..8b57460 100644 --- a/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/LiftBallDropHatch.java +++ b/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/LiftBallDropHatch.java @@ -16,7 +16,7 @@ public class LiftBallDropHatch extends CommandGroup { * Add your docs here. */ public LiftBallDropHatch() { - addSequential(new HatchFlip(false)); + addSequential(new DeployHatchIntake(false)); addParallel(new DeployBallIntake(false)); // Add Commands here: // e.g. addSequential(new Command1()); diff --git a/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/LiftHatchDropBall.java b/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/LiftHatchDropBall.java index 6ec9a9b..70f2344 100644 --- a/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/LiftHatchDropBall.java +++ b/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/LiftHatchDropBall.java @@ -16,7 +16,7 @@ public class LiftHatchDropBall extends CommandGroup { * Add your docs here. */ public LiftHatchDropBall() { - addSequential(new HatchFlip(true)); + addSequential(new DeployHatchIntake(true)); addParallel(new DeployBallIntake(true)); // Add Commands here: // e.g. addSequential(new Command1());