package org.usfirst.frc.team3501.robot.commands.shooter;
+import org.usfirst.frc.team3501.robot.Robot;
+import org.usfirst.frc.team3501.robot.subsystems.Shooter;
+
import edu.wpi.first.wpilibj.command.Command;
/**
* flywheel is run, it will run at the decreased shooting speed
*/
public class DecreaseShootingSpeed extends Command {
+ private Shooter shooter = Robot.getShooter();
+
public DecreaseShootingSpeed() {
}
- // Called just before this Command runs the first time
@Override
protected void initialize() {
+ shooter.CURRENT_SHOOTING_SPEED -= shooter.SHOOTING_SPEED_INCREMENT;
+
}
- // Called repeatedly when this Command is scheduled to run
@Override
protected void execute() {
}
- // 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() {
+ end();
}
@Override
protected boolean isFinished() {
- // TODO Auto-generated method stub
- return false;
+ return true;
+
}
}
package org.usfirst.frc.team3501.robot.commands.shooter;
+import org.usfirst.frc.team3501.robot.Robot;
+import org.usfirst.frc.team3501.robot.subsystems.Shooter;
+
import edu.wpi.first.wpilibj.command.Command;
/**
* flywheel is run, it will run at the increased shooting speed
*/
public class IncreaseShootingSpeed extends Command {
+ private Shooter shooter = Robot.getShooter();
+
public IncreaseShootingSpeed() {
}
- // Called just before this Command runs the first time
@Override
protected void initialize() {
+ shooter.CURRENT_SHOOTING_SPEED += shooter.SHOOTING_SPEED_INCREMENT;
}
- // Called repeatedly when this Command is scheduled to run
@Override
protected void execute() {
}
- // 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() {
+ end();
}
@Override
protected boolean isFinished() {
- // TODO Auto-generated method stub
- return false;
+
+ return true;
}
}
package org.usfirst.frc.team3501.robot.commands.shooter;
import org.usfirst.frc.team3501.robot.Robot;
+import org.usfirst.frc.team3501.robot.subsystems.Shooter;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.command.Command;
* @author Shaina
*/
public class RunFlyWheel extends Command {
+ private Shooter shooter = Robot.getShooter();
Timer timer;
- private double motorVal;
private double time;
/**
* @param time
* in seconds, amount of time to run fly wheel motor
*/
- public RunFlyWheel(double motorVal, double time) {
- requires(Robot.getShooter());
+ public RunFlyWheel(double time) {
+ requires(shooter);
timer = new Timer();
- this.motorVal = motorVal;
this.time = time;
}
@Override
protected void initialize() {
timer.start();
- Robot.getShooter().setFlyWheelMotorVal(motorVal);
+ shooter.setFlyWheelMotorVal(shooter.CURRENT_SHOOTING_SPEED);
}
// Called repeatedly when this Command is scheduled to run
// Called once after isFinished returns true
@Override
protected void end() {
- Robot.getShooter().stopFlyWheel();
+ shooter.stopFlyWheel();
}
// Called when another command which requires one or more of the same
package org.usfirst.frc.team3501.robot.commands.shooter;
import org.usfirst.frc.team3501.robot.Robot;
+import org.usfirst.frc.team3501.robot.subsystems.Shooter;
import edu.wpi.first.wpilibj.command.Command;
* @author Shaina
*/
public class RunIndexWheelContinuous extends Command {
- private double motorVal;
+ private Shooter shooter = Robot.getShooter();
/**
* See JavaDoc comment in class for details
* @param motorVal
* value range from -1 to 1
*/
- public RunIndexWheelContinuous(double motorVal) {
- this.motorVal = motorVal;
+ public RunIndexWheelContinuous() {
+
}
// Called just before this Command runs the first time
@Override
protected void initialize() {
- Robot.getShooter().setIndexWheelMotorVal(motorVal);
+ shooter.setIndexWheelMotorVal(shooter.CURRENT_SHOOTING_SPEED);
}
// Called repeatedly when this Command is scheduled to run
private static Shooter shooter;
private final CANTalon flyWheel, indexWheel;
+ public static final double DEFAULT_SHOOTING_SPEED = 0;
+ public static double CURRENT_SHOOTING_SPEED;
+
+ public static final double SHOOTING_SPEED_INCREMENT = 0;
+
private Shooter() {
flyWheel = new CANTalon(Constants.Shooter.FLY_WHEEL);
indexWheel = new CANTalon(Constants.Shooter.INDEX_WHEEL);
+
}
/**