[examples] Fix swapped arguments in MecanumControllerCommand example (#4976)

This commit is contained in:
sciencewhiz
2023-01-18 21:25:49 -08:00
committed by GitHub
parent e95e88fdf9
commit ecba8b99a8
3 changed files with 5 additions and 5 deletions

View File

@@ -113,9 +113,9 @@ public class DriveSubsystem extends SubsystemBase {
*/
public void drive(double xSpeed, double ySpeed, double rot, boolean fieldRelative) {
if (fieldRelative) {
m_drive.driveCartesian(ySpeed, xSpeed, rot, m_gyro.getRotation2d());
m_drive.driveCartesian(xSpeed, ySpeed, rot, m_gyro.getRotation2d());
} else {
m_drive.driveCartesian(ySpeed, xSpeed, rot);
m_drive.driveCartesian(xSpeed, ySpeed, rot);
}
}

View File

@@ -40,7 +40,7 @@ public class Robot extends TimedRobot {
@Override
public void teleopPeriodic() {
// Use the joystick X axis for forward movement, Y axis for lateral
// Use the joystick Y axis for forward movement, X axis for lateral
// movement, and Z axis for rotation.
m_robotDrive.driveCartesian(-m_stick.getY(), -m_stick.getX(), -m_stick.getZ());
}