Skip to content

Commit fb99766

Browse files
authored
Toyota: don't send ACC_HUD on Prius V (#25539)
* Prius v also doesn't send ACC_HUD * common
1 parent 8245ba4 commit fb99766

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

selfdrive/car/toyota/carcontroller.py

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -109,28 +109,29 @@ def update(self, CC, CS):
109109
can_sends.append(create_gas_interceptor_command(self.packer, interceptor_gas_cmd, self.frame // 2))
110110
self.gas = interceptor_gas_cmd
111111

112-
# ui mesg is at 1Hz but we send asap if:
113-
# - there is something to display
114-
# - there is something to stop displaying
115-
fcw_alert = hud_control.visualAlert == VisualAlert.fcw
116-
steer_alert = hud_control.visualAlert in (VisualAlert.steerRequired, VisualAlert.ldw)
117-
118-
send_ui = False
119-
if ((fcw_alert or steer_alert) and not self.alert_active) or \
120-
(not (fcw_alert or steer_alert) and self.alert_active):
121-
send_ui = True
122-
self.alert_active = not self.alert_active
123-
elif pcm_cancel_cmd:
124-
# forcing the pcm to disengage causes a bad fault sound so play a good sound instead
125-
send_ui = True
126-
127-
if (self.frame % 100 == 0 or send_ui) and (self.CP.carFingerprint != CAR.PRIUS_V):
128-
can_sends.append(create_ui_command(self.packer, steer_alert, pcm_cancel_cmd, hud_control.leftLaneVisible,
129-
hud_control.rightLaneVisible, hud_control.leftLaneDepart,
130-
hud_control.rightLaneDepart, CC.enabled))
131-
132-
if (self.frame % 100 == 0 or send_ui) and self.CP.enableDsu:
133-
can_sends.append(create_fcw_command(self.packer, fcw_alert))
112+
if self.CP.carFingerprint != CAR.PRIUS_V:
113+
# ui mesg is at 1Hz but we send asap if:
114+
# - there is something to display
115+
# - there is something to stop displaying
116+
fcw_alert = hud_control.visualAlert == VisualAlert.fcw
117+
steer_alert = hud_control.visualAlert in (VisualAlert.steerRequired, VisualAlert.ldw)
118+
119+
send_ui = False
120+
if ((fcw_alert or steer_alert) and not self.alert_active) or \
121+
(not (fcw_alert or steer_alert) and self.alert_active):
122+
send_ui = True
123+
self.alert_active = not self.alert_active
124+
elif pcm_cancel_cmd:
125+
# forcing the pcm to disengage causes a bad fault sound so play a good sound instead
126+
send_ui = True
127+
128+
if self.frame % 100 == 0 or send_ui:
129+
can_sends.append(create_ui_command(self.packer, steer_alert, pcm_cancel_cmd, hud_control.leftLaneVisible,
130+
hud_control.rightLaneVisible, hud_control.leftLaneDepart,
131+
hud_control.rightLaneDepart, CC.enabled))
132+
133+
if (self.frame % 100 == 0 or send_ui) and self.CP.enableDsu:
134+
can_sends.append(create_fcw_command(self.packer, fcw_alert))
134135

135136
# *** static msgs ***
136137
for addr, cars, bus, fr_step, vl in STATIC_DSU_MSGS:

0 commit comments

Comments
 (0)