Merge remote-tracking branch 'dev/min-feat/no-gas-gating' into full

This commit is contained in:
Rick Lan
2025-05-27 12:35:23 +08:00
5 changed files with 11 additions and 1 deletions

View File

@@ -137,4 +137,5 @@ inline static std::unordered_map<std::string, uint32_t> keys = {
{"dp_lon_acm_downhill", PERSISTENT},
{"dp_lon_aem", PERSISTENT},
{"dp_device_audible_alert_mode", PERSISTENT},
{"dp_lon_no_gas_gating", PERSISTENT},
};

View File

@@ -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)

View File

@@ -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']:

View File

@@ -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;

View File

@@ -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"):