protected void initialize() { if(!RobotMap.JawsClosed) { setTimeout(.5); Robot.arm.closeArm(); Robot.oi.driveJoystick.setRumble(RumbleType.kLeftRumble, 1); Robot.oi.armJoystick.setRumble(RumbleType.kLeftRumble, 1); RobotMap.JawsClosed = true; } else { setTimeout(2); RobotMap.ArmDownDebounce = true; Robot.arm.openArm(); RobotMap.JawsClosed = false; } }
protected void initialize() { debounceTrigger = true; //System.out.println("armStatus: " + RobotMap.ArmIsUp + ", Jaws status: " + RobotMap.JawsClosed); Date now = new Date(); long elasped = now.getTime() - RobotMap.ArmDownTime.getTime(); System.out.println("elasped: " + elasped); if(RobotMap.JawsClosed == false && RobotMap.ArmIsUp == false && elasped > debounceTimer) { //debounceTrigger = true; //setTimeout(debounceTimer); //System.out.println("switch pressed"); Robot.arm.closeArm(); RobotMap.JawsClosed = true; //System.out.println("Closing arm on trigger"); new Thread(() -> { try { Robot.oi.driveJoystick.setRumble(RumbleType.kLeftRumble, 1); Robot.oi.armJoystick.setRumble(RumbleType.kLeftRumble, 1); Thread.sleep(500); } catch (InterruptedException e) { System.out.println("rubble went wrong!"); } finally { Robot.oi.driveJoystick.setRumble(RumbleType.kLeftRumble, 0); Robot.oi.armJoystick.setRumble(RumbleType.kLeftRumble, 0); } }).start(); } }
@Override public void setShouldRumble(boolean aRumble) { // System.out.println("RUmbling " + aRumble); if(aRumble) { mJoystick.setRumble(RumbleType.kLeftRumble, 1); mJoystick.setRumble(RumbleType.kRightRumble, 1); } else { mJoystick.setRumble(RumbleType.kLeftRumble, 0); mJoystick.setRumble(RumbleType.kRightRumble, 0); } }
public void rumbleLeftJoystick(int rumbleValue) { this.driveStick.setRumble(RumbleType.kLeftRumble, rumbleValue); }
public void rumbleRightJoystick(int rumbeValue) { this.driveStick.setRumble(RumbleType.kRightRumble, rumbeValue); }
public void setRumble(double value) { // Let's get ready to ruuuummmmbllle joystick.setRumble(RumbleType.kLeftRumble, value); joystick.setRumble(RumbleType.kRightRumble, value); }
protected void end() { Robot.oi.driveJoystick.setRumble(RumbleType.kLeftRumble,0); Robot.oi.armJoystick.setRumble(RumbleType.kLeftRumble, 0); RobotMap.ArmDownDebounce = false; }
public final Output getRumble(RumbleType type) { return new Rumble(type); }
public Rumble(RumbleType type) { this.type = type; }
/** * Sets the vibration motors of the Xbox 360 gamepad controller * * @param type The motor to vibrate. Left motor is rougher than right motor. Uses a RumbleType constant. * @param value The strength at which the motor vibrates in range [0, 1] */ public void vibrateXboxController(RumbleType type, double value) { xbox360.setRumble(type, value); }
/** * Adjust the rumbliness of the left rumble motor. * * @param value Strength of Rumble, 0 is min and 1 is max. */ public void setLeftRumble(float value) { joystick.setRumble(RumbleType.kLeftRumble, value); }
/** * Adjust the rumbliness of the right rumble motor. * * @param value Strength of Rumble, 0 is min and 1 is max. */ public void setRightRumble(float value) { joystick.setRumble(RumbleType.kRightRumble, value); }