diff --git a/sunnypilot/selfdrive/controls/dec/dynamic_experimental_controller.py b/sunnypilot/selfdrive/controls/dec/dynamic_experimental_controller.py index 3eaf6096f6..5135a405fa 100644 --- a/sunnypilot/selfdrive/controls/dec/dynamic_experimental_controller.py +++ b/sunnypilot/selfdrive/controls/dec/dynamic_experimental_controller.py @@ -183,7 +183,7 @@ class DynamicExperimentalController: return LEAD_PROB + 0.1 # Increase the threshold on highways return LEAD_PROB - def _update(self, car_state, lead_one, md, controls_state): #, maneuver_distance): + def _update(self, car_state, lead_one, md, controls_state): #, maneuver_distance): self._v_ego_kph = car_state.vEgo * 3.6 self._v_cruise_kph = controls_state.vCruise self._has_lead = lead_one.status @@ -344,7 +344,7 @@ class DynamicExperimentalController: def update(self, radar_unavailable, car_state, lead_one, md, controls_state): #, maneuver_distance): if self._frame % 50 == 0: self._is_enabled = self._params.get_bool("DynamicExperimentalControl") - + if self._is_enabled: self._update(car_state, lead_one, md, controls_state) #, maneuver_distance) if radar_unavailable: diff --git a/sunnypilot/selfdrive/controls/dec/helpers.py b/sunnypilot/selfdrive/controls/dec/helpers.py index c35d55e5b0..22c48b6218 100644 --- a/sunnypilot/selfdrive/controls/dec/helpers.py +++ b/sunnypilot/selfdrive/controls/dec/helpers.py @@ -3,11 +3,11 @@ MpcSource = custom.MpcSource def get_mpc_mode(sm, dynamic_experimental_controller, mpc, CP): """ - Determines the appropriate MPC mode based on the experimental state and system - configurations. It either returns a default mode or updates the dynamic + Determines the appropriate MPC mode based on the experimental state and system + configurations. It either returns a default mode or updates the dynamic experimental controller and retrieves the updated mode. - :param is_experimental: A flag indicating whether to use the experimental mode. + :param is_experimental: A flag indicating whether to use the experimental mode. If False, defaults to 'acc' mode. :type is_experimental: bool