// RobotBuilder Version: 1.0
//
// This file was generated by RobotBuilder. It contains sections of
// code that are automatically generated and assigned by robotbuilder.
// These sections will be updated in the future when you export to
// Java from RobotBuilder. Do not put any code or make any change in
// the blocks indicating autogenerated code or it will be lost on an
// update. Deleting the comments indicating the section will prevent
// it from being updated in the future.
package org.usfirst.frc330.commands;
import org.usfirst.frc330.Robot;
import org.usfirst.frc330.constants.ChassisConst;
import org.usfirst.frc330.wpilibj.PIDGains;
/**
 *
 */
public class  DriveDistanceAtAbsAngle_NoTurn extends DriveDistance{
    double angle;
    
    
    public DriveDistanceAtAbsAngle_NoTurn(double distance, double angle)
    {
        this(distance, 6, angle, -1.0, true, ChassisConst.DriveLow, ChassisConst.DriveHigh, ChassisConst.GyroLow, ChassisConst.GyroHigh); //-1 means no timeout
    }
    
    public DriveDistanceAtAbsAngle_NoTurn(double distance, double angle, double tolerance)
    {
        this(distance, tolerance, angle, -1.0, true, ChassisConst.DriveLow, ChassisConst.DriveHigh, ChassisConst.GyroLow, ChassisConst.GyroHigh); //-1 means no timeout
    }
    
    public DriveDistanceAtAbsAngle_NoTurn(double distance, double tolerance, double angle, double timeout, boolean stopAtEnd, PIDGains driveLow, PIDGains driveHigh, PIDGains gyroLow, PIDGains gyroHigh)
    {
        super(distance, tolerance, timeout, stopAtEnd, driveLow, driveHigh);
        this.angle = angle;
    }
    // Called just before this Command runs the first time
    protected void initialize() {
//    	leftDistance = leftDistance + Robot.chassis.getLeftDistance();
//        rightDistance = rightDistance + Robot.chassis.getRightDistance();
        super.initialize();
        if (Robot.chassis.isHighGear())
        {
            Robot.chassis.gyroPID.setPID(ChassisConst.GyroHigh);
        }
        else
        {
            Robot.chassis.gyroPID.setPID(ChassisConst.GyroHigh);
        }
        
        Robot.chassis.gyroPID.setSetpoint(angle);
        Robot.chassis.gyroPID.enable();  
    }
}

@@ -757,24 +757,58 @@
 angle;%0D%0A    
+PIDGains gains, gyroLow, gyroHigh;
 %0D%0A    %0D%0A    
@@ -1652,24 +1652,92 @@
 e = angle;%0D%0A
+        this.gyroHigh = gyroHigh;%0D%0A        this.gyroLow = gyroLow;%0D%0A
     %7D%0D%0A    /
@@ -2042,18 +2042,17 @@
 hGear())
-%0D%0A
+ 
         
@@ -2070,59 +2070,24 @@
     
-Robot.chassis.gyroPID.setPID(ChassisConst.G
+gains = g
 yroHigh
-)
 ;%0D%0A 
@@ -2108,26 +2108,31 @@
     else
-%0D%0A
+ %7B%0D%0A   
         
 %7B%0D%0A     
@@ -2115,39 +2115,62 @@
 e %7B%0D%0A           
-%7B%0D%0A    
+ gains = gyroLow;%0D%0A        %7D%0D%0A
         Robot.ch
@@ -2194,52 +2194,15 @@
 PID(
-ChassisConst.GyroHigh);%0D%0A        %7D%0D%0A        
+gains);
 %0D%0A  

Fix DriveDistanceAtAbsAngle_NoTurn so it uses specified gyro gains