Restore the default Carnival torque controller

This commit is contained in:
firestar5683
2026-11-05 08:51:12 -06:00
parent d96d023746
commit 8d9bc972d3
4 changed files with 6 additions and 4 deletions
@@ -175,7 +175,8 @@ def default_selection(CP) -> ControllerSelection:
policy = policy_for(CP)
from openpilot.starpilot.lateral.hkg_vehicle_policy import PROFILES
forte_non_scc = policy == 'kia_forte' and str(CP.carFingerprint) in ('KIA_FORTE_2019_NON_SCC', 'KIA_FORTE_2021_NON_SCC')
mode = ControllerMode.STARPILOT if policy and policy != 'generic' and (policy not in PROFILES or forte_non_scc) else ControllerMode.STANDARD
dom_default = forte_non_scc or policy == 'kia_carnival'
mode = ControllerMode.STARPILOT if policy and policy != 'generic' and (policy not in PROFILES or dom_default) else ControllerMode.STANDARD
return ControllerSelection(mode, policy, 'default')
@@ -26,7 +26,7 @@ from openpilot.starpilot.lateral import hkg_vehicle_shaping as shaping
def test_actual_controller_context_defaults_live_tune_limits_and_off(monkeypatch, vehicle, helper, speed, curvature, direction, pressed):
cp = interfaces[vehicle].get_non_essential_params(vehicle)
ci = interfaces[vehicle](cp)
assert default_selection(cp).mode == ControllerMode.STANDARD
assert default_selection(cp).mode == (ControllerMode.STARPILOT if vehicle == CAR.KIA_CARNIVAL_HEV_4TH_GEN else ControllerMode.STANDARD)
native = LatControlTorque(cp.as_reader(), ci, 0.01, controller_mode=ControllerMode.STANDARD)
assert native.starpilot_extension is None
actual = LatControlTorque(cp.as_reader(), ci, 0.01, controller_mode=ControllerMode.STARPILOT)
@@ -14,7 +14,8 @@ CASES = [(vehicle, profile, factor) for profile, (vehicles, factor) in PROFILES.
def test_exact_profile_defaults_and_saved_controller_selection(vehicle, profile, factor):
cp = interfaces[vehicle].get_non_essential_params(vehicle)
assert policy_for(cp) == profile
expected = (ControllerMode.STARPILOT if vehicle in (CAR.KIA_FORTE_2019_NON_SCC, CAR.KIA_FORTE_2021_NON_SCC)
expected = (ControllerMode.STARPILOT if vehicle in (CAR.KIA_FORTE_2019_NON_SCC, CAR.KIA_FORTE_2021_NON_SCC,
CAR.KIA_CARNIVAL_2025, CAR.KIA_CARNIVAL_HEV_4TH_GEN)
else ControllerMode.STANDARD)
assert default_selection(cp).mode == expected
for raw in (b'{', b'{"version":true,"vehicles":{}}', b'{"version":1,"vehicles":{},"vehicles":{}}', b'x' * 4097):
+1 -1
View File
@@ -1 +1 @@
{"protected_inventory_sha256": "fcd05ae38a6a2a27e0d5e38347a880f1eb9cee25539646aede1c9cdeeabd1bdb", "schema_version": 1}
{"protected_inventory_sha256": "2b8f1d352687ec27b020fd227cedcce3210daa40133ac6c6f42ee6b7e04b502b", "schema_version": 1}