Commit | Line | Data |
---|---|---|
38a404b3 KZ |
1 | package org.usfirst.frc.team3501.robot.subsystems; |
2 | ||
3 | import org.usfirst.frc.team3501.robot.Constants; | |
04f2cb52 CZ |
4 | |
5 | import com.ctre.CANTalon; | |
6 | ||
ccbc35ae | 7 | import edu.wpi.first.wpilibj.RobotDrive; |
38a404b3 KZ |
8 | import edu.wpi.first.wpilibj.command.Subsystem; |
9 | ||
10 | public class DriveTrain extends Subsystem { | |
ccbc35ae ME |
11 | private static DriveTrain driveTrain; |
12 | private CANTalon frontLeft, frontRight, rearLeft, rearRight; | |
13 | private RobotDrive robotDrive; | |
14 | ||
15 | private DriveTrain() { | |
16 | frontLeft = new CANTalon(Constants.DriveTrain.FRONT_LEFT); | |
17 | frontRight = new CANTalon(Constants.DriveTrain.FRONT_RIGHT); | |
18 | rearLeft = new CANTalon(Constants.DriveTrain.REAR_LEFT); | |
19 | rearRight = new CANTalon(Constants.DriveTrain.REAR_RIGHT); | |
20 | ||
21 | robotDrive = new RobotDrive(frontLeft, rearLeft, frontRight, rearRight); | |
22 | } | |
23 | ||
24 | public static DriveTrain getDriveTrain() { | |
25 | if (driveTrain == null) | |
26 | driveTrain = new DriveTrain(); | |
27 | return driveTrain; | |
28 | } | |
29 | ||
30 | public void setMotorSpeeds(double left, double right) { | |
31 | robotDrive.tankDrive(left, right); | |
32 | } | |
33 | ||
34 | @Override | |
35 | protected void initDefaultCommand() { | |
36 | } | |
38a404b3 KZ |
37 | |
38 | } |