Commit | Line | Data |
---|---|---|
3e4790a8 LH |
1 | package org.usfirst.frc.team3501.robot.autons; |
2 | ||
5b3b1652 | 3 | import org.usfirst.frc.team3501.bases.Command; |
3e4790a8 | 4 | |
b2640783 | 5 | public 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 | } |