// 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.frc330.Beachbot2013Java.commands;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.command.AutoSpreadsheetCommand;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.networktables.NetworkTable;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import org.usfirst.frc330.Beachbot2013Java.Robot;
/*
 * $Log: ArmLowShooting.java,v $
 * Revision 1.23  2013-03-28 02:59:40  jross
 * don't finish so that the arm can change angles when 2 is pressed
 *
 * Revision 1.22  2013-03-26 05:42:32  jross
 * try to adjust arm angle if button 2 is pressed again
 *
 * Revision 1.21  2013-03-25 05:05:38  jross
 * add method to use vision table
 *
 * Revision 1.20  2013-03-24 17:52:26  jross
 * Set flags on dashboard to turn down brightness on camera
 *
 * Revision 1.19  2013-03-16 21:17:47  jross
 * add javadocs
 *
 * Revision 1.18  2013-03-15 03:14:41  echan
 * Removed holdArmOff/On and the brake arm solenoid
 *
 * Revision 1.17  2013-03-15 02:58:57  echan
 * robotbuilder update
 *
 * Revision 1.16  2013-03-15 02:50:23  echan
 * added cvs log comments
 *
 */
/**
 * Move the arm to the shooting position for the Low Shooter. The position is 
 * defined by the lookup table defined in 2013VisionTable.csv on the robot.
 */
public class  ArmLowShooting extends Command implements AutoSpreadsheetCommand {
    public ArmLowShooting() {
        // 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
    double timer;
    protected void initialize() {
        Robot.frisbeePickup.setFrisbeePickupDown(); 
        timer = Robot.frisbeePickup.getPickupDownTime() + Robot.arm.armWaitShooting();
        Robot.arm.disable();
        //Robot.arm.armSetPointLowShooting();
        Robot.arm.armSetPointLowVision();
        SmartDashboard.putBoolean("BrightCamera", false);
    }
    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
        if (Robot.frisbeePickup.isPickupDown() && Timer.getFPGATimestamp() > timer) {
            if (!Robot.arm.isEnable())
                Robot.arm.enable();
//            if (Robot.oi.shootLowButton.get() == true)
            {
                Robot.arm.armSetPointLowCheckVision();
            }
        }
    }
    // 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() {
    }
    /**
     * Not Used
     * @param param1 
     */
    public void setParam1(double param1) {
    }
    /**
     * Not Used
     * @param param2 
     */
    public void setParam2(double param2) {
    }
    /**
     * Not Used
     * @param param3 
     */
    public void setParam3(double param3) {
    }
    /**
     * Not Used
     * @param stopAtEnd 
     */
    public void setStopAtEnd(boolean stopAtEnd) {
    }
    public Command copy() {
        return new ArmLowShooting();
    }
}

@@ -680,65 +680,8 @@
 nd;%0A
-import edu.wpi.first.wpilibj.networktables.NetworkTable;%0A
 impo
@@ -822,16 +822,92 @@
 ava,v $%0A
+ * Revision 1.24  2013-03-29 04:40:16  jross%0A * adjust arm automatically%0A *%0A
  * Revis
@@ -2451,18 +2451,16 @@
         
-//
 Robot.ar
@@ -2491,50 +2491,8 @@
 ();%0A
-        Robot.arm.armSetPointLowVision();%0A
     
@@ -2810,148 +2810,8 @@
 ();%0A
-//            if (Robot.oi.shootLowButton.get() == true)%0A            %7B%0A                Robot.arm.armSetPointLowCheckVision();%0A            %7D%0A
     
@@ -2954,21 +2954,36 @@
  return 
-false
+Robot.arm.onTarget()
 ;%0A    %7D%0A

revert to LA regional version that doesn't use camera for arm angle. Use ArmVariableShooting for camera arm angle