diff --git a/selfdrive/car/honda/carcontroller.py b/selfdrive/car/honda/carcontroller.py index 122b69463c..aa41658599 100644 --- a/selfdrive/car/honda/carcontroller.py +++ b/selfdrive/car/honda/carcontroller.py @@ -130,23 +130,16 @@ class CarController: hud_control = CC.hudControl if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS: - stopping = actuators.longControlState == LongCtrlState.stopping - if CC.longActive and stopping: + if CC.longActive and (actuators.longControlState == LongCtrlState.stopping): if self.last_stopping_frame == 0: self.last_stopping_frame = self.frame if self.frame - self.last_stopping_frame > 400: hud_v_cruise = 252 else: - if CS.is_metric: - hud_v_cruise = hud_control.setSpeed * CV.MS_TO_KPH if hud_control.speedVisible else 255 - else: - hud_v_cruise = hud_control.setSpeed * CV.MS_TO_MPH if hud_control.speedVisible else 255 + hud_v_cruise = hud_control.setSpeed * (CV.MS_TO_KPH if CS.is_metric else CV.MS_TO_MPH) if hud_control.speedVisible else 255 else: self.last_stopping_frame = 0 - if CS.is_metric: - hud_v_cruise = hud_control.setSpeed * CV.MS_TO_KPH if hud_control.speedVisible else 255 - else: - hud_v_cruise = hud_control.setSpeed * CV.MS_TO_MPH if hud_control.speedVisible else 255 + hud_v_cruise = hud_control.setSpeed * (CV.MS_TO_KPH if CS.is_metric else CV.MS_TO_MPH) if hud_control.speedVisible else 255 else: hud_v_cruise = hud_control.setSpeed * CV.MS_TO_MPH if hud_control.speedVisible else 255 pcm_cancel_cmd = CC.cruiseControl.cancel