public static enum State {
RUNNING, STOPPED;
}
+
+ public static double TESTING_SHOOTER_SPEED = 0.5;
}
public static class IntakeArm {
package org.usfirst.frc.team3501.robot;
+import org.usfirst.frc.team3501.robot.commands.shooter.ChangeShooterSpeed;
import org.usfirst.frc.team3501.robot.commands.shooter.PrintData;
import org.usfirst.frc.team3501.robot.commands.shooter.RecordData;
-import org.usfirst.frc.team3501.robot.commands.shooter.Test1;
-import org.usfirst.frc.team3501.robot.commands.shooter.Test2;
-import org.usfirst.frc.team3501.robot.commands.shooter.Test3;
+import org.usfirst.frc.team3501.robot.commands.shooter.Shoot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.buttons.Button;
shoot = new JoystickButton(leftJoystick,
Constants.OI.LEFT_JOYSTICK_TRIGGER_PORT);
- shoot.whenPressed(new Test1());
+ shoot.whenPressed(new Shoot());
incrementSpeed = new JoystickButton(leftJoystick,
Constants.OI.LEFT_JOYSTICK_TOP_CENTER_PORT);
- incrementSpeed.whenPressed(new Test2());
+ incrementSpeed.whenPressed(new ChangeShooterSpeed(0.1));
decrementSpeed = new JoystickButton(leftJoystick,
Constants.OI.LEFT_JOYSTICK_TOP_LOW_PORT);
- decrementSpeed.whenPressed(new Test3());
+ decrementSpeed.whenPressed(new ChangeShooterSpeed(-0.1));
printData = new JoystickButton(leftJoystick,
Constants.OI.SPIN2_PORT);
package org.usfirst.frc.team3501.robot.commands.shooter;
+import org.usfirst.frc.team3501.robot.Constants;
import org.usfirst.frc.team3501.robot.Robot;
import edu.wpi.first.wpilibj.command.Command;
@Override
protected void initialize() {
Robot.shooter.changeSpeed(change);
+ Constants.Shooter.TESTING_SHOOTER_SPEED += change;
}
@Override
@Override
protected void initialize() {
+ requires(Robot.shooter);
Robot.shooter.extendPunch();
}
public class Shoot extends CommandGroup {
- public boolean usePhotogate;
+ public boolean usePhotogate = false;
public Shoot() {
- addSequential(new WaitCommand(3.0));
addSequential(new runShooter());
addSequential(new WaitCommand(3.0));
if (Robot.shooter.usePhotogate()) {
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands.shooter;
-
-import edu.wpi.first.wpilibj.command.CommandGroup;
-
-/**
- *
- */
-public class Test1 extends CommandGroup {
-
- public Test1() {
- addSequential(new Shoot());
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands.shooter;
-
-import edu.wpi.first.wpilibj.command.CommandGroup;
-
-/**
- *
- */
-public class Test2 extends CommandGroup {
-
- public Test2() {
- addSequential(new ChangeShooterSpeed(0.05));
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands.shooter;
-
-import edu.wpi.first.wpilibj.command.CommandGroup;
-
-/**
- *
- */
-public class Test3 extends CommandGroup {
-
- public Test3() {
- addSequential(new ChangeShooterSpeed(-0.05));
- }
-}
package org.usfirst.frc.team3501.robot.commands.shooter;
+import org.usfirst.frc.team3501.robot.Constants;
import org.usfirst.frc.team3501.robot.Robot;
import edu.wpi.first.wpilibj.command.Command;
public class runShooter extends Command {
public runShooter() {
-
+ requires(Robot.shooter);
}
// default shooter speed is used to shoot when in front of the batter
@Override
protected void initialize() {
- Robot.shooter.setSpeed(0.5);
+ Robot.shooter.setSpeed(Constants.Shooter.TESTING_SHOOTER_SPEED);
}
@Override