*
*/
public class MoveArmFor extends Command {
- private double seconds;
- private Timer timer;
- private Direction direction;
-
- /*
- * @param Direction must be up or down
- */
- public MoveArmFor(double seconds, Direction direction) {
- this.seconds = seconds;
- this.direction = direction;
+ private double seconds;
+ private Timer timer;
+ private Direction direction;
+
+ /*
+ * @param Direction must be up or down
+ */
+ public MoveArmFor(double seconds, Direction direction) {
+ this.seconds = seconds;
+ this.direction = direction;
+ }
+
+ @Override
+ protected void initialize() {
+ timer = new Timer();
+ timer.start();
+ }
+
+ @Override
+ protected void execute() {
+ if (direction == Direction.UP) {
+ Robot.arm.setArmSpeeds(-RobotMap.ARM_LOW_SPEED);
+ } else if (direction == Direction.DOWN) {
+ Robot.arm.setArmSpeeds(RobotMap.ARM_LOW_SPEED);
}
+ }
- @Override
- protected void initialize() {
- timer = new Timer();
- timer.start();
- }
-
- @Override
- protected void execute() {
- if (direction == Direction.UP) {
- Robot.arm.setArmSpeeds(-RobotMap.ARM_LOW_SPEED);
- } else if (direction == Direction.DOWN) {
- Robot.arm.setArmSpeeds(RobotMap.ARM_LOW_SPEED);
- }
- }
-
- @Override
- protected boolean isFinished() {
- if (timer.get() > seconds) {
- Robot.arm.setArmSpeeds(0);
- }
- return timer.get() > seconds;
- }
-
- @Override
- protected void end() {
- Robot.arm.setArmSpeeds(0);
- }
-
- @Override
- protected void interrupted() {
- end();
+ @Override
+ protected boolean isFinished() {
+ if (timer.get() > seconds) {
+ Robot.arm.setArmSpeeds(0);
}
+ return timer.get() > seconds;
+ }
+
+ @Override
+ protected void end() {
+ Robot.arm.setArmSpeeds(0);
+ }
+
+ @Override
+ protected void interrupted() {
+ end();
+ }
}