mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[examples] Fix swapped arguments in MecanumControllerCommand example (#4976)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user