This commit is contained in:
nayan8teen
2025-06-07 13:14:30 -04:00
parent 1216ab5442
commit 39102d761d
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -217,7 +217,7 @@ class Car:
if can_rcv_valid and REPLAY:
self.can_log_mono_time = messaging.log_from_bytes(can_strs[0]).logMonoTime
self.v_cruise_helper.update_v_cruise(CS, self.sm['carControl'].enabled, self.is_metric, self.custom_acc)
self.v_cruise_helper.update_v_cruise_sp(CS, self.sm['carControl'].enabled, self.is_metric, self.custom_acc)
if self.sm['carControl'].enabled and not self.CC_prev.enabled:
# Use CarState w/ buttons from the step selfdrived enables on
self.v_cruise_helper.initialize_v_cruise(self.CS_prev, self.experimental_mode, self.dynamic_experimental_control)
@@ -20,7 +20,7 @@ class TestAdjustCustomAccIncrements:
def reset_cruise_speed_state(self):
# Two resets previous cruise speed
for _ in range(2):
self.v_cruise_helper.update_v_cruise(car.CarState(cruiseState={"available": False}), enabled=False, is_metric=False, custom_acc=(False, 1, 5))
self.v_cruise_helper.update_v_cruise_sp(car.CarState(cruiseState={"available": False}), enabled=False, is_metric=False, custom_acc=(False, 1, 5))
def enable(self, v_ego, experimental_mode, dynamic_experimental_control):
# Simulates user pressing set with a current speed
@@ -49,10 +49,10 @@ class TestAdjustCustomAccIncrements:
for i in range(51):
CS.buttonEvents = [ButtonEvent(type=btn, pressed=True)] if i == 0 else []
self.v_cruise_helper.update_v_cruise(CS, True, metric, sunnypilot_interfaces.custom_acc_controls(self.params))
self.v_cruise_helper.update_v_cruise_sp(CS, True, metric, sunnypilot_interfaces.custom_acc_controls(self.params))
CS.buttonEvents = [ButtonEvent(type=btn, pressed=False)]
self.v_cruise_helper.update_v_cruise(CS, True, metric, sunnypilot_interfaces.custom_acc_controls(self.params))
self.v_cruise_helper.update_v_cruise_sp(CS, True, metric, sunnypilot_interfaces.custom_acc_controls(self.params))
curr = self.v_cruise_helper.v_cruise_kph if metric else round(self.v_cruise_helper.v_cruise_kph / IMPERIAL_INCREMENT)
diff = curr - prev
@@ -80,9 +80,9 @@ class TestAdjustCustomAccIncrements:
# simulate short-press
CS.buttonEvents = [ButtonEvent(type=btn, pressed=True)]
self.v_cruise_helper.update_v_cruise(CS, True, metric, sunnypilot_interfaces.custom_acc_controls(self.params))
self.v_cruise_helper.update_v_cruise_sp(CS, True, metric, sunnypilot_interfaces.custom_acc_controls(self.params))
CS.buttonEvents = [ButtonEvent(type=btn, pressed=False)]
self.v_cruise_helper.update_v_cruise(CS, True, metric, sunnypilot_interfaces.custom_acc_controls(self.params))
self.v_cruise_helper.update_v_cruise_sp(CS, True, metric, sunnypilot_interfaces.custom_acc_controls(self.params))
curr = self.v_cruise_helper.v_cruise_kph if metric else round(self.v_cruise_helper.v_cruise_kph / IMPERIAL_INCREMENT)
diff = curr - prev
+1 -1
View File
@@ -22,7 +22,7 @@ class VCruiseHelperSP(VCruiseHelper):
self.short_increment = 1
self.long_increment = 5
def update_v_cruise(self, CS, enabled, is_metric, custom_acc: tuple[bool, int, int]) -> None:
def update_v_cruise_sp(self, CS, enabled, is_metric, custom_acc: tuple[bool, int, int]) -> None:
super().update_v_cruise(CS, enabled, is_metric)
self.custom_acc_enabled = custom_acc[0]
self.short_increment = custom_acc[1]