ASTRA-Loop is a Software-in-the-Loop (SITL) simulation environment for testing apogee prediction algorithms and airbrake control strategies on experimental student rocket flight data.
- Python 3.10+
- Dependencies listed in
requirements.txt
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python main.py- Launch the application with
python main.py. - Click Browse CSV… and select a flight log (OpenRocket export or Kalman filter log).
- Choose a Filter, Predictor, and Controller from the dropdown menus.
- For
ApogeePredict3D, optionally choose a Coast Solver (eulerorrk4). - Click Run Simulation to execute the SITL loop and view plots with performance metrics.
- For PD calibration, use Calibrate… with
data/calibration/scenarios.yaml(see data/calibration/README.md).
See GUIDELINES.md for architecture details and instructions on adding new algorithms.
Both predictors estimate apogee during coast after burnout. Physical constants (mass, drag coefficient, reference atmosphere, …) come from Model Parameters.
Pressure-only estimator for pitot/static-style logs.
Inputs (CSV): static_pressure, total_pressure [Pa]
Pipeline each step:
- Differential pressure:
$$\Delta p = \max(p_{\mathrm{total}} - p_{\mathrm{static}},, 0)$$ - Altitude from the barometric relation (ISA-style scale height / exponent in
ModelParams). - Airspeed from Bernoulli using density at the estimated altitude:
$$v_z = \sqrt{2,\Delta p / \rho(z)}$$ - Closed-form coast apogee with quadratic drag. Drag force is taken directly from
$\Delta p$ as dynamic pressure:$$F_d = \Delta p \cdot C_d \cdot A$$ so the algorithm does not recompute$\frac{1}{2}\rho v^2$ from the derived speed (avoids redundant calculation and keeps drag consistent with the pressure measurement).
Outputs: position_z, velocity_z, predicted_apogee
When
OpenRocket pressure/Mach exports can be converted with profile apogee_1d (or apogee_1d_eval if altitude is included for metrics). Total pressure is reconstructed from static pressure and Mach via the isentropic relation:
State-based coast propagator for Kalman / OpenRocket kinematics logs.
Inputs (CSV): position_z, velocity_z, and either velocity_lateral (velocity_x and velocity_y
Pipeline each step:
- Read current
$z$ ,$v_z$ , and lateral speed squared$v_{\mathrm{lat}}^2$ . - Numerically integrate coast dynamics until
$v_z \le 0$ :
with
Outputs: predicted_apogee (final time_to_apogee
Optimizations / design choices:
- State uses
$v_{\mathrm{lat}}^2$ instead of separate$v_x$ ,$v_y$ — one less variable in the ODE, same physics for axisymmetric drag. - Shared derivative function
_coast_derivativesfor both integrators. - Chooseable solver in the GUI (Coast Solver, only when this predictor is selected):
-
euler— forward Euler (default, cheaper per step) -
rk4— classical 4th-order Runge–Kutta (more accurate for the samedt)
-
Default step size is