<commit_before>package edu.neu.nutrons.reboundrumble;

import edu.neu.nutrons.lib.DualButton;
import edu.neu.nutrons.lib.ReverseButton;
import edu.neu.nutrons.lib.Utils;
import edu.neu.nutrons.reboundrumble.commands.CommandBase;
import edu.neu.nutrons.reboundrumble.commands.drivetrain.DTManualCheesyCmd;
import edu.neu.nutrons.reboundrumble.commands.drivetrain.DTManualCreepToTargetCmd;
import edu.neu.nutrons.reboundrumble.commands.elevator.ElevatorHopperCmd;
import edu.neu.nutrons.reboundrumble.commands.elevator.ElevatorShooterCmd;
import edu.neu.nutrons.reboundrumble.commands.elevator.ElevatorSpitCmd;
import edu.neu.nutrons.reboundrumble.commands.elevator.ElevatorToggleSquishEnabledCmd;
import edu.neu.nutrons.reboundrumble.commands.intake.IntakeSetCmd;
import edu.neu.nutrons.reboundrumble.commands.shifter.ShifterStaticCmd;
import edu.neu.nutrons.reboundrumble.commands.shooter.ShooterDeltaRateCmd;
import edu.neu.nutrons.reboundrumble.commands.shooter.ShooterSetPowerCmd;
import edu.neu.nutrons.reboundrumble.subsystems.Shifter;
import edu.neu.nutrons.reboundrumble.subsystems.Shooter;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.DriverStationEnhancedIO;
import edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.buttons.Button;
import edu.wpi.first.wpilibj.buttons.DigitalIOButton;
import edu.wpi.first.wpilibj.buttons.JoystickButton;
import edu.wpi.first.wpilibj.command.StartCommand;

/**
 * Contains physical operator interface buttons and joysticks and links buttons
 * to commands.
 *
 * @author Ziv
 */
public class OI {

    // Constants.
    private final double CAM_JS_SCALE = 0.125;
    private final double PAD_DEADBAND = 0.1;

    // Driver.
    private Joystick driverPad = new Joystick(RobotMap.PAD_DRIVER);
    private DriverStationEnhancedIO io = DriverStation.getInstance().getEnhancedIO();
    private Button shift = new ReverseButton(new DigitalIOButton(1));
    private Button manOverride = new ReverseButton(new DigitalIOButton(1));

    // Operator.
    private Joystick opPad = new Joystick(RobotMap.PAD_OPERATOR);
    private Button prepareFender = new JoystickButton(opPad, 4);
    private Button prepareKey = new JoystickButton(opPad, 3);
    private Button shooterPlus = new JoystickButton(opPad, 1);
    private Button shooterMinus = new JoystickButton(opPad, 2);
    private Button shooterZero = new JoystickButton(opPad, 10);
    private Button toggleSquish = new JoystickButton(opPad, 9);
    private Button elevHopper = new JoystickButton(opPad, 5);
    private DualButton intakeDrop = new DualButton(new JoystickButton(opPad, 7), elevHopper);
    private Button elevShoot = new JoystickButton(opPad, 6);
    private Button elevSpit = new JoystickButton(opPad, 8);
    public final AutoModeSelector ams = new AutoModeSelector(opPad);
    private Button autoAim = new JoystickButton(opPad, 11);

    public OI(){

        // Driver.
        // When shift is held, go into the non-default gear.
        shift.whileHeld(new ShifterStaticCmd(!Shifter.DEFAULT));
        //driverIntake.whileHeld(new IntakeSetCmd(true, true));
        manOverride.whenPressed(new StartCommand(new DTManualCheesyCmd()));

        // Operator.
        autoAim.whileHeld(new DTManualCreepToTargetCmd());
        prepareFender.whenPressed(CommandBase.prepareFenderCmd());
        prepareKey.whenPressed(CommandBase.prepareKeyCmd());
        shooterPlus.whenPressed(new StartCommand(new ShooterDeltaRateCmd(Shooter.MANUAL_RATE_INC)));
        shooterMinus.whenPressed(new StartCommand(new ShooterDeltaRateCmd(-Shooter.MANUAL_RATE_INC)));
        shooterZero.whenPressed(new ShooterSetPowerCmd(0));
        toggleSquish.whenPressed(new ElevatorToggleSquishEnabledCmd());
        elevHopper.whileHeld(new ElevatorHopperCmd());
        // While we suck balls into the hopper, run the front intake whenever we
        // drop it down.
        // Otherwise, don't run the front intake when we drop it down.
        intakeDrop.button1.whileHeld(new IntakeSetCmd(true, false));
        intakeDrop.whileHeld(new IntakeSetCmd(true, true));
        elevShoot.whileHeld(new ElevatorShooterCmd());//new StartThenWaitCmd(new ElevatorShootOneBallCmd(), Elevator.SHOOTING_DELAY));
        elevSpit.whileHeld(new ElevatorSpitCmd());
    }

    private double capAndBand(double value) {
        value = Utils.deadband(value, .075, -1);
        value = Utils.deadband(value, .075, 0);
        value = Utils.deadband(value, .075, 1);
        return Utils.limit(value, -1, 1);
    }
<commit_msg>End of NYC. We won, so this should be at least halfway decent....<commit_after>package edu.neu.nutrons.reboundrumble;

import edu.neu.nutrons.lib.DualButton;
import edu.neu.nutrons.lib.ReverseButton;
import edu.neu.nutrons.lib.Utils;
import edu.neu.nutrons.reboundrumble.commands.CommandBase;
import edu.neu.nutrons.reboundrumble.commands.drivetrain.DTManualCheesyCmd;
import edu.neu.nutrons.reboundrumble.commands.drivetrain.DTManualCreepToTargetCmd;
import edu.neu.nutrons.reboundrumble.commands.elevator.ElevatorHopperCmd;
import edu.neu.nutrons.reboundrumble.commands.elevator.ElevatorShooterCmd;
import edu.neu.nutrons.reboundrumble.commands.elevator.ElevatorSpitCmd;
import edu.neu.nutrons.reboundrumble.commands.elevator.ElevatorToggleSquishEnabledCmd;
import edu.neu.nutrons.reboundrumble.commands.intake.IntakeSetCmd;
import edu.neu.nutrons.reboundrumble.commands.shifter.ShifterStaticCmd;
import edu.neu.nutrons.reboundrumble.commands.shooter.ShooterDeltaRateCmd;
import edu.neu.nutrons.reboundrumble.commands.shooter.ShooterSetPowerCmd;
import edu.neu.nutrons.reboundrumble.subsystems.Shifter;
import edu.neu.nutrons.reboundrumble.subsystems.Shooter;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.DriverStationEnhancedIO;
import edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.buttons.Button;
import edu.wpi.first.wpilibj.buttons.DigitalIOButton;
import edu.wpi.first.wpilibj.buttons.JoystickButton;
import edu.wpi.first.wpilibj.command.StartCommand;

/**
 * Contains physical operator interface buttons and joysticks and links buttons
 * to commands.
 *
 * @author Ziv
 */
public class OI {

    // Constants.
    private final double CAM_JS_SCALE = 0.125;
    private final double PAD_DEADBAND = 0.1;

    // Driver.
    private Joystick driverPad = new Joystick(RobotMap.PAD_DRIVER);
    private DriverStationEnhancedIO io = DriverStation.getInstance().getEnhancedIO();
    private Button shift = new ReverseButton(new DigitalIOButton(1));
    private Button manOverride = new ReverseButton(new DigitalIOButton(1));

    // Operator.
    private Joystick opPad = new Joystick(RobotMap.PAD_OPERATOR);
    private Button prepareFender = new JoystickButton(opPad, 4);
    private Button prepareKey = new JoystickButton(opPad, 3);
    private Button shooterPlus = new JoystickButton(opPad, 1);
    private Button shooterMinus = new JoystickButton(opPad, 2);
    private Button shooterZero = new JoystickButton(opPad, 10);
    private Button toggleSquish = new JoystickButton(opPad, 9);
    private Button elevHopper = new JoystickButton(opPad, 5);
    private DualButton intakeDrop = new DualButton(new JoystickButton(opPad, 7), elevHopper);
    private Button elevShoot = new JoystickButton(opPad, 6);
    private Button elevSpit = new JoystickButton(opPad, 8);
    public final AutoModeSelector ams = new AutoModeSelector(opPad);
    private Button autoAim = new JoystickButton(opPad, 11);

    public OI(){

        // Driver.
        // When shift is held, go into the non-default gear.
        shift.whileHeld(new ShifterStaticCmd(!Shifter.DEFAULT));
        //driverIntake.whileHeld(new IntakeSetCmd(true, true));
        manOverride.whenPressed(new StartCommand(new DTManualCheesyCmd()));

        // Operator.
        autoAim.whileHeld(new DTManualCreepToTargetCmd());
        prepareFender.whenPressed(CommandBase.prepareFenderCmd());
        prepareFender.whileHeld(new ElevatorHopperCmd());
        prepareKey.whenPressed(CommandBase.prepareKeyCmd());
        prepareKey.whileHeld(new ElevatorHopperCmd());
        shooterPlus.whenPressed(new StartCommand(new ShooterDeltaRateCmd(Shooter.MANUAL_RATE_INC)));
        shooterMinus.whenPressed(new StartCommand(new ShooterDeltaRateCmd(-Shooter.MANUAL_RATE_INC)));
        shooterZero.whenPressed(new ShooterSetPowerCmd(0));
        toggleSquish.whenPressed(new ElevatorToggleSquishEnabledCmd());
        elevHopper.whileHeld(new ElevatorHopperCmd());
        // While we suck balls into the hopper, run the front intake whenever we
        // drop it down.
        // Otherwise, don't run the front intake when we drop it down.
        intakeDrop.button1.whileHeld(new IntakeSetCmd(true, false));
        intakeDrop.whileHeld(new IntakeSetCmd(true, true));
        elevShoot.whileHeld(new ElevatorShooterCmd());//new StartThenWaitCmd(new ElevatorShootOneBallCmd(), Elevator.SHOOTING_DELAY));
        elevSpit.whileHeld(new ElevatorSpitCmd());
    }

    private double capAndBand(double value) {
        value = Utils.deadband(value, .075, -1);
        value = Utils.deadband(value, .075, 0);
        value = Utils.deadband(value, .075, 1);
        return Utils.limit(value, -1, 1);
    }

{'fraction_non_alphanumeric': 0.09896555401514344, 'fraction_numerical': 0.007891649781379972, 'mean_word_length': 4.484210526315789, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1999352', 'n_tokens_mistral': 3246, 'n_tokens_neox': 3038, 'n_words': 570}