Tank drive joystick backwards

I have been having an issue with one of my joysticks where forwards is backwards. The other joystick is fine and the problem only started occurring when I imported my code to 2022. any help would be great. Thanks!

From New for 2023 — FIRST Robotics Competition documentation

Drive class functions such as DifferentialDrive and MecanumDrive no longer invert the right side by default. Please use setInverted on your motor controllers to invert the right side to maintain the same behavior

1 Like

2022 WPILIB doesn’t automatically invert the right side of your differential drive.

" * Drive class functions such as DifferentialDrive and MecanumDrive no longer invert the right side by default. Please use setInverted on your motor controllers to invert the right side to maintain the same behavior"

ok sorry for my lack of knowledge in coding but how would one implement that?

public class DriveTrain extends SubsystemBase {

/** Creates a new DriveTrain. */

WPI_TalonSRX left;

WPI_TalonSRX right;

DifferentialDrive drive;

public DriveTrain() {

       left = new WPI_TalonSRX(3);

       right = new WPI_TalonSRX(4);

       right.setInverted(true);

       drive = new DifferentialDrive(left, right);

       drive.setExpiration(0.2);

       drive.setSafetyEnabled(false);

}

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.