Draft
Add state transitions and command lifecycle documentation to StateMachine guide#161
Conversation
…hine guide Co-authored-by: TaylerUva <8679670+TaylerUva@users.noreply.github.com>
…at field declaration Co-authored-by: TaylerUva <8679670+TaylerUva@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update StateMachine guide for commands and transitions
Add state transitions and command lifecycle documentation to StateMachine guide
Jan 31, 2026
TaylerUva
requested changes
Jan 31, 2026
TaylerUva
left a comment
Member
There was a problem hiding this comment.
For a state machine end should not be used
Co-authored-by: TaylerUva <8679670+TaylerUva@users.noreply.github.com>
Contributor
Author
Fixed in 31c3c91. Updated the documentation to clarify that in state machines, Key changes:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

The StateMachine guide lacked practical implementation details for state transitions and command structure. Added comprehensive sections covering transition patterns and command lifecycle methods with proper state machine pattern guidance.
Changes
State Transitions
getAButtonPressed())Command Lifecycle Methods (State Machine Pattern)
initialize()- Setup: reset encoders, initialize flags, log command start, start motors for the stateexecute()- Monitoring and feedback: sensor polling, adjustments (motors already running from initialize)end(boolean interrupted)- DO NOT stop motors in state machines - only log completion, next state's initialize takes controlisFinished()- Completion patterns with guidance:State Machine Pattern
In state machines, motor control transitions directly between states:
initialize()end()Example
Screenshot
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.