This repository was archived by the owner on Jun 13, 2023. It is now read-only.
[WIP] Draft implementation: Integration of FSW into sim - sim side #53
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.
Summary
This PR is the first step from the sim side towards integrating the flight software into the sim. It is a draft and most likely needs some more revisions before it can be merged in, after we spend some time testing it with FSW.
The latter half of Section 5 of my final report gives some more context to this change: https://cornell.box.com/s/d4qeksk9u0yf6tncf7p9uzw2w8dsuflm
Changes made:
sim.pyand create a new instance of it to use its step method within the sim's step methodThis PR should NOT be merged in until this FSW PR is: https://github.com/Cislunar-Explorers/FlightSoftware/pull/174
We also need to get FSW into a state in which there are no more "hardware errors" caused by a few last hardware calls/imports that haven't been addressed. But extensive testing of the FSW with the sim can only be done after the above linked PR is merged into master.
Testing
Successfully pip installed
.tar.gzfile into sim. The "hardware errors" that appear are consistent between running flight software by itself and running it alongside the sim. So, I conclude that there aren't any major integration issues at this point.Here are some instructions on how to test this:
Reference this tutorial as well: https://packaging.python.org/en/latest/tutorials/packaging-projects/
In FSW:
python3 -m pip install --upgrade buildto install the package needed to package the python project.python3 -m buildto compile the.tar.gzfile you will install into the sim.dist/directory. You will need the one with extension.tar.gz.In sim:
.tar.gzfile in some directory within the sim.pip install <file_name>.tar.gz(yes, no -e flag). For example, if you placed the file within the parent directory, you can just runpip install CislunarExplorers-0.1.tar.gz.Notes
You will need to use setup tools to compile FSW (either from this branch https://github.com/Cislunar-Explorers/FlightSoftware/pull/174 or from master if the changes are already merged in) into a
.tar.gzfile to test this.There will be more changes needed in FSW that will be uncovered after running the sim with FSW.
Cannot be merged into main until some more FSW changes to be made, mostly regarding some last hardware library imports/calls that still need to be sim'ed out.
Long-term note: A solution that has the dynamic attributes of git, without the module and namespacing issues, is the ultimate goal here. For now, this method of building FSW each time we push an update using setuptools and then pip installing it each time into the sim, will be a preliminary step to at least connect the flight software and the sim, as it will involve less major refactoring than the first method.
Comments