-
Notifications
You must be signed in to change notification settings - Fork 0
54 add shift detection #58
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
Merged
Merged
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
21568cd
(#54) Add basic shift detection prototype
aidnem c94f928
Match shift tracking and added to CoordinationLayer
j0shuaS a9314e6
Merge branch 'main' into 54-add-shift-detection
godmar 1f24056
change some of match state logic and added strategy constants for shi…
j0shuaS 41e98a9
remove json save
j0shuaS a17acd1
add constants to json
j0shuaS 0651c77
Add manual override functionality for match state in CoordinationLaye…
j0shuaS bbf8b15
Add match state override button for blue
j0shuaS a19cb48
change match time to start as negative infinity so that when it init'…
j0shuaS d251d8f
almost finished. bug with red and blue override not changing the alli…
j0shuaS 10c7795
fix auto winner bug
j0shuaS f3149cc
auto winner changed to use Optional
j0shuaS 716945e
Merge branch 'main' into 54-add-shift-detection
godmar 197f356
(#54) Fix various review comments and clean up code (will resolve com…
aidnem e39ea67
(#54) Add strategy constants to CI checker and fix extra fields
aidnem 7513d46
(#54) Add button bindings for red/blue winning auto
aidnem 4e690f2
(#54) Actually call bindings setup method and clean up getTimeLeftInC…
aidnem b163a1e
(#54) Allow for user correction if auto winner is incorrectly selecte…
aidnem 1423dc0
(#54) Remove old unused action keys
aidnem bebdd38
(#54) Document temporary code, remove unused volatile designation, re…
aidnem 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 hidden or 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 hidden or 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 hidden or 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,10 @@ | ||
| { | ||
| "shiftStartGracePeriod": { | ||
| "value": 2.0, | ||
| "unit": "Second" | ||
| }, | ||
| "shiftEndGracePeriod": { | ||
| "value": 2.0, | ||
| "unit": "Second" | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,54 @@ | ||
| package frc.robot.constants; | ||
|
|
||
| import static edu.wpi.first.units.Units.Seconds; | ||
|
|
||
| import edu.wpi.first.units.measure.Time; | ||
|
|
||
| public class StrategyConstants { | ||
| // Due to the presence of these constants, it is necessary for the driver(s) to play an active | ||
| // role in deciding when to score. | ||
|
|
||
| /** | ||
| * How much grace period to "add" to the start of each shooting shift. | ||
| * | ||
| * <p>For example, a value of 5 seconds means that the robot will enable shooting features 5 | ||
| * seconds before it estimates that an active shift begins | ||
| * | ||
| * <p>This constant is necessary because getMatchTime does not return an exact match result, and | ||
| * so the match time is simply an estimate. | ||
| */ | ||
| public final Time shiftStartGracePeriod = Seconds.of(2.0); | ||
|
|
||
| /** | ||
| * How much grace period to "add" to the end of each shooting shift. | ||
| * | ||
| * <p>For example, a value of 5 seconds means that the robot will only disable shooting features 5 | ||
| * seconds after it estimates that an active shift has ended | ||
| * | ||
| * <p>This constant is necessary because getMatchTime does not return an exact match result, and | ||
| * so the match time is simply an estimate. | ||
| */ | ||
| public final Time shiftEndGracePeriod = Seconds.of(2.0); | ||
|
|
||
| // list of shift start times in seconds from the start of the match | ||
| // 2:20 | ||
| public static final Double transitionStart = 2 * 60 + 20.0; // 140 | ||
|
|
||
| // 2:10 | ||
| public static final Double shift1Start = 2 * 60 + 10.0; // 130 | ||
|
|
||
| // 1:45 | ||
| public static final Double shift2Start = 60 + 45.0; // 105 | ||
|
|
||
| // 1:20 | ||
| public static final Double shift3Start = 60 + 20.0; // 80 | ||
|
|
||
| // 0:55 | ||
| public static final Double shift4Start = 55.0; | ||
|
|
||
| // 0:30 | ||
| public static final Double endgameStart = 30.0; | ||
|
|
||
| // 0:00 | ||
| public static final Double matchEnd = 0.0; | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.