X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F2017steamworks;a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fshooter%2FReverseIndexWheelContinuous.java;h=6c6400efb4c9a8fc6dc093420e9820678ef02a93;hp=4cb18f9b28b8e57061b62c3758a5ef357a975591;hb=f74d236db406193b851bff99e4daec7b7abf35e7;hpb=8275a069e1891bd27156dcd947a897519c42a3a3 diff --git a/src/org/usfirst/frc/team3501/robot/commands/shooter/ReverseIndexWheelContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/shooter/ReverseIndexWheelContinuous.java index 4cb18f9..6c6400e 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/shooter/ReverseIndexWheelContinuous.java +++ b/src/org/usfirst/frc/team3501/robot/commands/shooter/ReverseIndexWheelContinuous.java @@ -20,6 +20,9 @@ import edu.wpi.first.wpilibj.command.Command; public class ReverseIndexWheelContinuous extends Command { private Shooter shooter = Robot.getShooter(); + private double previousMotorValue = 0; + private double targetMotorValue = -shooter.DEFAULT_INDEXING_MOTOR_VALUE; + /** * See JavaDoc comment in class for details * @@ -27,7 +30,6 @@ public class ReverseIndexWheelContinuous extends Command { * value range from -1 to 1 */ public ReverseIndexWheelContinuous() { - requires(shooter); } // Called just before this Command runs the first time @@ -38,7 +40,9 @@ public class ReverseIndexWheelContinuous extends Command { // Called repeatedly when this Command is scheduled to run @Override protected void execute() { - shooter.reverseIndexWheel(); + double motorValue = (6 * previousMotorValue + targetMotorValue) / 7; + previousMotorValue = motorValue; + shooter.setIndexWheelMotorVal(motorValue); } // Called once after isFinished returns true