diff --git a/common/params.cc b/common/params.cc index dc9b55693..5de5c978b 100644 --- a/common/params.cc +++ b/common/params.cc @@ -258,6 +258,7 @@ std::unordered_map keys = { {"ExperimentalModeViaLKAS", PERSISTENT}, {"ExperimentalModeViaScreen", PERSISTENT}, {"FireTheBabysitter", PERSISTENT}, + {"ForceAutoTune", PERSISTENT}, {"FrogPilotTogglesUpdated", PERSISTENT}, {"GoatScream", PERSISTENT}, {"LaneLinesWidth", PERSISTENT}, diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index e9dd7a1fa..e483c2db7 100644 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -677,7 +677,7 @@ class Controls: # Update Torque Params if self.CP.lateralTuning.which() == 'torque': torque_params = self.sm['liveTorqueParameters'] - if self.sm.all_checks(['liveTorqueParameters']) and torque_params.useParams: + if self.sm.all_checks(['liveTorqueParameters']) and (torque_params.useParams or self.force_auto_tune): self.LaC.update_live_torque_params(torque_params.latAccelFactorFiltered, torque_params.latAccelOffsetFiltered, torque_params.frictionCoefficientFiltered) @@ -1027,6 +1027,7 @@ class Controls: self.frogpilot_variables.experimental_mode_via_lkas = experimental_mode_activation and self.params.get_bool("ExperimentalModeViaLKAS") lateral_tune = self.params.get_bool("LateralTune") + self.force_auto_tune = lateral_tune and self.params.get_float("ForceAutoTune") longitudinal_tune = self.params.get_bool("LongitudinalTune") self.frogpilot_variables.sport_plus = longitudinal_tune and self.params.get_int("AccelerationProfile") == 3 diff --git a/selfdrive/frogpilot/ui/control_settings.cc b/selfdrive/frogpilot/ui/control_settings.cc index 264aca769..eae3ff68e 100644 --- a/selfdrive/frogpilot/ui/control_settings.cc +++ b/selfdrive/frogpilot/ui/control_settings.cc @@ -21,6 +21,7 @@ FrogPilotControlsPanel::FrogPilotControlsPanel(SettingsWindow *parent) : FrogPil {"NoUploads", "Disable Uploads", "Turn off all data uploads to comma's servers.\n\nWARNING: This action will prevent your drives from appearing on comma connect which may impact debugging and support!", ""}, {"LateralTune", "Lateral Tuning", "Modify openpilot's steering behavior.", "../frogpilot/assets/toggle_icons/icon_lateral_tune.png"}, + {"ForceAutoTune", "Force Auto Tune", "Forces comma's auto lateral tuning for unsupported vehicles.", ""}, {"LongitudinalTune", "Longitudinal Tuning", "Modify openpilot's acceleration and braking behavior.", "../frogpilot/assets/toggle_icons/icon_longitudinal_tune.png"}, {"AccelerationProfile", "Acceleration Profile", "Change the acceleration rate to be either sporty or eco-friendly.", ""}, diff --git a/selfdrive/frogpilot/ui/control_settings.h b/selfdrive/frogpilot/ui/control_settings.h index 575d0b5b7..b502171a4 100644 --- a/selfdrive/frogpilot/ui/control_settings.h +++ b/selfdrive/frogpilot/ui/control_settings.h @@ -38,7 +38,7 @@ private: std::set conditionalExperimentalKeys = {"CECurves", "CECurvesLead", "CESlowerLead", "CENavigation", "CEStopLights", "CESignal"}; std::set fireTheBabysitterKeys = {"NoLogging", "MuteOverheated", "NoUploads"}; std::set laneChangeKeys = {}; - std::set lateralTuneKeys = {}; + std::set lateralTuneKeys = {"ForceAutoTune"}; std::set longitudinalTuneKeys = {"AccelerationProfile", "DecelerationProfile", "AggressiveAcceleration"}; std::set mtscKeys = {}; std::set qolKeys = {"DisableOnroadUploads"};