mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 00:38:05 -06:00
tested RunCommandForTime + DWIForTime in robotsim, both work
This commit is contained in:
@@ -56,6 +56,7 @@ public class RunCommandForTime extends CommandBase {
|
||||
// Called every time the scheduler runs while the command is scheduled.
|
||||
@Override
|
||||
public void execute() {
|
||||
System.out.println("RUNNING");
|
||||
this.elapsed = System.currentTimeMillis() - this.start;
|
||||
this.command.execute();
|
||||
}
|
||||
@@ -70,6 +71,8 @@ public class RunCommandForTime extends CommandBase {
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
if (this.override) {
|
||||
System.out.println("Duration: " + duration);
|
||||
System.out.println("Elapsed: " + elapsed);
|
||||
return (this.elapsed >= this.duration);
|
||||
} else {
|
||||
return (this.command.isFinished() && (this.elapsed >= this.duration));
|
||||
|
||||
Reference in New Issue
Block a user