public static final int PUNCH_REVERSE = 1;
public static final int ANGLE_ADJUSTER_PORT = 0;
- public static final DoubleSolenoid.Value punch = DoubleSolenoid.Value.kForward;
- public static final DoubleSolenoid.Value retract = DoubleSolenoid.Value.kReverse;
+ public static final DoubleSolenoid.Value punch = DoubleSolenoid.Value.kReverse;
+ public static final DoubleSolenoid.Value retract = DoubleSolenoid.Value.kForward;
// Encoder port
- public static final int ENCODER_PORT_A = 0;
- public static final int ENCODER_PORT_B = 0;
+ public static final int ENCODER_PORT_A = 4;
+ public static final int ENCODER_PORT_B = 5;
public static final int RIGHT_HOOD_FORWARD = 2;
public static final int RIGHT_HOOD_REVERSE = 4;
public static final int LEFT_HOOD_FORWARD = 4;
public static final double DEFAULT_SHOOTER_SPEED = 0.5;
- public static final Value open = Value.kReverse;
- public static final Value closed = Value.kForward;
+ public static final Value open = Value.kForward;
+ public static final Value closed = Value.kReverse;
public static final Port LIDAR_I2C_PORT = I2C.Port.kMXP;
package org.usfirst.frc.team3501.robot;
import org.usfirst.frc.team3501.robot.commands.driving.ChangeGear;
+import org.usfirst.frc.team3501.robot.commands.shooter.Shoot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.buttons.Button;
rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT);
toggleGear = new JoystickButton(leftJoystick,
- Constants.OI.LEFT_JOYSTICK_TRIGGER_PORT);
+ Constants.OI.LEFT_JOYSTICK_TOP_CENTER_PORT);
toggleGear.toggleWhenPressed(new ChangeGear());
+ shootBoulder = new JoystickButton(leftJoystick,
+ Constants.OI.LEFT_JOYSTICK_TRIGGER_PORT);
+ shootBoulder.whenPressed(new Shoot());
+
// passPortcullis = new DigitalButton(
// new DigitalInput(Constants.OI.PASS_PORTCULLIS_PORT));
// passPortcullis.whenPressed(new PassPortcullis());
driveTrain = new DriveTrain();
oi = new OI();
+ shooter = new Shooter();
+
// shooter = new Shooter();
// scaler = new Scaler();
// intakeArm = new IntakeArm();
SmartDashboard
.putData("Position Five Defense Chooser", positionFiveDefense);
- shooter = new Shooter();
-
}
@Override
@Override
public void teleopInit() {
Robot.driveTrain.setLowGear();
+ Robot.shooter.raiseHood();
}
@Override
public void teleopPeriodic() {
Scheduler.getInstance().run();
if (OI.rightJoystick.getTrigger()) {
- Robot.shooter.setSpeed(1);
+ Robot.shooter.setSpeed(.8);
} else {
Robot.shooter.setSpeed(0);
}
+ if (OI.rightJoystick.getRawButton(2)) {
+ Robot.shooter.extendPunch();
+ } else {
+ Robot.shooter.retractPunch();
+
+ }
}
}
package org.usfirst.frc.team3501.robot.commands.shooter;
-import org.usfirst.frc.team3501.robot.Robot;
-
import edu.wpi.first.wpilibj.command.CommandGroup;
import edu.wpi.first.wpilibj.command.WaitCommand;
public boolean usePhotogate;
public Shoot() {
+ addSequential(new StartShooter());
addSequential(new WaitCommand(3.0));
- addSequential(new runShooter());
- addSequential(new WaitCommand(3.0));
- if (Robot.shooter.usePhotogate()) {
- if (Robot.shooter.isBallInside()) {
- addSequential(new ExtendPunch());
- addSequential(new WaitCommand(5.0));
- addSequential(new RetractPunch());
- }
- } else {
- addSequential(new ExtendPunch());
- addSequential(new WaitCommand(5.0));
- addSequential(new RetractPunch());
- }
+ // if (Robot.shooter.usePhotogate()) {
+ // if (Robot.shooter.isBallInside()) {
+ // addSequential(new ExtendPunch());
+ // addSequential(new WaitCommand(5.0));
+ // addSequential(new RetractPunch());
+ // addSequential(new StopShooter());
+ // }
+ // } else {
+ addSequential(new ExtendPunch());
+ addSequential(new WaitCommand(5.0));
+ addSequential(new RetractPunch());
+ addSequential(new StopShooter());
+ // }
}
}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.shooter;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/**
+ *
+ */
+public class StartShooter extends Command {
+
+ public StartShooter() {
+
+ }
+
+ // default shooter speed is used to shoot when in front of the batter
+ @Override
+ protected void initialize() {
+ Robot.shooter.setSpeed(0.5);
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return true;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.shooter;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/**
+ *
+ */
+public class StopShooter extends Command {
+
+ public StopShooter() {
+
+ }
+
+ // default shooter speed is used to shoot when in front of the batter
+ @Override
+ protected void initialize() {
+ Robot.shooter.setSpeed(0);
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return true;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands.shooter;
-
-import org.usfirst.frc.team3501.robot.Robot;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/**
- *
- */
-public class runShooter extends Command {
-
- public runShooter() {
-
- }
-
- // default shooter speed is used to shoot when in front of the batter
- @Override
- protected void initialize() {
- Robot.shooter.setSpeed(0.5);
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return true;
- }
-
- @Override
- protected void end() {
- Robot.shooter.stop();
- }
-
- @Override
- protected void interrupted() {
- }
-}