本文整理汇总了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;
}
}
示例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));
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
示例8: getThrottle
import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
public double getThrottle() {
return -xboxController.getY(GenericHID.Hand.kLeft);
}
示例9: getTurn
import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
public double getTurn() {
return -xboxController.getX(GenericHID.Hand.kRight);
}
示例10: isQuickTurn
import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
public boolean isQuickTurn() {
return xboxController.getStickButton(GenericHID.Hand.kRight);
}
示例11: getTriggerValue
import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
public double getTriggerValue() {
return xboxController.getTriggerAxis(Hand.kRight) - xboxController.getTriggerAxis(Hand.kLeft);
}
示例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;
}
示例13: setPreference
import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
public void setPreference(Hand pref) {
this.pref = pref;
}
示例14: getPreference
import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
public Hand getPreference() {
return pref;
}
示例15: getBumper
import edu.wpi.first.wpilibj.GenericHID.Hand; //导入依赖的package包/类
public boolean getBumper(Hand hand) {
return false;
}