From 3d38b139bca0b286038c3bb275ecf278fbb57337 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 14 Jan 2025 19:37:44 -0800 Subject: [PATCH] card: vcruise all in one place (#34387) * no reason to not be here * oh this was off by a frame! * ref --- selfdrive/car/card.py | 8 ++++---- selfdrive/test/process_replay/ref_commit | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/selfdrive/car/card.py b/selfdrive/car/card.py index 92d9b7eb11..0b0631bc2b 100755 --- a/selfdrive/car/card.py +++ b/selfdrive/car/card.py @@ -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 diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index 9c19395fed..59b36850a5 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -f74fe264ab57d6698a4eb550a5769c46f3d03021 \ No newline at end of file +9758f1868c1c07d5a8d294f19bf6bf7b8b1beeda \ No newline at end of file