mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-23 18:42:06 +08:00
Formatting
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user