-
Notifications
You must be signed in to change notification settings - Fork 0
Alpha State Machine #5
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
base: main
Are you sure you want to change the base?
Conversation
|
I'm marking this as ready for review bc i'm not sure how done it needs to be. No mech-specific code in here, but the infrastructure for binding commands to states, and all the transitions are implemented. The button bindings are implemented but are just placeholders. |
spellingcat
left a comment
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.
see the new graph i posted on #software in slack which i think simplifies things enough for the alpha
| private void addTransitions() { | ||
| bindTransition(SuperState.IDLE, SuperState.INTAKE, intakeReq); | ||
|
|
||
| bindTransition(SuperState.INTAKE, SuperState.READY, intakeReq.negate().or(isFull)); |
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.
add path from intake back to idle if it's empty and intake req is not true
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.
intake -> ready needs to be when intakereq.negate().and(is not empty)
| bindTransition( | ||
| SuperState.SCORE_FLOW, SuperState.READY, scoreReq.negate().and(isEmpty.negate())); | ||
|
|
||
| bindTransition(SuperState.SCORE_FLOW, SuperState.SCORE, scoreReq.and(continuousReq.negate())); |
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.
this is not that important but maybe put the bidirectional transitions next to each other
|
|
||
| isFull = new Trigger(routing::isFull); | ||
|
|
||
| isEmpty = new Trigger(routing::isEmpty); |
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.
i might add an isPartial or something like that for when the second beambreak is true but first is not
|
|
||
| bindTransition(SuperState.READY, SuperState.INTAKE, intakeReq.and(isFull.negate())); | ||
|
|
||
| bindTransition(SuperState.READY, SuperState.FEED, feedReq.and(continuousReq.negate())); |
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.
rename continuous to flowreq
| .and(DriverStation::isTeleop) | ||
| .or(Autos.autoFeedReq); | ||
|
|
||
| continuousReq = |
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.
yknow, i might actually get rid of continuous req as a separate button and just do like (intake req and score req) in place of continous req
Still WIP