package com.edinarobotics.zeke.subsystems;

import com.edinarobotics.utils.subsystems.Subsystem1816;
import edu.wpi.first.wpilibj.Gyro;
import edu.wpi.first.wpilibj.command.Command;

public class DrivetrainRotation extends Subsystem1816 {
    private double rotation;
    private Drivetrain drivetrain;
    private Gyro gyro;
    
    public DrivetrainRotation(Drivetrain drivetrain, int channel) {
        super("DrivetrainRotation");
        this.drivetrain = drivetrain;
        gyro = new Gyro(channel);
    }
    
    public void setMecanumPolarRotate(double rotation) {
        this.rotation = rotation;
        update();
    }
    
    public double getRotation() {
        return rotation;
    }
    
    public double getGyroAngle() {
        return gyro.getAngle();
    }
    
    public void resetGyro() {
        gyro.reset();
    }
    
    public void update() {
        drivetrain.mecanumPolarRotation(rotation);
    }
    
    public void setDefaultCommand(Command command){
        if(getDefaultCommand() != null){
            super.getDefaultCommand().cancel();
        }
        super.setDefaultCommand(command);
    }
    
}

@@ -129,16 +129,56 @@
 j.Gyro;%0A
+import edu.wpi.first.wpilibj.PIDOutput;%0A
 import e
@@ -270,16 +270,37 @@
 tem1816 
+implements PIDOutput 
 %7B%0A    pr
@@ -708,54 +708,208 @@
 lic 
-double getRotation() %7B%0A        return rotation
+void pidWrite(double rotation)%7B%0A        setMecanumPolarRotate(rotation);%0A    %7D%0A    %0A    public double getRotation() %7B%0A        return rotation;%0A    %7D%0A    %0A    public Gyro getGyro()%7B%0A        return gyro
 ;%0A  

Add Gyro related methods to DrivetrainRotation.