-
Notifications
You must be signed in to change notification settings - Fork 4
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
Shuffleboard abstraction #31
Changes from 1 commit
9d0ba93
fa5b47e
4bc05fd
ff0ca1a
e329d83
8794024
d9d2fba
5a01184
e9aef3a
6108af2
46639fc
0a7c144
1c7d9a7
4f383e3
0bba935
58db64d
d94c188
e3023e4
207fa74
827e399
2c64a8c
e53ea54
76f28f3
39fa9b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -204,9 +204,21 @@ public void periodic() { | |
// Spin the top motor on a timer | ||
exitTimer.start(); | ||
motorTop.set(0.5); | ||
stagingExitBall = true; | ||
// TEST stagingExitBall = true; | ||
} | ||
|
||
/*if (stagingExitBall) { | ||
motorTop.set(0.5); | ||
} | ||
*/ | ||
|
||
// shot requested, timer starts, while ball is in staging timer keeps | ||
// starting, when ball exits staging 0.5 | ||
// seconds after shot is finished, if in that time period 0<t<0.5 | ||
// another ball is detected, timer *should* reset | ||
// however if there is still 1 or 0 balls in internals, shot is | ||
// finished and timer will not start again if ball is detected | ||
|
||
// If 0.5 seconds have elapsed, mark the shot as finished | ||
if (exitTimer.hasElapsed(0.5)) { | ||
exitTimer.stop(); | ||
|
@@ -215,18 +227,18 @@ public void periodic() { | |
|
||
// Reset states | ||
// If the only ball in the system is the one we just shot, mark the shot as completed | ||
if (ballCount <= 1) shotRequested = false; | ||
if (ballCount < 1) shotRequested = false; | ||
rejectingChecked = false; | ||
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. This is a little more complicated. If we skip the 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. Perhaps a solution is to only skip the |
||
skipToleranceCheck = false; | ||
stagingExitBall = false; | ||
// TEST stagingExitBall = false; | ||
} | ||
|
||
// Set the ball count from staging, storage, and the transition state booleans. | ||
ballCount = (entranceStorageBall ? 1 : 0) | ||
+ (storageDetected ? 1 : 0) | ||
+ (storageStagingBall ? 1 : 0) | ||
+ (stagingDetected ? 1 : 0) | ||
+ (stagingExitBall ? 1 : 0); | ||
+ (stagingDetected ? 1 : 0) ; | ||
// TEST + (stagingExitBall ? 1 : 0); | ||
ballCountEntry.setValue(ballCount); | ||
|
||
turretSubsystem.setBallReady(ballCount > 0); | ||
|
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.
So the way the two ball shot delay was fixed was to remove the final ball state entirely? Perhaps just commenting out the
!stagingExitBall
check on line 166 would be a better solution which still represents the ball count semi-accurately?