generated from StuyPulse/Phil
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix camera rotations * get rid of outlier data * move automatically scheduled commands to triggers inside robot container * potential fix for having to double click to shoot * feeder runs backwards on deacquire, dont retry intake * tune amp angle, fix intake led colors * switch ferry buttons * added arm climb commands * clean up climb commands and default led instruction * use old low ferry data as lob ferry data, fix arm angles for ferrying * sysid swerve --------- Co-authored-by: Tmanxyz <[email protected]>
- Loading branch information
Showing
10 changed files
with
190 additions
and
229 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
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
64 changes: 64 additions & 0 deletions
64
src/main/java/com/stuypulse/robot/commands/shooter/ShooterAcquireFromIntakeWithRetry.java
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package com.stuypulse.robot.commands.shooter; | ||
|
||
import com.stuypulse.robot.constants.Settings; | ||
import com.stuypulse.robot.subsystems.intake.Intake; | ||
import com.stuypulse.robot.subsystems.shooter.Shooter; | ||
import com.stuypulse.stuylib.util.StopWatch; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
|
||
public class ShooterAcquireFromIntakeWithRetry extends Command { | ||
|
||
private final Shooter shooter; | ||
private final Intake intake; | ||
|
||
private final StopWatch stopWatch; | ||
private boolean isFeeding; | ||
|
||
public ShooterAcquireFromIntakeWithRetry() { | ||
shooter = Shooter.getInstance(); | ||
intake = Intake.getInstance(); | ||
|
||
stopWatch = new StopWatch(); | ||
isFeeding = true; | ||
|
||
addRequirements(shooter, intake); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
stopWatch.reset(); | ||
intake.setState(Intake.State.FEEDING); | ||
shooter.setFeederState(Shooter.FeederState.INTAKING); | ||
} | ||
|
||
@Override | ||
public void execute() { | ||
if (isFeeding) { | ||
if (stopWatch.getTime() > Settings.Intake.HANDOFF_TIMEOUT) { | ||
intake.setState(Intake.State.DEACQUIRING); | ||
isFeeding = false; | ||
stopWatch.reset(); | ||
} | ||
} | ||
else { | ||
if (stopWatch.getTime() > Settings.Intake.MINIMUM_DEACQUIRE_TIME_WHEN_STUCK && intake.hasNote()) { | ||
intake.setState(Intake.State.FEEDING); | ||
isFeeding = true; | ||
stopWatch.reset(); | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public boolean isFinished() { | ||
return shooter.hasNote(); | ||
} | ||
|
||
@Override | ||
public void end(boolean interrupted) { | ||
shooter.setFeederState(Shooter.FeederState.STOP); | ||
intake.setState(Intake.State.STOP); | ||
} | ||
|
||
} |
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
Oops, something went wrong.