From 9b1f36c9db68b3b454672f57b20c29500b85c7d7 Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Wed, 5 Nov 2025 23:32:36 -0600 Subject: [PATCH] Pedal Toggle --- common/params.cc | 1 + frogpilot/common/frogpilot_variables.py | 3 +++ frogpilot/ui/qt/offroad/vehicle_settings.cc | 5 +++++ frogpilot/ui/qt/offroad/vehicle_settings.h | 2 +- selfdrive/car/gm/interface.py | 2 +- 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/common/params.cc b/common/params.cc index 7ef44cbf5..1d45baff9 100644 --- a/common/params.cc +++ b/common/params.cc @@ -346,6 +346,7 @@ std::unordered_map keys = { {"FrogsGoMoosTweak", PERSISTENT}, {"FullMap", PERSISTENT}, {"GasRegenCmd", PERSISTENT}, + {"GMPedalLongitudinal", PERSISTENT}, {"GoatScream", PERSISTENT}, {"GreenLightAlert", PERSISTENT}, {"HideAlerts", PERSISTENT}, diff --git a/frogpilot/common/frogpilot_variables.py b/frogpilot/common/frogpilot_variables.py index 25005724f..c73ff5d47 100644 --- a/frogpilot/common/frogpilot_variables.py +++ b/frogpilot/common/frogpilot_variables.py @@ -229,6 +229,7 @@ frogpilot_default_params: list[tuple[str, str | bytes, int, str]] = [ ("FrogsGoMoosTweak", "1", 2, "0"), ("FullMap", "0", 2, "0"), ("GasRegenCmd", "1", 2, "0"), + ("GMPedalLongitudinal", "1", 2, "1"), ("GithubSshKeys", "", 0, ""), ("GithubUsername", "", 0, ""), ("GoatScream", "0", 1, "0"), @@ -974,5 +975,7 @@ class FrogPilotVariables: toggle.volt_sng = toggle.car_model == "CHEVROLET_VOLT" and (params.get_bool("VoltSNG") if tuning_level >= level["VoltSNG"] else default.get_bool("VoltSNG")) + toggle.gm_pedal_longitudinal = params.get_bool("GMPedalLongitudinal") if tuning_level >= level["GMPedalLongitudinal"] else default.get_bool("GMPedalLongitudinal") + params_memory.put("FrogPilotToggles", json.dumps(toggle.__dict__)) params_memory.remove("FrogPilotTogglesUpdated") diff --git a/frogpilot/ui/qt/offroad/vehicle_settings.cc b/frogpilot/ui/qt/offroad/vehicle_settings.cc index 39821fd99..9ecfa3a75 100644 --- a/frogpilot/ui/qt/offroad/vehicle_settings.cc +++ b/frogpilot/ui/qt/offroad/vehicle_settings.cc @@ -168,6 +168,7 @@ FrogPilotVehiclesPanel::FrogPilotVehiclesPanel(FrogPilotSettingsWindow *parent) std::vector> vehicleToggles { {"GMToggles", tr("General Motors Settings"), tr("FrogPilot features for General Motors vehicles."), ""}, {"ExperimentalGMTune", tr("FrogsGoMoo's Experimental Tune"), tr("Experimental GM tune by FrogsGoMoo that attempts to smoothen stopping and takeoff control. Use at your own risk!"), ""}, + {"GMPedalLongitudinal", tr("Use Pedal for Longitudinal Control"), tr("Use the pedal interceptor for longitudinal control instead of camera ACC/Redneck when available."), ""}, {"LongPitch", tr("Smooth Pedal Response on Hills"), tr("Smoothen acceleration and braking when driving downhill/uphill."), ""}, {"VoltSNG", tr("Stop-and-Go Hack"), tr("Force stop-and-go on the 2017 Chevy Volt."), ""}, @@ -403,6 +404,10 @@ void FrogPilotVehiclesPanel::updateToggles() { setVisible &= isHKGCanFd; } + else if (key == "GMPedalLongitudinal") { + setVisible &= hasPedal; + } + else if (key == "VoltSNG") { setVisible &= isVolt && !hasSNG; } diff --git a/frogpilot/ui/qt/offroad/vehicle_settings.h b/frogpilot/ui/qt/offroad/vehicle_settings.h index 403e545a2..dd94a4f70 100644 --- a/frogpilot/ui/qt/offroad/vehicle_settings.h +++ b/frogpilot/ui/qt/offroad/vehicle_settings.h @@ -36,7 +36,7 @@ private: std::map toggles; - QSet gmKeys = {"ExperimentalGMTune", "LongPitch", "VoltSNG"}; + QSet gmKeys = {"ExperimentalGMTune", "GMPedalLongitudinal", "LongPitch", "VoltSNG"}; QSet hkgKeys = {"NewLongAPI", "TacoTuneHacks"}; QSet longitudinalKeys = {"ExperimentalGMTune", "FrogsGoMoosTweak", "LongPitch", "NewLongAPI", "SNGHack", "VoltSNG"}; QSet toyotaKeys = {"ClusterOffset", "FrogsGoMoosTweak", "LockDoorsTimer", "SNGHack", "ToyotaDoors"}; diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index 046cc7bd5..f2675fe1c 100644 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -263,7 +263,7 @@ class CarInterface(CarInterfaceBase): elif candidate == CAR.CHEVROLET_TRAX: CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) - if ret.enableGasInterceptor: + if ret.enableGasInterceptor and frogpilot_toggles.gm_pedal_longitudinal: ret.networkLocation = NetworkLocation.fwdCamera ret.safetyConfigs[0].safetyParam |= Panda.FLAG_GM_HW_CAM ret.minEnableSpeed = -1