mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 08:48:07 -06:00
fixed time logic
This commit is contained in:
@@ -460,6 +460,8 @@ public class RobotContainer {
|
||||
new RunCommand(() -> m_robotStorage.runStorage(StorageConstants.STORAGE_SPEED), m_robotStorage)
|
||||
));
|
||||
|
||||
// TODO: we should test TrackTarget timing with my RunCommandForTime thing at some point, same with DriveWithInput timing
|
||||
|
||||
// * aim with RotateUntilTarget
|
||||
// return new SequentialCommandGroup( new InstantCommand(() -> m_robotSwerveDrive.resetGyro(), m_robotSwerveDrive),
|
||||
// new DriveWithInputForTime(m_robotSwerveDrive, new double[] {0.5, 0.5, 0.0, 0.0}, 1.0),
|
||||
|
||||
@@ -54,6 +54,6 @@ public class DriveWithInputForTime extends CommandBase {
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return (((long) duration) >= (start - elapsed));
|
||||
return (elapsed >= duration);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,9 +70,9 @@ public class RunCommandForTime extends CommandBase {
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
if (this.override) {
|
||||
return (((long) this.duration) >= (this.elapsed - this.start));
|
||||
return (this.elapsed >= this.duration);
|
||||
} else {
|
||||
return (this.command.isFinished() && (((long) this.duration) >= (this.elapsed - this.start)));
|
||||
return (this.command.isFinished() && (this.elapsed >= this.duration));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user