import edu.wpi.first.wpilibj.command.PIDSubsystem;
public class DriveTrain extends PIDSubsystem {
+ // Determines if the "front" of the robot has been reversed
private boolean outputFlipped = false;
+
private static double pidOutput = 0;
private Encoder leftEncoder, rightEncoder;
public void joystickDrive(double left, double right) {
int type = Constants.DriveTrain.DRIVE_TYPE;
+
+ // Handle flipping of the "front" of the robot
double k = (isFlipped() ? -1 : 1);
+
if (type == Constants.DriveTrain.TANK) {
+ // TODO Test this for negation and for voltage vs. [-1,1] outputs
double leftSpeed = (-frontLeft.get() + -rearLeft.get()) / 2;
double rightSpeed = (-frontRight.get() + -rearRight.get()) / 2;
left = ((Constants.DriveTrain.kADJUST - 1) * leftSpeed + left)