public static final int CATAPULT2_FORWARD = 0;
public static final int CATAPULT2_REVERSE = 1;
- public static final Value shoot = Value.kForward;
- public static final Value reset = Value.kReverse;
+ public static final Value SHOOT = Value.kForward;
+ public static final Value RESET = Value.kReverse;
public static final double WAIT_TIME = 2.0; // In seconds
}
package org.usfirst.frc.team3501.robot;
+import org.usfirst.frc.team3501.robot.Constants.IntakeArm;
import org.usfirst.frc.team3501.robot.commands.driving.SetHighGear;
import org.usfirst.frc.team3501.robot.commands.driving.SetLowGear;
import org.usfirst.frc.team3501.robot.commands.driving.ToggleFront;
extendIntake1 = new JoystickButton(leftJoystick,
Constants.OI.LEFT_JOYSTICK_EXTEND_INTAKE_1_PORT);
- extendIntake1.whenPressed(new MoveIntakeArm(Constants.IntakeArm.EXTEND));
+ extendIntake1.whenPressed(new MoveIntakeArm(IntakeArm.EXTEND));
extendIntake2 = new JoystickButton(leftJoystick,
Constants.OI.LEFT_JOYSTICK_EXTEND_INTAKE_2_PORT);
- extendIntake2.whenPressed(new MoveIntakeArm(Constants.IntakeArm.EXTEND));
+ extendIntake2.whenPressed(new MoveIntakeArm(IntakeArm.EXTEND));
retractIntake1 = new JoystickButton(leftJoystick,
Constants.OI.LEFT_JOYSTICK_RETRACT_INTAKE_1_PORT);
- retractIntake1.whenPressed(new MoveIntakeArm(Constants.IntakeArm.RETRACT));
+ retractIntake1.whenPressed(new MoveIntakeArm(IntakeArm.RETRACT));
retractIntake2 = new JoystickButton(leftJoystick,
Constants.OI.LEFT_JOYSTICK_RETRACT_INTAKE_2_PORT);
- retractIntake2.whenPressed(new MoveIntakeArm(Constants.IntakeArm.RETRACT));
+ retractIntake2.whenPressed(new MoveIntakeArm(IntakeArm.RETRACT));
toggleFront = new JoystickButton(leftJoystick,
Constants.OI.LEFT_JOYSTICK_TOGGLE_FRONT_PORT);
// Right joystick
intake = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_INTAKE_PORT);
- intake.whenPressed(new RunIntake(Constants.IntakeArm.IN));
- intake.whenReleased(new RunIntake(Constants.IntakeArm.STOP));
+ intake.whenPressed(new RunIntake(IntakeArm.IN));
+ intake.whenReleased(new RunIntake(IntakeArm.STOP));
outtake1 = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_OUTTAKE_1_PORT);
- outtake1.whenPressed(new RunIntake(Constants.IntakeArm.OUT));
- outtake1.whenReleased(new RunIntake(Constants.IntakeArm.STOP));
+ outtake1.whenPressed(new RunIntake(IntakeArm.OUT));
+ outtake1.whenReleased(new RunIntake(IntakeArm.STOP));
outtake2 = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_OUTTAKE_2_PORT);
- outtake2.whenPressed(new RunIntake(Constants.IntakeArm.OUT));
- outtake2.whenReleased(new RunIntake(Constants.IntakeArm.STOP));
+ outtake2.whenPressed(new RunIntake(IntakeArm.OUT));
+ outtake2.whenReleased(new RunIntake(IntakeArm.STOP));
shooterUp = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_SHOOTER_UP_PORT);
package org.usfirst.frc.team3501.robot.commands.intakearm;
-import org.usfirst.frc.team3501.robot.Constants;
+import org.usfirst.frc.team3501.robot.Constants.IntakeArm;
import org.usfirst.frc.team3501.robot.Robot;
import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
@Override
protected void initialize() {
- if (direction == Constants.IntakeArm.EXTEND)
+ if (direction == IntakeArm.EXTEND)
Robot.intakeArm.extendPistons();
else
Robot.intakeArm.retractPistons();
package org.usfirst.frc.team3501.robot.commands.intakearm;
-import org.usfirst.frc.team3501.robot.Constants;
+import org.usfirst.frc.team3501.robot.Constants.IntakeArm;
import org.usfirst.frc.team3501.robot.Robot;
import edu.wpi.first.wpilibj.command.Command;
@Override
protected void initialize() {
- if (direction == Constants.IntakeArm.IN)
+ if (direction == IntakeArm.IN)
Robot.intakeArm.intakeBall();
- else if (direction == Constants.IntakeArm.OUT)
+ else if (direction == IntakeArm.OUT)
Robot.intakeArm.outputBall();
else
Robot.intakeArm.stopRollers();
package org.usfirst.frc.team3501.robot.commands.shooter;
-import org.usfirst.frc.team3501.robot.Constants;
+import org.usfirst.frc.team3501.robot.Constants.Shooter;
import edu.wpi.first.wpilibj.command.CommandGroup;
import edu.wpi.first.wpilibj.command.WaitCommand;
public class Shoot extends CommandGroup {
- public boolean usePhotogate;
-
/**
* Fires catapult, then resets after a pause. If robot is set to use photogate
* and no ball is detected, nothing happens.
*/
public Shoot() {
addSequential(new FireCatapult());
- addSequential(new WaitCommand(Constants.Shooter.WAIT_TIME));
+ addSequential(new WaitCommand(Shooter.WAIT_TIME));
addSequential(new ResetCatapult());
}
}
intakeRoller = new CANTalon(Constants.IntakeArm.INTAKE_ROLLER_PORT);
leftIntake = new DoubleSolenoid(Constants.IntakeArm.LEFT_INTAKE_MODULE,
- Constants.IntakeArm.LEFT_INTAKE_FORWARD, Constants.IntakeArm.LEFT_INTAKE_REVERSE);
+ Constants.IntakeArm.LEFT_INTAKE_FORWARD,
+ Constants.IntakeArm.LEFT_INTAKE_REVERSE);
rightIntake = new DoubleSolenoid(Constants.IntakeArm.RIGHT_INTAKE_MODULE,
- Constants.IntakeArm.RIGHT_INTAKE_FORWARD, Constants.IntakeArm.RIGHT_INTAKE_REVERSE);
+ Constants.IntakeArm.RIGHT_INTAKE_FORWARD,
+ Constants.IntakeArm.RIGHT_INTAKE_REVERSE);
}
public void retractPistons() {
// Catapult Commands
public void fireCatapult() {
- catapult1.set(Constants.Shooter.shoot);
- catapult2.set(Constants.Shooter.shoot);
+ catapult1.set(Constants.Shooter.SHOOT);
+ catapult2.set(Constants.Shooter.SHOOT);
}
public void resetCatapult() {
- catapult1.set(Constants.Shooter.reset);
- catapult2.set(Constants.Shooter.reset);
+ catapult1.set(Constants.Shooter.RESET);
+ catapult2.set(Constants.Shooter.RESET);
}
@Override