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.
This code was made in response to the FSM event handling issue. Essentially, if we want to change command flags in response to changes in the FSM, we have to put all the command flag changes in the tick_FSM() function, which creates problems for code readability and extending infrastructure.
This implementation addresses the issue by abstracting the changing of command flags behind a new struct titled
MIDAS_Events.MIDAS_Eventscontains multiple functions, each corresponding to a state change (for instance,safe_to_pyroTest()corresponds to when the FSM is transitioning from theSAFEstate to thePYRO_TESTstate). In the fsm.cpp file, when there's a state transition, the correspondingMIDAS_Eventsfunction is called and takes in as a parameter theCommandFlagsobject passed to thetick_fsm()function. The command flags are then changed accordingly in theMIDAS_Eventsfunction defined in the MIDAS_Events.cpp file. The MIDAS_Events header and cpp files are both located in the finite-state-machines folder under src.