import org.usfirst.frc.team3501.robot.Constants;
import org.usfirst.frc.team3501.robot.commands.driving.JoystickDrive;
+import org.usfirst.frc.team3501.robot.utils.PIDController;
import com.ctre.CANTalon;
import edu.wpi.first.wpilibj.command.Subsystem;
public class DriveTrain extends Subsystem {
- public static double driveP = 0.012, driveI = 0.0011, driveD = -0.002;
+
+ public static double driveP, driveI, driveD;
public static double turnP = 0.004, turnI = 0.0013, turnD = -0.005;
public static double driveStraightGyroP = 0.01;
public boolean shouldBeClimbing = false;
+ private PIDController driveController;
+
private DriveTrain() {
+
+ driveController = new PIDController(driveP, driveI, driveD);
+
// MOTOR CONTROLLERS
frontLeft = new CANTalon(Constants.DriveTrain.FRONT_LEFT);
frontRight = new CANTalon(Constants.DriveTrain.FRONT_RIGHT);
this.imu = new ADXRS450_Gyro(Constants.DriveTrain.GYRO_PORT);
// TODO: Not sure if MODULE_NUMBER should be the same for both
- leftGearPiston = new DoubleSolenoid(
+ leftGearPiston = new DoubleSolenoid(Constants.DriveTrain.PISTON_MODULE,
Constants.DriveTrain.LEFT_GEAR_PISTON_FORWARD,
Constants.DriveTrain.LEFT_GEAR_PISTON_REVERSE);
- rightGearPiston = new DoubleSolenoid(
+ rightGearPiston = new DoubleSolenoid(Constants.DriveTrain.PISTON_MODULE,
Constants.DriveTrain.RIGHT_GEAR_PISTON_FORWARD,
Constants.DriveTrain.RIGHT_GEAR_PISTON_REVERSE);
}
+ public PIDController getDriveController() {
+ return this.driveController;
+ }
+
public static DriveTrain getDriveTrain() {
if (driveTrain == null) {
driveTrain = new DriveTrain();