card: vcruise all in one place (#34387)

* no reason to not be here

* oh this was off by a frame!

* ref
This commit is contained in:
Shane Smiskol
2025-01-14 19:37:44 -08:00
committed by GitHub
parent a1d81e63e1
commit 3d38b139bc
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -180,8 +180,11 @@ class Car:
if can_rcv_valid and REPLAY:
self.can_log_mono_time = messaging.log_from_bytes(can_strs[0]).logMonoTime
# TODO: mirror the carState.cruiseState struct?
self.v_cruise_helper.update_v_cruise(CS, self.sm['carControl'].enabled, self.is_metric)
if self.sm['carControl'].enabled and not self.CC_prev.enabled:
self.v_cruise_helper.initialize_v_cruise(CS, self.experimental_mode)
# TODO: mirror the carState.cruiseState struct?
CS.vCruise = float(self.v_cruise_helper.v_cruise_kph)
CS.vCruiseCluster = float(self.v_cruise_helper.v_cruise_cluster_kph)
@@ -238,9 +241,6 @@ class Car:
def step(self):
CS, RD = self.state_update()
if self.sm['carControl'].enabled and not self.CC_prev.enabled:
self.v_cruise_helper.initialize_v_cruise(CS, self.experimental_mode)
self.state_publish(CS, RD)
initialized = (not any(e.name == EventName.selfdriveInitializing for e in self.sm['onroadEvents']) and
+1 -1
View File
@@ -1 +1 @@
f74fe264ab57d6698a4eb550a5769c46f3d03021
9758f1868c1c07d5a8d294f19bf6bf7b8b1beeda