|
|
@ -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 |
|
|
|