// RobotBuilder Version: 1.5BB
//
// 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 edu.wpi.first.wpilibj.command.BBCommand;
import org.usfirst.frc330.Robot;

/**
 *
 */
public class  SetMastPosition extends BBCommand {

    public SetMastPosition() {
        // Use requires() here to declare subsystem dependencies
        // eg. requires(chassis);

        // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES
        requires(Robot.arm);

    // 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() {
    }

    // 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() {
    }
}

@@ -585,16 +585,18 @@
 mmand;%0D%0A
+%0D%0A
 import o
@@ -620,16 +620,61 @@
 .Robot;%0D
+%0Aimport org.usfirst.frc330.constants.ArmPos;%0D
 %0A%0D%0A/**%0D%0A
@@ -737,37 +737,324 @@
  %7B%0D%0A
-%0D%0A    public SetMastPosition(
+%09double angle;%0D%0A%09double timeout;%0D%0A%09double tolerance;%0D%0A    %0D%0A%09public SetMastPosition(double angle) %7B%0D%0A%09%09this(angle, ArmPos.tolerance, -1.0);%0D%0A%09%7D%0D%0A%09%0D%0A%09public SetMastPosition(double angle, double tolerance)%7B%0D%0A%09%09this(angle, tolerance, -1.0);%0D%0A%09%7D%0D%0A%09%0D%0A%09public SetMastPosition(double angle, double tolerance, double timeout
 ) %7B%0D
@@ -1319,24 +1319,123 @@
 D=REQUIRES%0D%0A
+        this.angle = angle;%0D%0A        this.timeout = timeout;%0D%0A        this.tolerance = tolerance;%0D%0A
     %7D%0D%0A%0D%0A   
@@ -1522,24 +1522,211 @@
 ialize() %7B%0D%0A
+    %09Robot.arm.setMastAngle(angle);%0D%0A    %09Robot.arm.setMastAbsoluteTolerance(tolerance);%0D%0A    %09if (timeout %3E= 0.0)%0D%0A    %09%09%7BsetTimeout(timeout);%7D%0D%0A    %09else%0D%0A    %09%09%7BsetTimeout(9999999);%7D%0D%0A
     %7D%0D%0A%0D%0A   
@@ -1954,24 +1954,58 @@
     
-    
+%09
 return 
-false
+(Robot.arm.onMastTarget() %7C%7C isTimedOut())
 ;%0D%0A 

Implement SetMastPosition