public static boolean LTurn() { turned = false; if (iteration > 0) { if (Math.abs(Actuators.getLeftDriveMotor().getError()) < allotedError || Math.abs(Actuators.getRightDriveMotor().getError()) < allotedError) { reset = true; } } Drive.driveWithPID(0 - turnamountL, turnamountR); if (reset == true) { Actuators.getLeftDriveMotor().setEncPosition(0); Actuators.getRightDriveMotor().setEncPosition(0); reset = false; turned = true; } return turned; }
public static void go() { if (!turned) { Left.LTurn(); } else if (turned && !iPosition) { SmartDashboard.putBoolean("turned Check", turned); iPosition = Forward.go(24.0); } // Drive.driveWithPID(0, 0); if (iteration > 0) { if (Math.abs(Actuators.getLeftDriveMotor().getError()) < allotedError || Math.abs(Actuators.getRightDriveMotor().getError()) < allotedError) { reset = true; } if (reset == true) { Actuators.getLeftDriveMotor().setEncPosition(0); Actuators.getRightDriveMotor().setEncPosition(0); reset = false; turned = true; } } iteration++; }