-
Notifications
You must be signed in to change notification settings - Fork 0
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
Enforce assumptions in System Mode Manager initialisation #13
Comments
Solid work on 3cb6756 to 0e6cd71 -- very elegant control flow injection 😄 As we'd discussed previously already, nice refactoring of the initial assumptions and initialisation of the report variables with the assumed data! Nice implementation of the retry loop too! I'm only a little worried about the isolation of the initial state in the System Mode Manager's statechart view -- though analysing the transitions does reveal that it can only end up in In the Mission Mode Change TC Handler, very interesting introduction of a separate Also, one thing that I forgot to mention: I noticed you only changed the |
⬆️ @xszymonzur pls write down anything you do differently to the Capella model so I can backpropagate it ⬆️ (don't let me catch up ;) |
#4 and #11 introduced a relatively simple bug in the System Mode Manager: initial subsystem states are only assumed, not enforced.
As this bug became apparent through a discrepancy with the payload camera, for
cloudview-1
(Release) this was hot-fixed by adding manual mode override through Serial in guorbit/camera-relay (cloudview-1
Release):src/main.cpp
, lines 57-80 @ 3731638 (comment).This "hack" adopts the approach of ensuring the assumptions are correct, which did work but is suboptimal in terms of robustness, especially in unmanned initialisation scenarios. Instead -- or, better yet, in addition -- it would be auspicable to programmatically enforce the assumptions in the initial transition of the System Mode Manager.
My idea is to substitute the assignments in the initialisation line with calls to the same code that requests the TC-based "arbitrary" subsystem mode changes, but requesting the currently assumed initial mode instead.
It should be possible to achieve this elegantly enough through SDL Joins or SDL Procedures: internal refactorings should be strongly preferred, to minimise the architectural impact and memory footprint of these changes.
(TASTE SDL Tutorial)
We should also think about how to handle failures: the most basic approach would be to wrap this in a loop to try again until success, but Rule 2 of NASA/JPL's The Power of 10 prescribes that indefinite loops should be avoided. This could potentially be an exception, as operational functionalities cannot be safely reached unless initialisation is successful; otherwise, a definite loop could leave an increasing time between successive tries to hopefully allow for completion of whatever process is causing the failure.
A perhaps better approach could be to get rid of the assumptions entirely, assigning the actual state contained in the subsystem's response instead of the requested assumption.
The text was updated successfully, but these errors were encountered: