card: vcruise all in one place (#34387)

* no reason to not be here

* oh this was off by a frame!

* ref
pull/34389/head
Shane Smiskol 3 months ago committed by GitHub
parent a1d81e63e1
commit 3d38b139bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      selfdrive/car/card.py
  2. 2
      selfdrive/test/process_replay/ref_commit

@ -180,8 +180,11 @@ class Car:
if can_rcv_valid and REPLAY: if can_rcv_valid and REPLAY:
self.can_log_mono_time = messaging.log_from_bytes(can_strs[0]).logMonoTime 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) 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.vCruise = float(self.v_cruise_helper.v_cruise_kph)
CS.vCruiseCluster = float(self.v_cruise_helper.v_cruise_cluster_kph) CS.vCruiseCluster = float(self.v_cruise_helper.v_cruise_cluster_kph)
@ -238,9 +241,6 @@ class Car:
def step(self): def step(self):
CS, RD = self.state_update() 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) self.state_publish(CS, RD)
initialized = (not any(e.name == EventName.selfdriveInitializing for e in self.sm['onroadEvents']) and initialized = (not any(e.name == EventName.selfdriveInitializing for e in self.sm['onroadEvents']) and

@ -1 +1 @@
f74fe264ab57d6698a4eb550a5769c46f3d03021 9758f1868c1c07d5a8d294f19bf6bf7b8b1beeda
Loading…
Cancel
Save