Skip to content

Commit

Permalink
addding case to dynamics constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
vweirens committed Jul 18, 2023
1 parent 1be9fac commit cde55e4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gncpy/dynamics/basic/clohessy_wiltshire_orbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self, **kwargs):
self.__model = cpp_bindings.ClohessyWiltshire(0.1, 0.01)
if self.mean_motion is not None:
self.__model.mean_motion = self.mean_motion
if kwargs["control_model"] is not None:
if "control_model" in kwargs and kwargs["control_model"] is not None:
self.__model.setControlModel(kwargs("control_model"))

@property
Expand Down
2 changes: 1 addition & 1 deletion src/gncpy/dynamics/basic/clohessy_wiltshire_orbit2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self, mean_motion=None, **kwargs):
self.__model = cpp_bindings.ClohessyWiltshire2D(0.01, mean_motion)
if self.mean_motion is not None:
self.__model.mean_motion = self.mean_motion
if kwargs["control_model"] is not None:
if "control_model" in kwargs and kwargs["control_model"] is not None:
self.__model.setControlModel(kwargs("control_model"))

@property
Expand Down
2 changes: 1 addition & 1 deletion src/gncpy/dynamics/basic/double_integrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self, **kwargs):
self.__controlParams = cpp_control.ControlParams()
self.__stateTransParams = cpp_bindings.StateTransParams()
self.__model = cpp_bindings.DoubleIntegrator(0.1)
if kwargs["control_model"] is not None:
if "control_model" in kwargs and kwargs["control_model"] is not None:
self.__model.setControlModel(kwargs("control_model"))

@property
Expand Down

0 comments on commit cde55e4

Please sign in to comment.