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 another step towards integrating flight software and the sim. It allows for flight software to be completely (all files included) compiled into a .tar.gz file. This will allow for the .tar.gz file to be pip installed into the sim and for testing to be done between the two systems. Installing FSW into the sim like this will reveal any last holes for successfully integrating the FSW into the sim.

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:

  • Rename module utils to fsw_utils to prevent namespace conflicts between fsw's utils and sim's utils modules.
  • Place main.py into a module, fsw_main so that it can be picked up and packaged by setuptools. Every file that we want setuptools to pick up must be in a module.
  • Add __init__.py files to modules that were previously missing them (setuptools does not pick up on modules that do not have an __init__.py file).

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

  • Again, there might be more changes needed in FSW that will be uncovered after running the sim with FSW.
  • The corresponding proposed sim change to this that integrates sim into FSW cannot be merged into main because there are still some more FSW changes to be made, mostly regarding some last hardware library imports/calls that 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!

@andrew032011 andrew032011 changed the title change utils module to fsw_utils Setup FSW to be plugged into the Sim Dec 29, 2022
@andrew032011 andrew032011 changed the title Setup FSW to be plugged into the Sim Set up FSW to be plugged into the Sim Dec 29, 2022
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