big refactor of command/commandbase/commandgroup. also add auton read from file.
[3501/3501-spark-go] / src / org / usfirst / frc / team3501 / robot / autons / DriveOverStep.java
CommitLineData
3e4790a8
LH
1package org.usfirst.frc.team3501.robot.autons;
2
b2640783 3import org.usfirst.frc.team3501.robot.commands.Command;
3e4790a8 4
b2640783 5public class DriveOverStep extends Command {
3e4790a8
LH
6
7 private double speed;
8
9 public DriveOverStep() {
10 super("DriveOverStep");
11 requires(drivetrain);
12
b2640783
LH
13 setTimeout(autonData.getTime("drive_over_step"));
14 speed = autonData.getSpeed("drive_over_step");
e81578e3
LH
15 }
16
17 // TODO: this is an ugly "solution"
18 public DriveOverStep(int coef) {
19 this();
20 this.speed *= coef;
3e4790a8
LH
21 }
22
23 protected void execute() {
24 drivetrain.goForward(speed);
25 }
26
27 protected boolean isFinished() {
28 return isTimedOut();
29 }
30
31 protected void end() {
32 drivetrain.stop();
33 }
34}