diff --git a/common/params_keys.h b/common/params_keys.h index 4206fa3a6..3bb55530b 100644 --- a/common/params_keys.h +++ b/common/params_keys.h @@ -137,4 +137,5 @@ inline static std::unordered_map keys = { {"dp_lon_acm_downhill", PERSISTENT}, {"dp_lon_aem", PERSISTENT}, {"dp_device_audible_alert_mode", PERSISTENT}, + {"dp_lon_no_gas_gating", PERSISTENT}, }; diff --git a/selfdrive/controls/lib/longitudinal_planner.py b/selfdrive/controls/lib/longitudinal_planner.py index 3c71d6532..a50bae1b2 100755 --- a/selfdrive/controls/lib/longitudinal_planner.py +++ b/selfdrive/controls/lib/longitudinal_planner.py @@ -32,6 +32,7 @@ class DPFlags: ACM = 1 ACM_DOWNHILL = 2 AEM = 2 ** 2 + NO_GAS_GATING = 2 ** 3 pass def get_max_accel(v_ego): @@ -209,7 +210,7 @@ class LongitudinalPlanner: # # Don't clip at low speeds since throttle_prob doesn't account for creep # self.allow_throttle = throttle_prob > ALLOW_THROTTLE_THRESHOLD or v_ego <= MIN_ALLOW_THROTTLE_SPEED - if not self.allow_throttle: + if not (dp_flags & DPFlags.NO_GAS_GATING) and not self.allow_throttle: clipped_accel_coast = max(accel_coast, accel_clip[0]) clipped_accel_coast_interp = np.interp(v_ego, [MIN_ALLOW_THROTTLE_SPEED, MIN_ALLOW_THROTTLE_SPEED*2], [accel_clip[1], clipped_accel_coast]) accel_clip[1] = min(accel_clip[1], clipped_accel_coast_interp) diff --git a/selfdrive/controls/plannerd.py b/selfdrive/controls/plannerd.py index bd5d065fa..ba110bad5 100755 --- a/selfdrive/controls/plannerd.py +++ b/selfdrive/controls/plannerd.py @@ -29,6 +29,8 @@ def main(): dp_flags |= DPFlags.ACM_DOWNHILL if params.get_bool("dp_lon_aem"): dp_flags |= DPFlags.AEM + if params.get_bool("dp_lon_no_gas_gating"): + dp_flags |= DPFlags.NO_GAS_GATING while True: sm.update() if sm.updated['modelV2']: diff --git a/selfdrive/ui/qt/offroad/dp_panel.cc b/selfdrive/ui/qt/offroad/dp_panel.cc index 91da772f1..42cc748ff 100644 --- a/selfdrive/ui/qt/offroad/dp_panel.cc +++ b/selfdrive/ui/qt/offroad/dp_panel.cc @@ -174,6 +174,11 @@ void DPPanel::add_longitudinal_toggles() { QString::fromUtf8("🚧 ") + tr("Adaptive Experimental Mode (AEM)"), tr("Adaptive mode switcher between ACC and Blended based on driving context."), }, + { + "dp_lon_no_gas_gating", + tr("Enable No Gas Gating (NoGG)"), + tr("Allows the car to accelerate in situations where Gas Gating would normally prevent it, like approaching traffic lights or exits."), + }, }; QWidget *label = nullptr; diff --git a/system/manager/manager.py b/system/manager/manager.py index c549c57ae..08b1abfad 100755 --- a/system/manager/manager.py +++ b/system/manager/manager.py @@ -59,6 +59,7 @@ def manager_init() -> None: ("dp_lon_acm_downhill", "0"), ("dp_lon_aem", "0"), ("dp_device_audible_alert_mode", "0"), + ("dp_lon_no_gas_gating", "0"), ] if params.get_bool("RecordFrontLock"):