Match higher speed limits on Redneck Cruise SET

This commit is contained in:
firestar5683
2026-11-27 14:47:42 -06:00
parent 6938b22db9
commit d0904dfaaf
4 changed files with 8 additions and 6 deletions
@@ -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):
@@ -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
@@ -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"))
+1 -1
View File
@@ -1 +1 @@
{"protected_inventory_sha256": "030a52bd042b97c423aabaf3ff31fa093b5bf373ced061ba03fdc0e851e5d3c7", "schema_version": 1}
{"protected_inventory_sha256": "f287022c4575f326bd42749c0a99102a8afe0d21995d9d52f6b48049d72d0ee9", "schema_version": 1}