Permalink
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (51 sloc) 2.01 KB
// RobotBuilder Version: 1.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.frc1939.AerialAssist2014.commands;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import org.usfirst.frc1939.AerialAssist2014.Robot;
import org.usfirst.frc1939.AerialAssist2014.RobotMap;
/**
*
*/
public class Target extends Command {
private final double timeout;
private boolean go;
private int count;
public Target(double timeout) {
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES
go = false;
this.timeout = timeout;
}
// Called just before this Command runs the first time
protected void initialize() {
this.setTimeout(timeout);
RobotMap.drivetrainRobotDrive.setSafetyEnabled(false);
}
// Called repeatedly when this Command is scheduled to run
protected void execute() {
go = Robot.server.getLeftStatus();
SmartDashboard.putBoolean("Go", go);
}
// Make this return true when this Command no longer needs to run execute()
protected boolean isFinished() {
return go || this.isTimedOut();
}
// 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() {
}
}