Skip to content

bears-space/rocketpal

RocketPal

pre-commit pytest Ruff

This is the RocketPy-based flight simulation for BEARS rockets, built by BEARS (Berlin Experimental Astronautics Research Student Team e.V.).

Usage

Setup / Installation

Setup uv

First, we need to install uv, a Python package manager.

  • On Linux and macOS, use curl -LsSf https://astral.sh/uv/install.sh | sh.
  • On Windows, use powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex".
  • When in doubt, refer to the official setup instructions: https://docs.astral.sh/uv/getting-started/installation/

Sync dependencies with uv

To install or update the dependencies of this project, run this command from within the project root:

uv sync --dev

The uv package manager also automatically manages a separate Python installation for the project, so you do not have to think about your system-wide Python installation and pip packages.

Setup pre-commit

To ensure a consistent style in the repository, pre-commit hooks are used.

Within the project root, install the pre-commit hooks to the local repository:

pre-commit install

The hooks are based on the configuration located in .pre-commit-config.yaml and will be run automatically before every git commit.

Basic usage

If you just want to run the simulation with default parameters, you can use one of the two provided scripts (assuming you installed Python and all required packages).

On Windows, run the following in a command prompt:

powershell -ExecutionPolicy Bypass -file .\run-simulation.ps1 .\template .\output

On Linux, run the following in a terminal:

bash ./run-simulation.sh ./template ./output

In both cases, if you do not pass arguments, the simulation uses the ./template folder to read its configuration and the ./output folder for output.

Advanced usage

The package contains two commands: The simulation (sim) and the GUI (gui).

You can run the simulation from a terminal as follows:

uv run python -m rocketpal sim ./input --output ./output

To see the available command line parameters, run one of the following (depending on what info you need):

uv run python -m rocketpal --help
uv run python -m rocketpal sim --help
uv run python -m rocketpal gui --help

Run unit tests

To run the provided unit tests, run this command from within the project root:

uv run python -m pytest

Configuration

A file for the motor has to be provided in .eng format. On at least one website offering compatible files, this format has been referred to as "RASP" format. It is documented here: https://www.thrustcurve.org/info/raspformat.html

About

Flight simulation framework based on RocketPy

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages