[examples] Fix arcade inversions (#3841)

Accounts for differences between ArcadeDrive and the methods used
in some other examples.
This commit is contained in:
sciencewhiz
2021-12-27 23:05:42 -08:00
committed by GitHub
parent e373fa476b
commit 1e82595ffb
23 changed files with 24 additions and 24 deletions

View File

@@ -32,6 +32,6 @@ public class Robot extends TimedRobot {
// Drive with arcade drive.
// That means that the Y axis drives forward
// and backward, and the X turns left and right.
m_robotDrive.arcadeDrive(m_stick.getY(), m_stick.getX());
m_robotDrive.arcadeDrive(-m_stick.getY(), m_stick.getX());
}
}

View File

@@ -32,6 +32,6 @@ public class Robot extends TimedRobot {
// Drive with split arcade drive.
// That means that the Y axis of the left stick moves forward
// and backward, and the X of the right stick turns left and right.
m_robotDrive.arcadeDrive(-m_driverController.getLeftY(), -m_driverController.getRightX());
m_robotDrive.arcadeDrive(-m_driverController.getLeftY(), m_driverController.getRightX());
}
}

View File

@@ -42,7 +42,7 @@ public class RobotContainer {
new RunCommand(
() ->
m_robotDrive.arcadeDrive(
-m_driverController.getLeftY(), -m_driverController.getRightX()),
-m_driverController.getLeftY(), m_driverController.getRightX()),
m_robotDrive));
}

View File

@@ -42,7 +42,7 @@ public class RobotContainer {
new RunCommand(
() ->
m_robotDrive.arcadeDrive(
-m_driverController.getLeftY(), -m_driverController.getRightX()),
-m_driverController.getLeftY(), m_driverController.getRightX()),
m_robotDrive));
}

View File

@@ -44,7 +44,7 @@ public class RobotContainer {
new RunCommand(
() ->
m_robotDrive.arcadeDrive(
-m_driverController.getLeftY(), -m_driverController.getRightX()),
-m_driverController.getLeftY(), m_driverController.getRightX()),
m_robotDrive));
}

View File

@@ -67,7 +67,7 @@ public class RobotContainer {
new RunCommand(
() ->
m_robotDrive.arcadeDrive(
-m_driverController.getLeftY(), -m_driverController.getRightX()),
-m_driverController.getLeftY(), m_driverController.getRightX()),
m_robotDrive));
}

View File

@@ -52,6 +52,6 @@ public class Robot extends TimedRobot {
double turningValue = (kAngleSetpoint - m_gyro.getAngle()) * kP;
// Invert the direction of the turn if we are going backwards
turningValue = Math.copySign(turningValue, m_joystick.getY());
m_myRobot.arcadeDrive(m_joystick.getY(), turningValue);
m_myRobot.arcadeDrive(-m_joystick.getY(), turningValue);
}
}

View File

@@ -45,7 +45,7 @@ public class RobotContainer {
new RunCommand(
() ->
m_robotDrive.arcadeDrive(
m_driverController.getLeftY(), m_driverController.getRightX()),
-m_driverController.getLeftY(), m_driverController.getRightX()),
m_robotDrive));
}
@@ -74,7 +74,7 @@ public class RobotContainer {
// Setpoint is 0
0,
// Pipe the output to the turning controls
output -> m_robotDrive.arcadeDrive(m_driverController.getLeftY(), output),
output -> m_robotDrive.arcadeDrive(-m_driverController.getLeftY(), output),
// Require the robot drive
m_robotDrive));

View File

@@ -69,7 +69,7 @@ public class RobotContainer {
new RunCommand(
() ->
m_robotDrive.arcadeDrive(
m_driverController.getLeftY(), m_driverController.getRightX()),
-m_driverController.getLeftY(), m_driverController.getRightX()),
m_robotDrive));
// Add commands to the autonomous command chooser

View File

@@ -53,7 +53,7 @@ public class RobotContainer {
new RunCommand(
() ->
m_robotDrive.arcadeDrive(
-m_driverController.getLeftY(), -m_driverController.getRightX()),
-m_driverController.getLeftY(), m_driverController.getRightX()),
m_robotDrive));
}

View File

@@ -50,7 +50,7 @@ public class RobotContainer {
new RunCommand(
() ->
m_robotDrive.arcadeDrive(
-m_driverController.getLeftY(), -m_driverController.getRightX()),
-m_driverController.getLeftY(), m_driverController.getRightX()),
m_robotDrive));
}