// 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.command.Command;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import org.usfirst.frc330.Beachbot2013Java.Robot;
/**
 *
 */
public class  TurnCamera extends TurnGyroRel {
    public TurnCamera() {
        // Use requires() here to declare subsystem dependencies
        // eg. requires(chassis);
	super(0,3,3,true);
        // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES
        requires(Robot.chassis);
    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES
    }
    public TurnCamera(double angle) {
        super(0, 3, 3, true);
    }
    public TurnCamera(double angle, double tolerance) {
        super(0, tolerance, 3, true);
    }
    public TurnCamera(double angle, double tolerance, double timeout, boolean stopAtEnd) {
        super(0, tolerance, timeout, stopAtEnd);
    }
    // Called just before this Command runs the first time
    protected void initialize() {
        angle = SmartDashboard.getNumber("angleToCenter", 0);
        super.initialize();
//        System.out.println("Angle to Center: " + angle);
    }
    /**
     * Not Used
     * @param angle 
     */
    public void setParam1(double angle) {
    }
    public Command copy() {
        return new TurnCamera();
    }
}

@@ -689,16 +689,32 @@
 .Robot;%0A
+/*%0A * $Log$%0A */%0A
 /**%0A *%0A 
@@ -1488,24 +1488,88 @@
 tialize() %7B%0A
+        if (SmartDashboard.getNumber(%22centerAge%22, 1) %3C 0.5)%0A    
         angl
@@ -1618,16 +1618,52 @@
 r%22, 0);%0A
+        else%0A            angle = 0;%0A
         

check age of vision data and don't turn if too old