Open
Conversation
Contributor
|
I took a look at this PR yesterday with @SuragNuthulapaty and after some brief discussion we came to the conclusion that this is a good implementation but needs some improvements (primarily, the RocketData pointer struct should always be present in an event callback). Since we're likely not going to be able to extensively test this and integrate it before all hands, let's come back to this after the LUNA launch. |
…erence command_flags, updated tick_fsm to take in rocket_data instead of commandflags
ishrakj
commented
Nov 8, 2025
Author
ishrakj
left a comment
There was a problem hiding this comment.
Updated MIDAS_Events functions to take in a RocketData pointer
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.
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.