package edu.stuy.commands;

import edu.stuy.Robot;
import edu.wpi.first.wpilibj.command.Command;

/**
 * Rotates the Robot without PID values
 */

public class DrivetrainRotateNoPIDCommand extends Command {

    private double degrees;
    private double startAngle;

    public DrivetrainRotateNoPIDCommand(double _degrees) {
        requires(Robot.drivetrain);
        degrees = _degrees;
        startAngle = Robot.drivetrain.getGyroAngle();
    }

    // Called just before this Command runs the first time
    protected void initialize() {
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
        if (degrees < 0) {
            Robot.drivetrain.tankDrive(-0.5, 0.5);
        } else if (degrees > 0) {
            Robot.drivetrain.tankDrive(0.5, -0.5);
        }
    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        if (degrees == 0) {
            return true;
        } else {
            return Math.abs(Robot.drivetrain.getGyroAngle() - startAngle) >= Math.abs(degrees);
        }
    }

    // Called once after isFinished returns true
    protected void end() {
        Robot.drivetrain.stop();
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
    }
}
@@ -932,24 +932,119 @@
 inished() %7B%0A
+        // return Math.abs(Robot.drivetrain.getGyroAngle() - startAngle) %3E= Math.abs(degrees);%0A
         if (
@@ -1055,10 +1055,9 @@
 ees 
-==
+%3E
  0) 
@@ -1081,28 +1081,96 @@
 urn 
-true;%0A        %7D else
+Robot.drivetrain.getGyroAngle() - startAngle %3E= degrees;%0A        %7D else if (degrees %3C 0)
  %7B%0A 
@@ -1183,33 +1183,37 @@
      return 
-Math.abs(
+startAngle - 
 Robot.drivet
@@ -1236,42 +1236,61 @@
 e() 
-- startAngle) %3E= Math.abs(degrees)
+%3E= -degrees;%0A        %7D else %7B%0A            return true
 ;%0A  

Add fix for DrivetrainRotateNoPIDCommand