Skip to content
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

refactor to use a more traditional state machine pattern #69

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gcschmit
Copy link
Contributor

@gcschmit gcschmit commented Jul 19, 2024

I refactored the shooter state machine to use a more traditional state machine pattern. I was reminded of this pattern while reading this CD thread.

I think this is a much cleaner design in that it helps us clearly define what should be done when a state is entered, continuous while in a state, and when a state is exited.

I also added some maps to reduce the complexity of the code that sets the angle and shooter wheel velocities.

Please let me know what you think. If you like this approach and if you have time, use this branch to refactor the intake to use a the same pattern.

@gcschmit gcschmit marked this pull request as draft July 19, 2024 21:15
Copy link
Member

@StefanIlic1 StefanIlic1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love the way that the states are formatted like commands, I had never thought about it that way. Everything looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants