Skip to content

Commit 3924dc5

Browse files
authored
Merge pull request #43 from RocketPy-Team/fix/motor-nobuttons
FIX: Add Motors to Rocket without rail buttons.
2 parents e70e666 + 77cccde commit 3924dc5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/services/rocket.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ def from_rocket_model(cls, rocket: RocketView) -> Self:
4545
center_of_mass_without_motor=rocket.center_of_mass_without_motor,
4646
coordinate_system_orientation=rocket.coordinate_system_orientation.value.lower(),
4747
)
48+
rocketpy_rocket.add_motor(
49+
MotorService.from_motor_model(rocket.motor).motor,
50+
rocket.motor_position,
51+
)
4852

4953
# RailButtons
5054
if rocket.rail_buttons:
@@ -53,10 +57,6 @@ def from_rocket_model(cls, rocket: RocketView) -> Self:
5357
lower_button_position=rocket.rail_buttons.lower_button_position,
5458
angular_position=rocket.rail_buttons.angular_position,
5559
)
56-
rocketpy_rocket.add_motor(
57-
MotorService.from_motor_model(rocket.motor).motor,
58-
rocket.motor_position,
59-
)
6060

6161
# NoseCone
6262
if rocket.nose:

0 commit comments

Comments
 (0)