// RobotBuilder Version: 2.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.frc5053.FRC2016Stronghold.commands;

import edu.wpi.first.wpilibj.command.Command;
import org.usfirst.frc5053.FRC2016Stronghold.Robot;

/**
 *
 */
public class AllwaysTrackLocation extends Command {

    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_DECLARATIONS
 
    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_DECLARATIONS

    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTOR
    public AllwaysTrackLocation() {

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTOR
        // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_SETTING

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

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

@@ -715,24 +715,39 @@
  Command %7B%0D%0A
+    double x,y;
 %0D%0A    // BEG
@@ -1501,24 +1501,43 @@
 ialize() %7B%0D%0A
+        x=0; y=0;%0D%0A
     %7D%0D%0A%0D%0A   
@@ -1625,24 +1625,415 @@
 xecute() %7B%0D%0A
+        double rightSpeed = RobotHome.driveTrainLeftWheelEncoder.get(); %0D%0A        double leftSpeed  = RobotHome.driveTrainLeftWheelEncoder.get();%0D%0A        %0D%0A        double robotSpeed = (leftSpeed+rightSpeed)/2%0D%0A        %0D%0A        double currentAngle = RobotHome.gyroToUse.getAngle();%0D%0A        // Assume 20 milli seconds%0D%0A        x = x+ cos(currentAngle);%0D%0A        y = y+ sin(currentAngle); %0D%0A
     %7D%0D%0A%0D%0A   

Update AllwaysTrackLocation.java