Total Complexity | 6 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | |||
9 | public class CyborgCommandDriveDirect extends Command { |
||
10 | |||
11 | public static final long TIME_WAIT = 1000; |
||
12 | public double percent; |
||
13 | private long time; |
||
|
|||
14 | private boolean inRange; |
||
15 | |||
16 | public CyborgCommandDriveDirect(double percent) { |
||
17 | this.percent = percent; |
||
18 | requires(Robot.SUB_DRIVE); |
||
19 | } |
||
20 | |||
21 | protected void initialize() { |
||
22 | DriverStation.reportWarning("DRIVING BY POWER", false); |
||
23 | Robot.SUB_DRIVE.pid.reset(); |
||
24 | time = System.currentTimeMillis() + TIME_WAIT; |
||
25 | } |
||
26 | |||
27 | protected void execute() { |
||
28 | percent = Util.getAndSetDouble("Drive Direct Power", 0); |
||
29 | Robot.SUB_DRIVE.driveDirect(percent, percent); |
||
30 | } |
||
31 | |||
32 | protected boolean isFinished() { |
||
33 | return false; |
||
34 | } |
||
35 | |||
36 | protected void end() { |
||
37 | DriverStation.reportWarning("CyborgCommandDriveDirect finished", false); |
||
38 | Robot.SUB_DRIVE.driveDirect(0, 0); |
||
39 | } |
||
40 | |||
41 | protected void interrupted() { |
||
42 | end(); |
||
43 | } |
||
44 | } |