package com.saintsrobotics.frc.subsystems;

import com.saintsrobotics.frc.RobotMap;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SpeedController;
import edu.wpi.first.wpilibj.Talon;
import edu.wpi.first.wpilibj.command.Subsystem;

/**
 * The drive train for the robot.
 * @author Saints Robotics
 */
public class DriveTrain extends Subsystem {
    private final RobotDrive drive;
    
    public DriveTrain() {
        SpeedController leftMotor1 = new Talon(RobotMap.LEFT_MOTOR_1);
        SpeedController leftMotor2 = new Talon(RobotMap.LEFT_MOTOR_2);
        SpeedController rightMotor1 = new Talon(RobotMap.RIGHT_MOTOR_1);
        SpeedController rightMotor2 = new Talon(RobotMap.RIGHT_MOTOR_2);
        drive = new RobotDrive(leftMotor1, leftMotor2, rightMotor1, rightMotor2);
    }
    
    /**
     * Allow the robot to be driven using arcade drive.
     * @param moveValue the move speed
     * @param rotateValue the rotation speed
     */
    public void arcadeDrive(double moveValue, double rotateValue) {
        drive.arcadeDrive(moveValue, rotateValue);
    }
    
    /**
     * Allow the robot to be driven using tank drive.
     * @param leftValue the speed for the left
     * @param rightValue the speed for the right
     */
    public void tankDrive(double leftValue, double rightValue) {
        drive.tankDrive(leftValue, rightValue);
    }
    
    /**
     * Stop the robot.
     */
    public void stop() {
        drive.stopMotor();
    }
    
    public void setSafetyEnabled(boolean enabled) {
        drive.setSafetyEnabled(enabled);
    }
    
    protected void initDefaultCommand() {}
}

@@ -362,16 +362,73 @@
 ystem %7B%0A
+    private static final double SAFETY_EXPIRATION = 0.5;%0A
     priv
@@ -852,24 +852,149 @@
 ghtMotor2);%0A
+        %0A        // Enable safety mode%0A        drive.setSafetyEnabled(true);%0A        drive.setExpiration(SAFETY_EXPIRATION);%0A
     %7D%0A    %0A 
@@ -1674,112 +1674,8 @@
    %0A
-    public void setSafetyEnabled(boolean enabled) %7B%0A        drive.setSafetyEnabled(enabled);%0A    %7D%0A    %0A
     

Enable safety mode