This project controls the extension of airbrakes using a servo motor. It includes modules for logging data and managing the servo motor.
Clone the repository:
git clone https://github.com/yourusername/AirbrakesV2.git
cd AirbrakesV2
python3 -m venv venv
source venv/bin/activate
pip install .[dev]
sudo pigpiod
https://github.com/LORD-MicroStrain/MSCL
(scroll down and click on the Python 3 link for armhf (raspbian))
AirbrakesV2/
├── airbrakes/
| ├── hardware/
│ │ ├── [files related to the connection of the pi with hardware ...]
| ├── data_handling/
│ │ ├── [files related to the processing of data ...]
│ ├── [files which control the airbrakes at a high level ...]
├── tests/ [used for testing all the code]
│ ├── ...
├── logs/ [log files made by the logger]
│ ├── log_1.csv
├── scripts/ [small files to test individual components like the servo]
│ ├── ...
├── main.py [main file used to run on the rocket]
├── constants.py [file for constants used in the project]
├── pyproject.toml [configuration file for the project]
├── README.md
Our CI pipeline uses pytest to run tests. You can run the tests locally to ensure that your changes are working as expected.
To run the tests, run this command from the project root directory:
pytest
If you make a change to the code, please make sure to update or add the necessary tests.
Our CI also tries to maintain code quality by running a linter. We use Ruff.
To run the linter, and fix any issues it finds, run:
ruff check . --fix --unsafe-fixes
To format the code, run:
ruff format .
To run the main program, simply run:
python3 main.py
However during development, you may want to run individual scripts to test components. For example, to test the servo, run:
python3 -m scripts.run_servo
Feel free to submit issues or pull requests. For major changes, please open an issue first to discuss what you would like to change.