Java 类edu.wpi.first.wpilibj.GenericHID.RumbleType 实例源码

项目:steamworks-java    文件:Jaws.java   
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;
    }  
 }
项目:steamworks-java    文件:CloseOnTrigger.java   
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();
    }
}
项目:snobot-2017    文件:SnobotOperatorXbaxJoystick.java   
@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);
        }
    }
项目:Spartonics-Code    文件:OI.java   
public void rumbleLeftJoystick(int rumbleValue) {
    this.driveStick.setRumble(RumbleType.kLeftRumble, rumbleValue);
}
项目:Spartonics-Code    文件:OI.java   
public void rumbleRightJoystick(int rumbeValue) {
    this.driveStick.setRumble(RumbleType.kRightRumble, rumbeValue);
}
项目:Spartonics-Code    文件:OI.java   
public void rumbleLeftJoystick(int rumbleValue) {
    this.driveStick.setRumble(RumbleType.kLeftRumble, rumbleValue);
}
项目:Spartonics-Code    文件:OI.java   
public void rumbleRightJoystick(int rumbeValue) {
    this.driveStick.setRumble(RumbleType.kRightRumble, rumbeValue);
}
项目:frc-robot    文件:Controller.java   
public void setRumble(double value) {
    // Let's get ready to ruuuummmmbllle
    joystick.setRumble(RumbleType.kLeftRumble, value);
    joystick.setRumble(RumbleType.kRightRumble, value);
}
项目:steamworks-java    文件:Jaws.java   
protected void end() {
    Robot.oi.driveJoystick.setRumble(RumbleType.kLeftRumble,0);
Robot.oi.armJoystick.setRumble(RumbleType.kLeftRumble, 0);
    RobotMap.ArmDownDebounce = false;
  }
项目:atalibj    文件:JoystickModule.java   
public final Output getRumble(RumbleType type) {
    return new Rumble(type);
}
项目:atalibj    文件:JoystickModule.java   
public Rumble(RumbleType type) {
    this.type = type;
}
项目:2017-Steamworks    文件:OI.java   
/**
 * 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);
}
项目:CasseroleLib    文件:Xbox360Controller.java   
/**
 * 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);
}
项目:CasseroleLib    文件:Xbox360Controller.java   
/**
 * 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);
}