A monorepo with all of UBC AeroDesign's software. This is the software touched by the software team, so it does not include the analysis scripts used by the mechanical subteams or the firmware used by the electrical subteams.
This repo's components can be run manually with Python/Node, or in Docker. Docker is a tool
that allows you to run software in a container, which is a virtual environment that you can define using Dockerfiles. This allows
the software to (usually) run the same way on any computer, regardless of the operating system or installed dependencies.
Docker is resource intensive, but if your computer can run Docker, you should use it since it helps us
be certain that our software works everywhere. If you can't run Docker, you can primarily run the software manually.
Even if you use Docker, you should do the manual setup below so that you can run components in isolation to test them.
This repo uses Python 3.9.13. It has to use that exact version because of Poetry and the dependencies not being happy with certain Python 3.9 versions.
To install Python 3.9.13, go to https://www.python.org/downloads/release/python-3913/ and download the installer for your OS and run it.
Make sure you check the box that says "Add Python 3.9 to PATH" while installing. You should be able to run python --version
in your terminal after installing properly. Keep in mind that terminals usually need to be restarted for PATH changes to take effect.
This monorepo uses Poetry to manage dependencies.
Poetry is a fancy way of managing packages in Python, and in theory it keeps things more consistent than if we just used
the standard pip and a requirements.txt file because it handles package version constraints with minimal user headache. Once you start
contributing, you should read Poetry's documentation to figure out how to use it.
To get started, install Poetry by following the instructions for your OS here.
Make sure you add Poetry to your PATH, so your terminal knows where to look for it.
Ask for help/Google this if you don't know how.
When installed, you should be able to run poetry --version in your terminal and see the version number.
With Poetry installed, you should set up a virtual environment. Poetry normally creates a different directory for virtual environments, but I recommend creating your own virtual environment first, which Poetry will respect, so that you can activate it like you normally would with a pip-only project. Sometimes for me, it doesn't respect my local venv anyway, so if it does its own thing just use the Poetry venv.
To create a virtual environment, follow these steps:
python --versionto make sure you're using Python 3.9.13 and that it's installed properly- If you haven't already, git clone codex into your local system and navigate to the root of the repo:
git clone http://github.com/ubcaerodesign/codex.git
cd codexpython -m venv .venvto create a virtual environment in a directory called .venvsource .venv/bin/activate(Linux) or.\.venv\Scripts\activate(Windows) to activate the virtual environment On PowerShell, you might get a prompt to enable script running, this can be done in an Administrator PowerShell window with the command:Set-ExecutionPolicy Unrestricted. Close and open your PowerShell windows and try activating again.poetry installto install all dependenciespre-commit installto set up pre-commit code formatting (see this)
Every time you start a new terminal, run the activate command again to enter the venv. Sometimes, PowerShell will lie to you and say that it's activated when it's not.
If all the commands run without errors, you should be able to run any python script in this repo.
Install Docker Desktop for your OS here. On Windows, choose the WSL backend if you
have a choice. Open a terminal and you should be able to run docker --version and docker compose version.
Our documentation about Docker can be found here
See the releases page for snapshots that describe how to run the code at certain points in time. Snapshots should be updated when big changes are made to this repo, with new instructions for how to run everything together.
Currently, after doing all the installation above, activating the virtual environment, and running Docker Desktop, you can run
python test.py --local
to run everything locally.
While the system is still running, run
python save_redis.py
to save the GPS and target prediction data to csv files.
This monorepo is composed of modules. A module is a project that accomplishes some individual task.
Each module has its own folder, and is self-contained. Each module has its own README, which describes the module in detail. A short description of each module is given below.
TODO add diagram of the system
Atlas is a Streamlit web-app that displays the GPS locations of the plane and predictions, for human verification. It might be replaced soon. Previously in the atlas repo.
Fast PySide6 (Qt) GUI for ground station operations like manually labelling targets, changing the state of the plane, and sending the drop PADA command to the plane. Previously in the gamer-gui repo.
Icarus is a React app that displays the altitude of the plane and PADA, which is a competition requirement.
Python script on the ground that distributes flight data and images to every microservice on the ground. Previously in the mercury repo.
Python script running on the plane, which manages the state of the plane and gathers data from the sensors/camera and sends it to the server. Previously in the spirit repo.
Python scripts that uses a trained YoloV7 model to detect targets in images and apply the X algorithm to determine the GPS location of targets. Previously in the vision repo.
Code written by UBC AeroDesign is flawless and bug-free. I'm not even sure why we have documentation, given that the code is perfectly intuitive and self-documenting.
In reality, we often just don't get around to testing because the frameworks we've chosen are hard to test with (PySide, Streamlit, code that communicates with servers/databases, etc.)
Usually, a lead will create a GitHub issue for a task, and assign it to a member. The member will then create a branch and work on the feature. The member should submit a pull request (PR) when the feature is complete and attach a screen recording of the feature working. Try ScreenToGif on Windows, or licecap on other platforms for easy screen recordings. For integration features, a live demo might be preferred. The leads will then review the PR and either request changes or approve it. Once approved, you can merge the branch into main.