From d0904dfaaf61fb8de3c2d1883c6f22a06c087433 Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Fri, 27 Nov 2026 14:47:42 -0600 Subject: [PATCH] Match higher speed limits on Redneck Cruise SET --- openpilot/starpilot/car/hyundai/redneck_cruise.py | 2 +- openpilot/starpilot/speed_limits/tests/test_engagement.py | 8 +++++--- openpilot/starpilot/ui/feature_settings_owner.py | 2 +- prebuilt.json | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/openpilot/starpilot/car/hyundai/redneck_cruise.py b/openpilot/starpilot/car/hyundai/redneck_cruise.py index 1bf537de4f..4227212b41 100644 --- a/openpilot/starpilot/car/hyundai/redneck_cruise.py +++ b/openpilot/starpilot/car/hyundai/redneck_cruise.py @@ -317,7 +317,7 @@ class RedneckCruise: if state is not None: target = slc_target_kph(state.presentationAdjustedLimit, card.is_metric) minimum = get_minimum_set_speed(card.is_metric) * (1. if card.is_metric else CV.MPH_TO_KPH) - if minimum <= target < helper.v_cruise_kph: + if minimum <= target and target != helper.v_cruise_kph: helper.apply_slc_target(state.presentationAdjustedLimit, card.is_metric) def update(self, card, cs, cc, now_ns): diff --git a/openpilot/starpilot/speed_limits/tests/test_engagement.py b/openpilot/starpilot/speed_limits/tests/test_engagement.py index f01fada204..e877c46d0a 100644 --- a/openpilot/starpilot/speed_limits/tests/test_engagement.py +++ b/openpilot/starpilot/speed_limits/tests/test_engagement.py @@ -87,15 +87,17 @@ def engage(instance, *, now=START + 10_000_000): ('decelCruise', True, 50., 80_000_000, False, 50.), ('decelCruise', False, 50., 80_000_000, False, 60.), ('accelCruise', True, 50., 80_000_000, False, 60.), - ('decelCruise', True, 70., 80_000_000, False, 60.), + ('accelCruise', True, 70., 80_000_000, False, 60.), + ('decelCruise', False, 70., 80_000_000, False, 60.), + ('decelCruise', True, 70., 80_000_000, False, 70.), ('decelCruise', True, 20., 80_000_000, False, 60.), ('decelCruise', True, 50., 550_000_000, False, 60.), ('decelCruise', True, 50., 100_000_000, True, 50.), ('decelCruise', True, 50., 550_000_000, True, 60.), ('accelCruise', True, 50., 100_000_000, True, 60.), - ('decelCruise', True, 70., 100_000_000, True, 60.), + ('decelCruise', True, 70., 100_000_000, True, 70.), ]) -def test_redneck_set_matching_preserves_the_stock_ceiling_and_resume(gesture, match, limit, delay, gas_at_set, expected): +def test_redneck_set_matching_initializes_software_set_and_preserves_resume(gesture, match, limit, delay, gas_at_set, expected): from opendbc.car.hyundai.interface import CarInterface from opendbc.car.hyundai.software_cruise import prepare from opendbc.car.hyundai.values import CAR diff --git a/openpilot/starpilot/ui/feature_settings_owner.py b/openpilot/starpilot/ui/feature_settings_owner.py index 9362058f55..0212a45fe8 100644 --- a/openpilot/starpilot/ui/feature_settings_owner.py +++ b/openpilot/starpilot/ui/feature_settings_owner.py @@ -1183,7 +1183,7 @@ class FeatureSettingsOwner: rows.append(replace(control_row, reason=control_reason) if control_row.choices else control_row) if cp is not None and (not cp.pcmCruise or button_cruise): rows.append(self._bool_row("SLCOnEngage", "Match Speed Limit on Engage", allowed and control == "1", - reason="Lower your new SET to the speed limit plus offset when using Redneck Cruise" + reason="Start SET at the speed limit plus offset on a new Redneck Cruise SET" if button_cruise else "Start SET at the SLC limit plus offset. RES restores your previous SET")) rows.append(self._bool_row("ShowSpeedLimits", "Show speed limit signs", self.authority("preferences"), reason="Display signs independently of Speed Limit Controller; does not change cruise speed")) diff --git a/prebuilt.json b/prebuilt.json index 424824075c..543730716a 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "030a52bd042b97c423aabaf3ff31fa093b5bf373ced061ba03fdc0e851e5d3c7", "schema_version": 1} +{"protected_inventory_sha256": "f287022c4575f326bd42749c0a99102a8afe0d21995d9d52f6b48049d72d0ee9", "schema_version": 1}