Experimental Mode via steering wheel / onroad UI
Added toggle to enable or disable Experimental Mode from the steering wheel for Toyota/Lexus vehicles and the onroad UI for other makes.
This commit is contained in:
@@ -63,15 +63,22 @@ class ConditionalExperimentalMode:
|
||||
self.slowing_down_gmac = GenericMovingAverageCalculator()
|
||||
|
||||
def update(self, carState, frogpilotNavigation, modelData, mpc, radarState, standstill, v_ego):
|
||||
# Set the value of "overridden"
|
||||
if self.experimental_mode_via_press:
|
||||
overridden = self.params_memory.get_int("CEStatus")
|
||||
else:
|
||||
overridden = 0
|
||||
|
||||
# Update Experimental Mode based on the current driving conditions
|
||||
condition_met = self.check_conditions(carState, frogpilotNavigation, modelData, standstill, v_ego)
|
||||
if (not self.experimental_mode and condition_met):
|
||||
if (not self.experimental_mode and condition_met and overridden not in (1, 3)) or overridden in (2, 4):
|
||||
self.experimental_mode = True
|
||||
elif (self.experimental_mode and not condition_met):
|
||||
elif (self.experimental_mode and not condition_met and overridden not in (2, 4)) or overridden in (1, 3):
|
||||
self.experimental_mode = False
|
||||
self.status_value = 0
|
||||
|
||||
# Update the onroad status bar
|
||||
self.status_value = overridden if overridden in (1, 2, 3, 4) else self.status_value
|
||||
if self.status_value != self.previous_status_value:
|
||||
self.previous_status_value = self.status_value
|
||||
self.params_memory.put_int("CEStatus", self.status_value)
|
||||
@@ -188,6 +195,7 @@ class ConditionalExperimentalMode:
|
||||
def update_frogpilot_params(self, is_metric, params):
|
||||
self.curves = params.get_bool("CECurves")
|
||||
self.curves_lead = params.get_bool("CECurvesLead")
|
||||
self.experimental_mode_via_press = params.get_bool("ExperimentalModeViaPress")
|
||||
self.limit = params.get_int("CESpeed") * (CV.KPH_TO_MS if is_metric else CV.MPH_TO_MS)
|
||||
self.limit_lead = params.get_int("CESpeedLead") * (CV.KPH_TO_MS if is_metric else CV.MPH_TO_MS)
|
||||
self.navigation = params.get_bool("CENavigation")
|
||||
|
||||
@@ -14,6 +14,7 @@ FrogPilotControlsPanel::FrogPilotControlsPanel(SettingsWindow *parent) : FrogPil
|
||||
|
||||
{"CustomPersonalities", "Custom Driving Personalities", "Customize the driving personality profiles to your driving style.", "../frogpilot/assets/toggle_icons/icon_custom.png"},
|
||||
{"DeviceShutdown", "Device Shutdown Timer", "Configure the timer for automatic device shutdown when offroad conserving energy and preventing battery drain.", "../frogpilot/assets/toggle_icons/icon_time.png"},
|
||||
{"ExperimentalModeViaPress", "Experimental Mode Via 'LKAS' Button / Screen", "Toggle Experimental Mode by double-clicking the 'Lane Departure'/'LKAS' button or double tapping screen.\n\nOverrides 'Conditional Experimental Mode'.", "../assets/img_experimental_white.svg"},
|
||||
|
||||
{"LateralTune", "Lateral Tuning", "Modify openpilot's steering behavior.", "../frogpilot/assets/toggle_icons/icon_lateral_tune.png"},
|
||||
{"AverageCurvature", "Average Desired Curvature", "Use Pfeiferj's distance-based curvature adjustment for improved curve handling.", ""},
|
||||
|
||||
Reference in New Issue
Block a user