Skip to content

Commit

Permalink
BUG: RailButtons does not have rocket_radius attribute #606.
Browse files Browse the repository at this point in the history
rocket_radius attribute added to RailButtons Class
  • Loading branch information
juliomachad0 committed Jul 11, 2024
1 parent 758f29d commit 87480c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions rocketpy/rocket/aero_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1861,7 +1861,8 @@ class RailButtons(AeroSurface):
relative to one of the other principal axis.
"""

def __init__(self, buttons_distance, angular_position=45, name="Rail Buttons"):
def __init__(self, rocket_radius, buttons_distance,
angular_position=45, name="Rail Buttons",):
"""Initializes RailButtons Class.
Parameters
Expand All @@ -1874,6 +1875,8 @@ def __init__(self, buttons_distance, angular_position=45, name="Rail Buttons"):
relative to one of the other principal axis.
name : string, optional
Name of the rail buttons. Default is "Rail Buttons".
rocket_radius: int, float, optional
The reference rocket radius used for lift coefficient normalization.
Returns
-------
Expand All @@ -1884,7 +1887,7 @@ def __init__(self, buttons_distance, angular_position=45, name="Rail Buttons"):
self.buttons_distance = buttons_distance
self.angular_position = angular_position
self.name = name

self.rocket_radius = rocket_radius
self.evaluate_lift_coefficient()
self.evaluate_center_of_pressure()

Expand Down
5 changes: 3 additions & 2 deletions rocketpy/rocket/rocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -1509,8 +1509,9 @@ def set_rail_buttons(
RailButtons object created
"""
buttons_distance = abs(upper_button_position - lower_button_position)
rail_buttons = RailButtons(
buttons_distance=buttons_distance, angular_position=angular_position
rail_buttons = RailButtons(rocket_radius=self.radius,
buttons_distance=buttons_distance,
angular_position=angular_position
)
self.rail_buttons.add(rail_buttons, lower_button_position)
return rail_buttons
Expand Down

0 comments on commit 87480c6

Please sign in to comment.