This is an extensive notebook that houses all of the simulations of our rockets.
- 🚀 RocketPy Integration: Full simulation capabilities for rocket design and flight
- 📊 Jupyter Notebooks: Interactive development and visualization
- 🎨 3D Rocket Renderer: Dedicated GUI application for visualizing rockets in 3D
- 📦 OpenRocket Import: Convert .ork files to RocketPy format
Start by running
uv syncWe now have a dedicated GUI application for viewing your rockets in 3D!
uv run python launch_viewer.pyThe viewer is kinematics-driven in simulation mode and no longer loads environment/forecast data.
In simulation mode, the 3D viewer now also shows a bottom-right HIL Events overlay with
three panels:
PayloadAvionicsRecovery
The current example seed is:
Payload:5000FT altitude servo test
If the viewer crashes on Linux with a Qt/Wayland window error (BadWindow),
force the backend explicitly:
ROCKET_VIEWER_QPA_PLATFORM=xcb uv run python launch_viewer.pyThis launches a user-friendly application where you can:
- Select individual components to view (motor, nose cone, fins, etc.)
- Rotate, pan, and zoom with your mouse
- Export models to STL for 3D printing
- View mesh statistics
The repository now includes a reusable PX4-style state estimation framework under sim/estimation.
It uses a strapdown inertial navigation system for the nominal state and a 15-state error-state Kalman filter for small-angle attitude, velocity, position, gyro bias, and accelerometer bias correction.
You can replay a manifest-based session directly for offline estimation:
from sim.estimation.adapters import run_rocketpy_replay
result = run_rocketpy_replay("logs/session_260313_190556")
estimates = result.estimates
print(estimates[["time_s", "est_z_m", "est_vz_mps"]].tail())If you need the old merged-table shape for analysis tooling, derive it explicitly from a session:
from sim.sitl.session import load_replay_session, merge_replay_session_sensors
session = load_replay_session("logs/session_260313_190556")
telemetry = merge_replay_session_sensors(session)Legacy virtual_sensors_full_rate_*.csv discovery still works for now, but it is deprecated.
The replay adapter consumes the same sensor fields:
- IMU prediction from
accelerometer_*andgyroscope_* - Barometric altitude updates from
barometer_v1 - GNSS position updates from
gnss_x,gnss_y, andgnss_z
For the current RocketPy exports, the GNSS columns are interpreted as latitude, longitude, and altitude, then converted into a local ENU frame relative to the first valid GNSS fix.
The runtime SITL path is now serial-only.
Current layers:
- Session replay: loads one manifest-based replay session and advances truth and sensors by timestamp.
- MAVLink codec: emits standard
common.xmlSYSTEM_TIME,HIL_SENSOR, andHIL_GPSmessages. - Serial transport: writes outbound HIL packets and decodes inbound MAVLink messages from the connected device.
- Typed feedback: maps inbound commands, logging, and estimator values into reusable feedback objects.
In the viewer, load a replay session, configure the USB serial port in the MAVLink panel, and enable MAVLink SITL.
The viewer now consumes typed feedback objects from the serial SITL layer instead of decoding raw MAVLink messages directly.
If you want a custom firmware command to appear in the bottom-right HIL events overlay:
- Pick your custom MAVLink command ID in firmware.
- Add or edit the mapping in
DEFAULT_COMMAND_EVENT_DEFINITIONSinsim/sitl/estimator_feedback.py. - When the firmware sends
COMMAND_LONGorCOMMAND_INTwith that command ID, the serial service will decode it into a typedDeviceStateEvent. - The viewer will render the resulting overlay event in the configured category panel.
Current example mapping:
COMMAND_LONG.command == 31000->Payload->5000FT altitude servo test
Relevant integration points:
sim/sitl/estimator_feedback.pydecode_mavlink_feedback(...)parses inbound MAVLink into typed feedback domains.DEFAULT_COMMAND_EVENT_DEFINITIONSholds the current command-to-event mapping.
sim/sitl/mavlink_sitl_service.py_SerialTransport._handle_incoming_chunk(...)decodes inbound MAVLink bytes.SitlMavlinkService.drain_pending_feedback()exposes typed feedback to the GUI.
sim/gui/rocket_viewer_app.py_handle_feedback(...)renders typed feedback into the HIL overlay.
Important detail: inbound custom-command handling is implemented on the serial/HIL path, which is where firmware should send MAVLink commands back to the viewer.
To launch the notebook, type
jupyter labAfter opening Jupyter Lab in your web browser, navigate to notebooks on the left side bar of the user interface.
Open notebooks folder and select the Itzamna folder, then open the Itzamna_flight_sim file.
To clear things out and start anew, open the Kernel tab, select the Restart Kernel and Clear Outputs of All Cells... option
Once you have made the changes you desire, and you wish to run the simulation, open the Run tab and select the Run All Cells option
I HIGHLY suggest you refrain from importing from OpenRocket, and instead work with this notebook to create your iterations of the rocket.
But if you must..... you are going to be converting an Open Rocket sim/rocket to RocketPy, and you must download the .jar Open Rocket installer.
Note: You MUST get the .jar version that aligns with the Open Rocket that you made the .ork file in.
https://openrocket.info/downloads.html
If you're going to convert an ork file, use
cd serializerand open INSTRUCTIONS.md to continue with the conversion.