This repository has been archived by the owner on Nov 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup, doc formatting, and set dynamic replan to false
- Loading branch information
Showing
2 changed files
with
52 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,22 @@ | ||
package frc.robot.commands.shooter; | ||
|
||
import edu.wpi.first.wpilibj.Timer; | ||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.robot.RobotContainer; | ||
|
||
public class WaitForNote extends Command { | ||
private final Timer timer = new Timer(); | ||
public WaitForNote() { | ||
addRequirements(RobotContainer.shooter, RobotContainer.intake, RobotContainer.arm); | ||
addRequirements(RobotContainer.shooter, RobotContainer.intake); | ||
} | ||
|
||
@Override | ||
public void end(boolean inter) { | ||
timer.stop(); | ||
timer.reset(); | ||
RobotContainer.shooter.stopIndexer(); | ||
RobotContainer.intake.stop(); | ||
} | ||
|
||
@Override | ||
public boolean isFinished() { | ||
var hasNote = RobotContainer.shooter.hasNote(); | ||
if (hasNote) { | ||
timer.start(); | ||
} else { | ||
timer.reset(); | ||
} | ||
|
||
return hasNote; //&& timer.hasElapsed(0.06); | ||
return hasNote; | ||
} | ||
} |