当前位置: 首页>>代码示例>>Java>>正文


Java Hand类代码示例

本文整理汇总了Java中edu.wpi.first.wpilibj.GenericHID.Hand的典型用法代码示例。如果您正苦于以下问题:Java Hand类的具体用法?Java Hand怎么用?Java Hand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Hand类属于edu.wpi.first.wpilibj.GenericHID包,在下文中一共展示了Hand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
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;
  }
}
 
开发者ID:ligerbots,项目名称:Steamworks2017Robot,代码行数:31,代码来源:ManualControlWithTriggerCommand.java

示例2: turnHandle

import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
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));
}
 
开发者ID:rvs314,项目名称:ShayaTeamPreSeason,代码行数:12,代码来源:Robot.java

示例3: xHandle

import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
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);
}
 
开发者ID:rvs314,项目名称:ShayaTeamPreSeason,代码行数:13,代码来源:Robot.java

示例4: run

import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
@Override
public void run() {
	if(stick.getBumper(Hand.kLeft)){
		spike.set(true);
	}else{
		spike.set(false);
	}
}
 
开发者ID:FIRST-Team-1699,项目名称:2017-code,代码行数:9,代码来源:Light.java

示例5: execute

import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
@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);
}
 }
 
开发者ID:FRC-1294,项目名称:frc2017,代码行数:14,代码来源:ClimbRope.java

示例6: nonZero

import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
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);
        }
    }
}
 
开发者ID:OASTEM,项目名称:2014CataBot,代码行数:16,代码来源:DualJoystick.java

示例7: yHandle

import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
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);
}
 
开发者ID:rvs314,项目名称:ShayaTeamPreSeason,代码行数:7,代码来源:Robot.java

示例8: getThrottle

import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
public double getThrottle() {
  return -xboxController.getY(GenericHID.Hand.kLeft);
}
 
开发者ID:ligerbots,项目名称:Steamworks2017Robot,代码行数:4,代码来源:OperatorInterface.java

示例9: getTurn

import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
public double getTurn() {
  return -xboxController.getX(GenericHID.Hand.kRight);
}
 
开发者ID:ligerbots,项目名称:Steamworks2017Robot,代码行数:4,代码来源:OperatorInterface.java

示例10: isQuickTurn

import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
public boolean isQuickTurn() {
  return xboxController.getStickButton(GenericHID.Hand.kRight);
}
 
开发者ID:ligerbots,项目名称:Steamworks2017Robot,代码行数:4,代码来源:OperatorInterface.java

示例11: getTriggerValue

import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
public double getTriggerValue() {
  return xboxController.getTriggerAxis(Hand.kRight) - xboxController.getTriggerAxis(Hand.kLeft);
}
 
开发者ID:ligerbots,项目名称:Steamworks2017Robot,代码行数:4,代码来源:OperatorInterface.java

示例12: DualJoystick

import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
public DualJoystick(int left, int right, Hand pref) {
    this.left = new Joystick(left);
    this.right = new Joystick(right);
    this.pref = pref;
}
 
开发者ID:OASTEM,项目名称:2014CataBot,代码行数:6,代码来源:DualJoystick.java

示例13: setPreference

import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
public void setPreference(Hand pref) {
    this.pref = pref;
}
 
开发者ID:OASTEM,项目名称:2014CataBot,代码行数:4,代码来源:DualJoystick.java

示例14: getPreference

import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
public Hand getPreference() {
    return pref;
}
 
开发者ID:OASTEM,项目名称:2014CataBot,代码行数:4,代码来源:DualJoystick.java

示例15: getBumper

import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
public boolean getBumper(Hand hand) {
    return false;
}
 
开发者ID:OASTEM,项目名称:2014CataBot,代码行数:4,代码来源:DualJoystick.java


注:本文中的edu.wpi.first.wpilibj.GenericHID.Hand类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。