本文整理汇总了Java中edu.wpi.first.wpilibj.RobotDrive.arcadeDrive方法的典型用法代码示例。如果您正苦于以下问题:Java RobotDrive.arcadeDrive方法的具体用法?Java RobotDrive.arcadeDrive怎么用?Java RobotDrive.arcadeDrive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.wpi.first.wpilibj.RobotDrive
的用法示例。
在下文中一共展示了RobotDrive.arcadeDrive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drive
import edu.wpi.first.wpilibj.RobotDrive; //导入方法依赖的package包/类
/**
* Call the appropriate {@link RobotDrive} drive method based upon the #
*
* @param robotDrive
*/
public void drive( RobotDrive robotDrive ) {
if (Mode.X.equals(mode)) {
// X-mode ...
if (DriveStyle.TANK.equals(style)) {
robotDrive.tankDrive(this, XModeAxes.LEFT_JOYSTICK_VERTICAL, this, XModeAxes.RIGHT_JOYSTICK_VERTICAL);
} else if (DriveStyle.ARCADE_LEFT.equals(style)) {
robotDrive.arcadeDrive(this, XModeAxes.LEFT_JOYSTICK_VERTICAL, this, XModeAxes.LEFT_JOYSTICK_HORIZONTAL);
} else if (DriveStyle.ARCADE_RIGHT.equals(style)) {
robotDrive.arcadeDrive(this, XModeAxes.RIGHT_JOYSTICK_VERTICAL, this, XModeAxes.RIGHT_JOYSTICK_HORIZONTAL);
} else {
System.out.println("Unknown Logitech Controller drive style: " + style);
}
} else if (Mode.D.equals(mode)) {
// D-mode ...
if (DriveStyle.TANK.equals(style)) {
robotDrive.tankDrive(this, DModeAxes.LEFT_JOYSTICK_VERTICAL, this, DModeAxes.RIGHT_JOYSTICK_VERTICAL);
} else if (DriveStyle.ARCADE_LEFT.equals(style)) {
robotDrive.arcadeDrive(this, DModeAxes.LEFT_JOYSTICK_VERTICAL, this, DModeAxes.LEFT_JOYSTICK_HORIZONTAL);
} else if (DriveStyle.ARCADE_RIGHT.equals(style)) {
robotDrive.arcadeDrive(this, DModeAxes.RIGHT_JOYSTICK_VERTICAL, this, DModeAxes.RIGHT_JOYSTICK_HORIZONTAL);
} else {
System.out.println("Unknown Logitech Controller drive style: " + style);
}
} else {
System.out.println("Unknown Logitech Controller mode: " + mode);
}
}
示例2: drive
import edu.wpi.first.wpilibj.RobotDrive; //导入方法依赖的package包/类
public void drive( RobotDrive robotDrive ) {
double move = ctrl().getRawAxis(DMode.Axes.LEFT_JOYSTICK_VERTICAL);
double turn = ctrl().getRawAxis(DMode.Axes.LEFT_JOYSTICK_HORIZONTAL);
robotDrive.arcadeDrive(move, turn, true);
}