package com.edinarobotics.zeke.subsystems;

import com.edinarobotics.utils.common.Updatable;
import com.edinarobotics.utils.sensors.UltrasonicSensor;
import edu.wpi.first.wpilibj.DriverStationLCD;
import edu.wpi.first.wpilibj.RobotDrive;

public class Drivetrain implements Updatable {
    private RobotDrive robotDrive;
    private double magnitude, direction, rotation;
    private UltrasonicSensor ultrasonicSensor;
    private DriverStationLCD driverStationLCD;
    
    public static final double ULTRASONIC_SCALE = 6.799; //Value is in feet/volt
    
    public Drivetrain(int frontLeft, int rearLeft,
           int frontRight, int rearRight, int ultrasonicSensorChannel) {
        ultrasonicSensor = new UltrasonicSensor(ultrasonicSensorChannel, 
                ULTRASONIC_SCALE);
        this.driverStationLCD = DriverStationLCD.getInstance();
        this.robotDrive = new RobotDrive(frontLeft, rearLeft,
               frontRight, rearRight);
        robotDrive.setInvertedMotor(RobotDrive.MotorType.kFrontLeft, false);
        robotDrive.setInvertedMotor(RobotDrive.MotorType.kRearLeft, false);
        robotDrive.setInvertedMotor(RobotDrive.MotorType.kFrontRight, true);
        robotDrive.setInvertedMotor(RobotDrive.MotorType.kRearRight, true);
    }
    
    public void mecanumPolarStrafe(double magnitude, double direction) {
        this.magnitude = magnitude;
        this.direction = direction;
        update();
    }
    
    public void mecanumPolarRotation(double rotation) {
        this.rotation = rotation;
        update();
    }
    
    public double getMagnitude() {
        return magnitude;
    }
    
    public double getDirection() {
        return direction;
    }
    
    public UltrasonicSensor getUltrasonicSensor() {
        return ultrasonicSensor;
    }
    
    public void update() {
        robotDrive.mecanumDrive_Polar(magnitude, direction, rotation);
        driverStationLCD.clear();
        driverStationLCD.println(DriverStationLCD.Line.kUser1, 1, "Ultrasonic (ft): "
                + getUltrasonicSensor().getDistance());
        driverStationLCD.updateLCD();
    }
}


@@ -147,55 +147,8 @@
 or;%0A
-import edu.wpi.first.wpilibj.DriverStationLCD;%0A
 impo
@@ -184,16 +184,16 @@
 tDrive;%0A
+
 %0Apublic 
@@ -369,55 +369,8 @@
 or;%0A
-    private DriverStationLCD driverStationLCD;%0A
     
@@ -654,16 +654,16 @@
 annel, %0A
+
         
@@ -693,72 +693,8 @@
 E);%0A
-        this.driverStationLCD = DriverStationLCD.getInstance();%0A
     
@@ -1742,222 +1742,8 @@
 n);%0A
-        driverStationLCD.clear();%0A        driverStationLCD.println(DriverStationLCD.Line.kUser1, 1, %22Ultrasonic (ft): %22%0A                + getUltrasonicSensor().getDistance());%0A        driverStationLCD.updateLCD();%0A
     

Remove DriverStationLCD output from Drivetrain.