diff --git a/src/org/aluminati3555/lib/data/AluminatiData.java b/src/org/aluminati3555/lib/data/AluminatiData.java index 9337e3c..fcb0433 100644 --- a/src/org/aluminati3555/lib/data/AluminatiData.java +++ b/src/org/aluminati3555/lib/data/AluminatiData.java @@ -33,7 +33,7 @@ */ public final class AluminatiData { // Library - public static final int LIBRARY_VERSION = 9; + public static final int LIBRARY_VERSION = 10; // Robot delay public static double robotDelay = 0.02; // Seconds diff --git a/src/org/aluminati3555/lib/drive/AluminatiDrive.java b/src/org/aluminati3555/lib/drive/AluminatiDrive.java index bafa469..a2f61af 100644 --- a/src/org/aluminati3555/lib/drive/AluminatiDrive.java +++ b/src/org/aluminati3555/lib/drive/AluminatiDrive.java @@ -328,42 +328,8 @@ public void arcadeDrive(AluminatiJoystick joystick) { * Drives the robot using arcade drive */ public void arcadeDrive(AluminatiXboxController controller) { - driveHelper.aluminatiDrive(-controller.getSquaredY() * controlCoefficient, - controller.getSquaredX() * controlCoefficient, true, (shifter == null) ? true : shifter.isHigh()); - - if (!inverted) { - left.getMaster().set(ControlMode.PercentOutput, driveHelper.getLeftPower()); - right.getMaster().set(ControlMode.PercentOutput, driveHelper.getRightPower()); - } else { - left.getMaster().set(ControlMode.PercentOutput, -driveHelper.getRightPower()); - right.getMaster().set(ControlMode.PercentOutput, -driveHelper.getLeftPower()); - } - } - - /** - * Drives the robot using cheesy drive - */ - public void cheesyDrive(AluminatiJoystick joystick, int cheesyDriveButton) { - driveHelper.aluminatiDrive(-joystick.getSquaredY() * controlCoefficient, - joystick.getSquaredX() * controlCoefficient, joystick.getRawButton(cheesyDriveButton), - (shifter == null) ? true : shifter.isHigh()); - - if (!inverted) { - left.getMaster().set(ControlMode.PercentOutput, driveHelper.getLeftPower()); - right.getMaster().set(ControlMode.PercentOutput, driveHelper.getRightPower()); - } else { - left.getMaster().set(ControlMode.PercentOutput, -driveHelper.getRightPower()); - right.getMaster().set(ControlMode.PercentOutput, -driveHelper.getLeftPower()); - } - } - - /** - * Drives the robot using cheesy drive - */ - public void cheesyDrive(AluminatiXboxController controller, int cheesyDriveButton) { - driveHelper.aluminatiDrive(-controller.getSquaredY() * controlCoefficient, - controller.getSquaredX() * controlCoefficient, controller.getRawButton(cheesyDriveButton), - (shifter == null) ? true : shifter.isHigh()); + driveHelper.aluminatiDrive(-controller.getSquaredLeftY() * controlCoefficient, + controller.getSquaredRightX() * controlCoefficient, true, (shifter == null) ? true : shifter.isHigh()); if (!inverted) { left.getMaster().set(ControlMode.PercentOutput, driveHelper.getLeftPower()); diff --git a/src/org/aluminati3555/lib/drivers/AluminatiXboxController.java b/src/org/aluminati3555/lib/drivers/AluminatiXboxController.java index e4008e5..2f5c9a7 100644 --- a/src/org/aluminati3555/lib/drivers/AluminatiXboxController.java +++ b/src/org/aluminati3555/lib/drivers/AluminatiXboxController.java @@ -71,19 +71,37 @@ private double squareOutput(double input) { /** * Returns the squared x * + * @return The squared left x + */ + public double getSquaredLeftX() { + return squareOutput(this.getX(Hand.kLeft)); + } + + /** + * Returns the squared left y + * + * @return The squared y + */ + public double getSquaredLeftY() { + return squareOutput(this.getY(Hand.kLeft)); + } + + /** + * Returns the squared right x + * * @return The squared x */ - public double getSquaredX() { - return squareOutput(this.getX()); + public double getSquaredRightX() { + return squareOutput(this.getX(Hand.kRight)); } /** - * Returns the squared y + * Returns the squared right y * * @return The squared y */ - public double getSquaredY() { - return squareOutput(this.getY()); + public double getSquaredRightY() { + return squareOutput(this.getY(Hand.kRight)); } /**