Kia Sorento: fix dash speed matching (#26582)

* exception for Sorento

* comment
pull/26715/head
Shane Smiskol 2 years ago committed by GitHub
parent ddae8ffc09
commit 2d5e2d992a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      selfdrive/car/hyundai/carstate.py

@ -72,8 +72,10 @@ class CarState(CarStateBase):
self.cluster_speed = cp.vl["CLU15"]["CF_Clu_VehicleSpeed"]
self.cluster_speed_counter = 0
# mimic how dash converts to imperial
if not self.is_metric:
# Mimic how dash converts to imperial.
# Sorento is the only platform where CF_Clu_VehicleSpeed is already imperial when not is_metric
# TODO: CGW_USM1->CF_Gway_DrLockSoundRValue may describe this
if not self.is_metric and self.CP.carFingerprint not in (CAR.KIA_SORENTO,):
self.cluster_speed = math.floor(self.cluster_speed * CV.KPH_TO_MPH + CV.KPH_TO_MPH)
ret.vEgoCluster = self.cluster_speed * speed_conv

Loading…
Cancel
Save