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

项目:ShayaTeamPreSeason    文件:Robot.java   
public void turnHandle() {
    if (xbox.getX(Hand.kRight) >= .5)
    {
        System.out.println("Turn to the right");
    }
    else
    {
        System.out.println("Turn to the left");
    }
    System.out.println("" + xbox.getX(Hand.kRight));
}
项目:ShayaTeamPreSeason    文件:Robot.java   
public void xHandle() {
    double xbVal = xbox.getX(Hand.kLeft);
    if (xbVal >= .5)
    {
        System.out.println("Move to the right");
    }
    else
    {
        System.out.println("Move to the left");
    }
    System.out.println("" + xbVal);
}
项目:Steamworks2017Robot    文件:ManualControlWithTriggerCommand.java   
protected void execute() {
  double value = Robot.operatorInterface.xboxController.getTriggerAxis(Hand.kRight)
      - Robot.operatorInterface.xboxController.getTriggerAxis(Hand.kLeft);
  //SmartDashboard.putNumber("ManualControl_value", value);
  switch (type) {
    case DRIVE_THROTTLE:
      Robot.driveTrain.rawThrottleTurnDrive(value, 0);
      break;
    case DRIVE_TURN:
      Robot.driveTrain.rawThrottleTurnDrive(0, value);
      break;
    case SHOOTER_RPM:
      Robot.shooter.setShooterPercentVBus(value);
      break;
    case INTAKE:
      Robot.intake.setIntakeRaw(value);
      break;
    case FEEDER:
      Robot.feeder.setFeeder(value);
      break;
    case GEAR_SERVO:
      Robot.gearManipulator.setServoRaw(SmartDashboard.getNumber("ManualControl_value", 0));
      break;
    case STIRRER_SERVO:
      Robot.stirrer.setStirrer(value);
      break;        
    default:
      break;
  }
}
项目:2017-code    文件:Light.java   
@Override
public void run() {
    if(stick.getBumper(Hand.kLeft)){
        spike.set(true);
    }else{
        spike.set(false);
    }
}
项目:frc2017    文件:ClimbRope.java   
@Override
 protected void execute() {
if(Robot.oi.getJoystick2().getTriggerAxis(Hand.kRight) > TRIGGER_DEADZONE){
    Robot.driveSubsystem.enableBrakeMode(false);
    Robot.climbingSubsystem.climbTalon.set(Robot.oi.getJoystick2().getTriggerAxis(Hand.kRight));
}
//else if(Robot.oi.getJoystick2().getYButton() == true){
//  Robot.climbingSubsystem.climbTalon.set(1.0);
//}
else{
    Robot.climbingSubsystem.climbTalon.set(0);
}
 }
项目:2014CataBot    文件:DualJoystick.java   
private double nonZero(double leftVal, double rightVal) {
    if (leftVal == 0) {
        return rightVal;
    } else if (rightVal == 0) {
        return leftVal;
    } else {
        if (getPreference() == Hand.kLeft) {
            return leftVal;
        } else if (getPreference() == Hand.kRight) {
            return rightVal;
        } else {
            return Math.max(leftVal, rightVal);
        }
    }
}
项目:FRCTesting    文件:DualJoystick.java   
private double nonZero(double leftVal, double rightVal) {
    if (leftVal == 0) {
        return rightVal;
    } else if (rightVal == 0) {
        return leftVal;
    } else {
        if (getPreference() == Hand.kLeft) {
            return leftVal;
        } else if (getPreference() == Hand.kRight) {
            return rightVal;
        } else {
            return Math.max(leftVal, rightVal);
        }
    }
}
项目:ShayaTeamPreSeason    文件:Robot.java   
public void yHandle() {
    double xbVal = xbox.getY(Hand.kLeft);
    if (xbVal >= .5) System.out.println("Move forward!");
    else System.out.println("Move backward");
    System.out.println("" + xbVal);
}
项目:Steamworks2017Robot    文件:OperatorInterface.java   
public double getThrottle() {
  return -xboxController.getY(GenericHID.Hand.kLeft);
}
项目:Steamworks2017Robot    文件:OperatorInterface.java   
public double getTurn() {
  return -xboxController.getX(GenericHID.Hand.kRight);
}
项目:Steamworks2017Robot    文件:OperatorInterface.java   
public boolean isQuickTurn() {
  return xboxController.getStickButton(GenericHID.Hand.kRight);
}
项目:Steamworks2017Robot    文件:OperatorInterface.java   
public double getTriggerValue() {
  return xboxController.getTriggerAxis(Hand.kRight) - xboxController.getTriggerAxis(Hand.kLeft);
}
项目:2014CataBot    文件:DualJoystick.java   
public DualJoystick(int left, int right, Hand pref) {
    this.left = new Joystick(left);
    this.right = new Joystick(right);
    this.pref = pref;
}
项目:2014CataBot    文件:DualJoystick.java   
public DualJoystick(Joystick left, Joystick right, Hand pref) {
    this.left = left;
    this.right = right;
    this.pref = pref;
}
项目:2014CataBot    文件:DualJoystick.java   
public void setPreference(Hand pref) {
    this.pref = pref;
}
项目:2014CataBot    文件:DualJoystick.java   
public Hand getPreference() {
    return pref;
}
项目:2014CataBot    文件:DualJoystick.java   
public boolean getBumper(Hand hand) {
    return false;
}
项目:2014CataBot    文件:DualJoystick.java   
public boolean getTop(Hand hand) {
    return left.getTop() || right.getTop();
}
项目:2014CataBot    文件:DualJoystick.java   
public boolean getTrigger(Hand hand) {
    return left.getTrigger() || right.getTrigger();
}
项目:2014CataBot    文件:DualJoystick.java   
public double getX(Hand hand) {
    double leftVal = left.getX();
    double rightVal = right.getX();
    return nonZero(leftVal, rightVal);
}
项目:2014CataBot    文件:DualJoystick.java   
public double getY(Hand hand) {
    double leftVal = left.getY();
    double rightVal = right.getY();
    return nonZero(leftVal, rightVal);
}
项目:2014CataBot    文件:DualJoystick.java   
public double getZ(Hand hand) {
    double leftVal = left.getZ();
    double rightVal = right.getZ();
    return nonZero(leftVal, rightVal);
}
项目:FRCTesting    文件:DualJoystick.java   
public DualJoystick(int left, int right, Hand pref) {
    this.left = new Joystick(left);
    this.right = new Joystick(right);
    this.pref = pref;
}
项目:FRCTesting    文件:DualJoystick.java   
public DualJoystick(Joystick left, Joystick right, Hand pref) {
    this.left = left;
    this.right = right;
    this.pref = pref;
}
项目:FRCTesting    文件:DualJoystick.java   
public void setPreference(Hand pref) {
    this.pref = pref;
}
项目:FRCTesting    文件:DualJoystick.java   
public Hand getPreference() {
    return pref;
}
项目:FRCTesting    文件:DualJoystick.java   
public boolean getBumper(Hand hand) {
    return false;
}
项目:FRCTesting    文件:DualJoystick.java   
public boolean getTop(Hand hand) {
    return left.getTop() || right.getTop();
}
项目:FRCTesting    文件:DualJoystick.java   
public boolean getTrigger(Hand hand) {
    return left.getTrigger() || right.getTrigger();
}
项目:FRCTesting    文件:DualJoystick.java   
public double getX(Hand hand) {
    double leftVal = left.getX();
    double rightVal = right.getX();
    return nonZero(leftVal, rightVal);
}
项目:FRCTesting    文件:DualJoystick.java   
public double getY(Hand hand) {
    double leftVal = left.getY();
    double rightVal = right.getY();
    return nonZero(leftVal, rightVal);
}
项目:FRCTesting    文件:DualJoystick.java   
public double getZ(Hand hand) {
    double leftVal = left.getZ();
    double rightVal = right.getZ();
    return nonZero(leftVal, rightVal);
}
项目:UltimateAscent    文件:PyramidDrive.java   
protected void execute() {
    driveTrain.pyramidDrive(oi.getXbox(), Hand.kLeft);
}
项目:Steamworks2017Robot    文件:OperatorInterface.java   
/**
 * Every command that implements automatic behavior should check this in isFinished(). This method
 * returns true if
 * <ul>
 * <li>The left (throttle) stick button is pressed, or</li>
 * <li>Throttle is applied beyond 0.5</li>
 * </ul>
 * 
 * @return True if the above conditions are met.
 */
public boolean isCancelled() {
  // just to be safe. The controller could fall down or something.
  if (DriverStation.getInstance().isAutonomous()) {
    return false;
  }
  return getThrottle() > 0.5 || getThrottle() < -0.5
      || xboxController.getStickButton(GenericHID.Hand.kLeft) || farmController.getRawButton(28);
}