You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When trying to add RailButtons using the add_surfaces() method, RocketPy crashes because it requires a rocket_radius for all surfaces being added (this is due to Flight.u_dot_generalized() method). This method works fine for fins, tail and nosecone but doesn't for rail buttons (I also suspect for the aerobrakes).
To Reproduce
I have included the standard rocketpy Calisto script, but I added the RailButtons using this method (for fins I can add them this way). RocketPy crashes when it is trying to plot the flight details.
I would expect this to just work as it is the way to add AeroSurfaces Abstract Baseclasses to the rocket class. However, it crashes! I can solve this issue by stating:
rail_buttons=rocketpy.RailButtons(buttons_distance=0.0818+0.6182)
rail_buttons_position=-0.6182rail_buttons.rocket_radius=127/2000# Adding this line solves the problemcalisto.add_surfaces(rail_buttons, rail_buttons_position)
However, this might not be very intuitive to the user, as it is not required for other AeroSurfaces.
Additional context
This is the output for the script I provided:
capi_return is NULL
Call-back cb_f_in_lsoda__user__routines failed.
Fatal Python error: F2PySwapThreadLocalCallbackPtr: F2PySwapThreadLocalCallbackPtr: PyLong_AsVoidPtr failed
Python runtime state: initialized
Traceback (most recent call last):
File "/Users/djangovanderplas/micromamba/envs/python312_env/lib/python3.12/site-packages/scipy/integrate/_ivp/base.py", line 154, in fun
return self.fun_single(t, y)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/djangovanderplas/micromamba/envs/python312_env/lib/python3.12/site-packages/scipy/integrate/_ivp/base.py", line 23, in fun_wrapped
return np.asarray(fun(t, y), dtype=dtype)
^^^^^^^^^
File "/Users/djangovanderplas/micromamba/envs/python312_env/lib/python3.12/site-packages/rocketpy/simulation/flight.py", line 1759, in u_dot_generalized
surface_radius = aero_surface.rocket_radius
^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'RailButtons' object has no attribute 'rocket_radius'
I am on RocketPy version 1.2.2
The text was updated successfully, but these errors were encountered:
djangovanderplas
changed the title
RailButtons does not have rocket_radius attribute
BUG: RailButtons does not have rocket_radius attribute
May 20, 2024
Describe the bug
When trying to add
RailButtons
using theadd_surfaces()
method, RocketPy crashes because it requires a rocket_radius for all surfaces being added (this is due toFlight.u_dot_generalized()
method). This method works fine for fins, tail and nosecone but doesn't for rail buttons (I also suspect for the aerobrakes).To Reproduce
I have included the standard rocketpy Calisto script, but I added the
RailButtons
using this method (for fins I can add them this way). RocketPy crashes when it is trying to plot the flight details.Expected behavior
I would expect this to just work as it is the way to add AeroSurfaces Abstract Baseclasses to the rocket class. However, it crashes! I can solve this issue by stating:
However, this might not be very intuitive to the user, as it is not required for other AeroSurfaces.
Additional context
This is the output for the script I provided:
I am on RocketPy version 1.2.2
The text was updated successfully, but these errors were encountered: