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 13, 2024
1 parent e43775a commit ccd6373
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 5 additions & 7 deletions rocketpy/rocket/aero_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1861,13 +1861,8 @@ class RailButtons(AeroSurface):
relative to one of the other principal axis.
"""

def __init__(
self,
rocket_radius,
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 @@ -1882,6 +1877,8 @@ def __init__(
Name of the rail buttons. Default is "Rail Buttons".
rocket_radius: int, float, optional
The reference rocket radius used for lift coefficient normalization.
rocket_radius: int, float, optional
The reference rocket radius used for lift coefficient normalization.
Returns
-------
Expand All @@ -1893,6 +1890,7 @@ def __init__(
self.angular_position = angular_position
self.name = name
self.rocket_radius = rocket_radius
self.rocket_radius = rocket_radius
self.evaluate_lift_coefficient()
self.evaluate_center_of_pressure()

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

0 comments on commit ccd6373

Please sign in to comment.