Skip to content

Fix: swapped longitudinal/rotational inertia order - #43

Open
bwang257 wants to merge 2 commits into
RocketPy-Team:developfrom
WPI-HPRC:fix/inertia-order
Open

bwang257 wants to merge 2 commits into
RocketPy-Team:developfrom
WPI-HPRC:fix/inertia-order

Conversation

@bwang257

Copy link
Copy Markdown

search_rocket unpacks get_inertias() in the wrong order:
get_inertias returns (longitudinal, rotational) and rocket.py:24 assigns it to inertia_z, inertia_i, so rocket.inertia comes out as (rotational, rotational, longitudinal). In OpenRocket, "longitudinal" is the pitch/yaw inertia, not the roll inertia. AbstractRKSimulationStepper.java (328-330) in RocketPy divides the "longitudinal" inertia into pitch and yaw moments.

This PR swaps the unpack order (single line change) and adds a test that asserts that roll inertia < pitch inertia, skipping examples with no inertia data. This test fails initially and passes with the fix.

Also fixed the order in the example parameters.json files and tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant