-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance Indexer and Intake subsystems in simulation #15
Open
GreenTomato5
wants to merge
18
commits into
main
Choose a base branch
from
Intaking-stuff-sim
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
0a9acaa
Enhance Indexer and Intake subsystems with new state management and s…
GreenTomato5 377674b
Apply Prettier format
invalid-email-address a4ca529
Fix a TODO
GreenTomato5 ee2d1d1
Merge branch 'Intaking-stuff-sim' of https://github.com/FRC-7525/2024…
GreenTomato5 eed1354
Apply Prettier format
invalid-email-address 5e308c8
Had some medium thoughts per minute here
GreenTomato5 87be4e1
Merge branch 'Intaking-stuff-sim' of https://github.com/FRC-7525/2024…
GreenTomato5 2e67a73
Lalalalala
GreenTomato5 b6030af
Apply Prettier format
invalid-email-address d8e3431
Ngl I really want a waffle maker
GreenTomato5 9a660c9
Merge branch 'Intaking-stuff-sim' of https://github.com/FRC-7525/2024…
GreenTomato5 81776d4
Renaming
GreenTomato5 9026b3b
Apply Prettier format
invalid-email-address 9971ff3
Boiled up a light drizzle
GreenTomato5 69e888f
Merge branch 'Intaking-stuff-sim' of https://github.com/FRC-7525/2024…
GreenTomato5 570df6e
Those who know
GreenTomato5 1ceba5a
Apply Prettier format
invalid-email-address 6f8cf50
Cleanup
GreenTomato5 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
36 changes: 36 additions & 0 deletions
36
src/main/java/frc/robot/subsystems/Indexer/IndexerManager/IndexerInterface.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,36 @@ | ||
package frc.robot.subsystems.Indexer.IndexerManager; | ||
|
||
import frc.robot.pioneersLib.subsystem.Subsystem; | ||
import frc.robot.subsystems.Indexer.Indexer; | ||
import frc.robot.subsystems.Indexer.IndexerConstants; | ||
|
||
public class IndexerInterface extends Subsystem<IndexerInterfaceStates> { | ||
|
||
private static IndexerInterface instance; | ||
|
||
private IndexerInterface() { | ||
super("Indexer Manager", IndexerInterfaceStates.OFF); | ||
} | ||
|
||
public static IndexerInterface getInstance() { | ||
if (instance == null) { | ||
instance = new IndexerInterface(); | ||
} | ||
return instance; | ||
} | ||
|
||
public int getNumberOfPieces() { | ||
return Indexer.getInstance().getNumberOfPieces(); | ||
} | ||
|
||
public boolean isEmpty() { | ||
return Indexer.getInstance().getNumberOfPieces() == 0; | ||
} | ||
|
||
public boolean isFull() { | ||
return Indexer.getInstance().getNumberOfPieces() >= IndexerConstants.MAX_GAME_PIECES; | ||
} | ||
|
||
@Override | ||
public void runState() {} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/frc/robot/subsystems/Indexer/IndexerManager/IndexerInterfaceStates.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,21 @@ | ||
package frc.robot.subsystems.Indexer.IndexerManager; | ||
|
||
import frc.robot.pioneersLib.subsystem.SubsystemStates; | ||
import frc.robot.subsystems.Indexer.IndexerStates; | ||
|
||
public enum IndexerInterfaceStates implements SubsystemStates { | ||
SCORING("SCORING"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. State strings should prob be "humanized" -- "Scoring", "Off", etc. |
||
OFF("OFF"), | ||
AUTONOMOUS("Autonomous"); | ||
|
||
IndexerInterfaceStates(String stateString) { | ||
this.stateString = stateString; | ||
} | ||
|
||
private String stateString; | ||
|
||
@Override | ||
public String getStateString() { | ||
return stateString; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -7,8 +7,8 @@ | |
|
||
public class Intake extends Subsystem<IntakeStates> { | ||
|
||
IntakeIO io; | ||
IntakeIOInputsAutoLogged inputs; | ||
private IntakeIO io; | ||
private IntakeIOInputsAutoLogged inputs; | ||
private static Intake instance; | ||
|
||
private Intake(IntakeIO io) { | ||
|
@@ -39,4 +39,12 @@ public static Intake getInstance() { | |
} | ||
return instance; | ||
} | ||
|
||
public boolean hasGamepiece() { | ||
return io.hasGamepiece(); | ||
} | ||
|
||
public double getStateTime() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if you want to do this often you could just make |
||
return getStateTime(); | ||
} | ||
} |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is called IndexerInterface you should rename the folder + package too