-
-
Notifications
You must be signed in to change notification settings - Fork 197
Enh/zero inertia tensor check #833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
8af308b
a97c2b2
cf494c4
fb94874
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -292,6 +292,29 @@ def __init__( # pylint: disable=too-many-statements | |
self.I_12_without_motor = inertia[3] | ||
self.I_13_without_motor = inertia[4] | ||
self.I_23_without_motor = inertia[5] | ||
inertia_matrix = Matrix( | ||
[ | ||
[ | ||
self.I_11_without_motor, | ||
self.I_12_without_motor, | ||
self.I_13_without_motor, | ||
], | ||
[ | ||
self.I_12_without_motor, | ||
self.I_22_without_motor, | ||
self.I_23_without_motor, | ||
], | ||
[ | ||
self.I_13_without_motor, | ||
self.I_23_without_motor, | ||
self.I_33_without_motor, | ||
], | ||
] | ||
) # Initial Inertia Tensor determinant singularity check | ||
if abs(inertia_matrix) == 0: | ||
raise ValueError( | ||
"The rocket inertia tensor is singular (determinant is zero). " | ||
) | ||
Comment on lines
+295
to
+317
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think having the dry inertia as zero should not stop the simulation, since someone might only have the inertias on the motor for some reason. In any case, we need the determinant of the Rocket + Motor Inertia Matrix to be different from zero. Could you move this check so that it is done when a motor is added? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So you mean to say someone might want to simulate just a motor and check the trajectory? Yes agreed I'll move it to when the motor is added. |
||
|
||
# Define rocket geometrical parameters in SI units | ||
self.center_of_mass_without_motor = center_of_mass_without_motor | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using abs(inertia_matrix) to check for a singular matrix might not correctly compute the determinant; it is recommended to use the proper determinant method (e.g., inertia_matrix.det()) for an accurate singularity check.
Copilot uses AI. Check for mistakes.