// RobotBuilder Version: 0.0.2
//
// 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 th future.


package org.usfirst.frc3566.Mule.commands;

import edu.wpi.first.wpilibj.command.Command;
import org.usfirst.frc3566.Mule.Robot;
import org.usfirst.frc3566.Mule.RobotMap;

/**
 * @param mag The magnitude of left joystick
 * @param deg The degree of left joystick
 *
 */
public class  Drive extends Command {

    private double mag = 0;
    private double deg = 0;
    public Drive() {
        // Use requires() here to declare subsystem dependencies
        // eg. requires(chassis);
	
        // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES
        requires(Robot.driveTrain);
        // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES
    }

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

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
        /*
         * Update mag and deg
         */
         mag = 0.75*Robot.oi.leftJoystick.getMagnitude();
         deg = Robot.oi.leftJoystick.getDirectionDegrees();
         /*
          * Pass the parameters
          *  RobotMap.driveTrainRobotDrive.mecanumDrive_Polar(double magnitude, double degree, double rotation);
          */
        RobotMap.driveTrainRobotDrive.mecanumDrive_Polar(mag, deg, 0.75*Robot.oi.rightJoystick.getZ()); //The mecanum drive function that pass the parameters to the drivetrain to make it run
    }   

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        return false;
    }

    // Called once after isFinished returns true
    protected void end() {
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
    }
}

@@ -842,24 +842,52 @@
 le deg = 0;%0A
+    private double rot = 0;%0A
     public D
@@ -1495,16 +1495,19 @@
   deg = 
+-1*
 Robot.oi
@@ -1539,24 +1539,74 @@
 nDegrees();%0A
+         rot = 0.75*Robot.oi.leftJoystick.getZ();%0A
          /*%0A
@@ -1755,32 +1755,84 @@
 );%0A          */%0A
+         %0A        if(mag%3E.1%7C%7Cdeg%3E.1%7C%7Crot%3E.1)%7B %0A     
         RobotMap
@@ -1886,42 +1886,11 @@
 eg, 
-0.75*Robot.oi.rightJoystick.getZ()
+rot
 ); /
@@ -1971,24 +1971,39 @@
 make it run%0A
+        %7D%0A    %0A
     %7D   %0A%0A  

Commit it