X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F2017steamworks;a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fshooter%2FRunFlyWheelContinuous.java;h=86c31f7eecd523ebc2a274a6b4d1d58bb74d45ed;hp=b4fd8df96dbdf36cda2bb986d7929e22ab4564aa;hb=7ba6bc91b8cf7205e05cdb974dc80fdd668ebe59;hpb=05a85c826dc9e393184e275264b70caef5b7676a diff --git a/src/org/usfirst/frc/team3501/robot/commands/shooter/RunFlyWheelContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/shooter/RunFlyWheelContinuous.java index b4fd8df..86c31f7 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/shooter/RunFlyWheelContinuous.java +++ b/src/org/usfirst/frc/team3501/robot/commands/shooter/RunFlyWheelContinuous.java @@ -1,40 +1,53 @@ package org.usfirst.frc.team3501.robot.commands.shooter; +import org.usfirst.frc.team3501.robot.Robot; +import org.usfirst.frc.team3501.robot.subsystems.Shooter; +import org.usfirst.frc.team3501.robot.utils.PIDController; + import edu.wpi.first.wpilibj.command.Command; /** - * Runs fly wheel continuously until ________ + * This command runs the fly wheel continuously at a set speed using a PID + * Controller when OI button managing fly wheel is pressed. The command will run + * the fly wheel motor until the button triggering it is released. + * + * Should only be run from the operator interface. + * + * pre-condition: This command must be run by a button in OI, with + * button.whileHeld(...). + * + * @author Shaina & Chris */ public class RunFlyWheelContinuous extends Command { - public RunFlyWheelContinuous() { + private Shooter shooter = Robot.getShooter(); - } + private PIDController wheelController; - // Called just before this Command runs the first time - @Override - protected void initialize() { - } + public RunFlyWheelContinuous() { + } - // Called repeatedly when this Command is scheduled to run - @Override - protected void execute() { - } + @Override + protected void initialize() { + shooter.initializePIDController(); + } - // Called once after isFinished returns true - @Override - protected void end() { - } + @Override + protected void execute() { + shooter.setFlyWheelMotorVal(shooter.calculateShooterSpeed()); + } - // Called when another command which requires one or more of the same - // subsystems is scheduled to run - @Override - protected void interrupted() { - } + @Override + protected boolean isFinished() { + return false; + } - @Override - protected boolean isFinished() { - // TODO Auto-generated method stub - return false; - } + @Override + protected void end() { + this.shooter.stopFlyWheel(); + } + @Override + protected void interrupted() { + end(); + } }