Skip to content
This repository was archived by the owner on Jun 13, 2023. It is now read-only.

Conversation

@andrew032011
Copy link
Contributor

@andrew032011 andrew032011 commented Dec 29, 2022

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:

  • Add .env file because the flight software depends on some environment variables to run
  • import MainSatelliteThread from FSW into sim.py and create a new instance of it to use its step method within the sim's step method

This 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.gz file 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:

  • Run python3 -m pip install --upgrade build to install the package needed to package the python project.
  • Run python3 -m build to compile the .tar.gz file you will install into the sim.
  • Two files will be created and placed into a dist/ directory. You will need the one with extension .tar.gz.

In sim:

  • Put the .tar.gz file in some directory within the sim.
  • Run pip install <file_name>.tar.gz (yes, no -e flag). For example, if you placed the file within the parent directory, you can just run pip install CislunarExplorers-0.1.tar.gz.
  • Run the sim like normal, with a config JSON file.

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.gz file 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

  • Add an x between the brackets if you commented your code well!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants