/**
* Runs throughout teleop and listens for joystick inputs and drives the
- * driveTrain
- * Never finishes until teleop ends
+ * driveTrain Never finishes until teleop ends
*/
public class JoystickDrive extends Command {
@Override
protected void execute() {
+ double k = (Robot.driveTrain.isFlipped() ? -1 : 1);
// IDK why but the joystick gives positive values for pulling backwards
double left = -Robot.oi.leftJoystick.getY();
double right = -Robot.oi.rightJoystick.getY();
- Robot.driveTrain.drive(left, right);
+ Robot.driveTrain.drive(left * k, right * k);
}
@Override