projects
/
3501
/
2017steamworks
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
competition fixes
[3501/2017steamworks]
/
src
/
org
/
usfirst
/
frc
/
team3501
/
robot
/
commands
/
shooter
/
RunIndexWheelContinuous.java
diff --git
a/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java
b/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java
index 815577e24d63cfde14158f23d4d66400b75a636e..1cd3e772762b5cdf6907338997a73fdc4973dde2 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java
+++ b/
src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java
@@
-20,11
+20,13
@@
import edu.wpi.first.wpilibj.command.Command;
public class RunIndexWheelContinuous extends Command {
private Shooter shooter = Robot.getShooter();
public class RunIndexWheelContinuous 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
*/
public RunIndexWheelContinuous() {
/**
* See JavaDoc comment in class for details
*/
public RunIndexWheelContinuous() {
- requires(shooter);
}
@Override
}
@Override
@@
-36,8
+38,11
@@
public class RunIndexWheelContinuous extends Command {
double shooterSpeed = shooter.getShooterRPM();
double targetShooterSpeed = shooter.getTargetShootingSpeed();
double threshold = shooter.getRPMThreshold();
double shooterSpeed = shooter.getShooterRPM();
double targetShooterSpeed = shooter.getTargetShootingSpeed();
double threshold = shooter.getRPMThreshold();
- if (Math.abs(shooterSpeed - targetShooterSpeed) <= threshold)
- shooter.runIndexWheel();
+ if (Math.abs(shooterSpeed - targetShooterSpeed) <= threshold) {
+ double motorValue = (6 * previousMotorValue + targetMotorValue) / 7;
+ previousMotorValue = motorValue;
+ shooter.setIndexWheelMotorVal(motorValue);
+ }
}
@Override
}
@Override