package org.usfirst.frc.team2586.robot.subsystems;

import org.usfirst.frc.team2586.robot.RobotMap;

import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Talon;
import edu.wpi.first.wpilibj.command.Subsystem;

/**
 * Controls the drive motors of the robot
 */
public class DriveTrain extends Subsystem {
	
	private final Talon leftRearDriveMotor;
	private final Talon leftFrontDriveMotor;
	private final Talon rightRearDriveMotor;
	private final Talon rightFrontDriveMotor;
	
	private final RobotDrive drive;
	
	public DriveTrain() {
		super("Drive Train");
		
		this.leftRearDriveMotor = new Talon(RobotMap.REAR_LEFT_DRIVE);
		this.leftFrontDriveMotor = new Talon(RobotMap.FRONT_LEFT_DRIVE);
		this.rightRearDriveMotor = new Talon(RobotMap.REAR_RIGHT_DRIVE);
		this.rightFrontDriveMotor = new Talon(RobotMap.FRONT_RIGHT_DRIVE);
		
		this.drive = new RobotDrive(
				leftFrontDriveMotor, leftRearDriveMotor,
				rightFrontDriveMotor, rightRearDriveMotor
				);
		
		this.drive.setSafetyEnabled(true);
	}
	
	/**
	 * Drive the robot with a left and right speed
	 * @param leftSpeed Number between 0 and 1 representing the speed to drive the left side
	 * @param rightSpeed Number between 0 and 1 representing the speed to drive the right side
	 */
	public void teleDrive(double leftSpeed, double rightSpeed) {
		this.drive.tankDrive(leftSpeed, rightSpeed);
	}

	@Override
	protected void initDefaultCommand() {
		
	}
}


@@ -135,16 +135,62 @@
 tDrive;%0A
+import edu.wpi.first.wpilibj.SpeedController;%0A
 import e
@@ -373,29 +373,39 @@
 ivate final 
-Talon
+SpeedController
  leftRearDri
@@ -428,21 +428,31 @@
 e final 
-Talon
+SpeedController
  leftFro
@@ -476,29 +476,39 @@
 ivate final 
-Talon
+SpeedController
  rightRearDr
@@ -532,21 +532,31 @@
 e final 
-Talon
+SpeedController
  rightFr
@@ -612,323 +612,1399 @@
 %0A%09%0A%09
-public DriveTrain() %7B%0A%09%09super(%22Drive Train%22);%0A%09%09%0A%09%09this.leftRearDriveMotor = new Talon(RobotMap.REAR_LEFT_DRIVE);%0A%09%09this.leftFrontDriveMotor = new Talon(RobotMap.FRONT_LEFT_DRIVE);%0A%09%09this.rightRearDriveMotor = new Talon(RobotMap.REAR_RIGHT_DRIVE);%0A%09%09this.rightFrontDriveMotor = new Talon(RobotMap.FRONT_RIGHT_DRIVE)
+/**%0A%09 * Create a DriveTrain using the default speed controller channels defined in RobotMap as Talons.%0A%09 */%0A%09public DriveTrain() %7B%0A%09%09this(RobotMap.REAR_LEFT_DRIVE, RobotMap.REAR_RIGHT_DRIVE,%0A%09%09%09%09RobotMap.FRONT_LEFT_DRIVE, RobotMap.FRONT_RIGHT_DRIVE);%0A%09%7D%0A%09%0A%09/**%0A%09 * Create a DriveTrain using the specified speed controller channels using Talons%0A%09 * %0A%09 * @param rearLeft Channel for the rear left speed controller%0A%09 * @param rearRight Channel for the rear right speed controller%0A%09 * @param frontLeft Channel for the front left speed controller%0A%09 * @param frontRight Channel for the front right speed controller%0A%09 */%0A%09public DriveTrain(int rearLeft, int rearRight, int frontLeft, int frontRight) %7B%0A%09%09this(new Talon(rearLeft), new Talon(rearRight), %0A%09%09%09%09new Talon(frontLeft), new Talon(frontRight));%0A%09%7D%0A%09%0A%09/**%0A%09 * Create a DriveTrain using the spcified speed controllers%0A%09 * %0A%09 * @param rearLeft Rear left speed controller%0A%09 * @param rearRight Rear right speed controller%0A%09 * @param frontLeft Front left speed controller%0A%09 * @param frontRight Front right speed controller%0A%09 */%0A%09public DriveTrain(SpeedController rearLeft, SpeedController rearRight, %0A%09%09%09SpeedController frontLeft, SpeedController frontRight) %7B%0A%09%09super(%22Drive Train%22);%0A%09%09%0A%09%09this.leftRearDriveMotor = rearLeft;%0A%09%09this.rightRearDriveMotor = rearRight;%0A%09%09this.leftFrontDriveMotor = frontLeft;%0A%09%09this.rightFrontDriveMotor = frontRight
 ;%0A%09%09
@@ -2584,14 +2584,11 @@
 () %7B
+%7D
 %0A%09
-%09%0A%09%7D
 %0A%7D%0A%0A

Allow more abstract use of DriveTrain (different speed controllers, different channels