Toyota: forward openpilot fcw to cluster when engaged
Forward fcw alert to the vehicle's dash (makes the vehicle display the blinking yellow fcw icon) if openpilot fcw is triggered while cruise control is engaged and openpilot is controlling longitudinal on a Toyota/Lexus vehicle.
Note:
This alert only gets displayed by the dash if ACC is engaged, this alert was originally used for alerting the user that the car might not have enough braking distance while the stock ACC is engaged.

Extensively tested in my own fork, this alert is merely a UI message and does not have priority over the stock system's fcw/aeb in the cluster's logic, so it won't mask any of those signals when it's triggered and it should be safe to use.
Image of the alert: https://github.com/commaai/opendbc/pull/457#issuecomment-951369032
How does this compare/impact the current FCW alert we send? Is the only purpose is so we can show on Prius V?
How does this compare/impact the current FCW alert we send? Is the only purpose is so we can show on Prius V?
It does not affect the current fcw warning. This new signal is only sent when enableDsu if false, and the current FCW signal is only sent when enableDsu is true. Without this change, openpilot does not send any fcw alert to the car if the DSU is not unplugged; with this change applied, it sends the cut-in fcw signal (this signal is on 0x343 ACC_CONTROL which we are already sending anyway so there won't be any controls conflict) when DSU is still plugged in and openpilot is controlling long (TSS 2.0 or smartDsu).
fcw_alert_acc = (hud_control.visualAlert == VisualAlert.fcw) and not self.CP.enableDsu
We can use this to display openpilot fcw on the Prius V, however the vehicle doesn't respond to this signal if ACC is not engaged. Thus the title "... when engaged"
I think we should block and forward the ACC_HUD message so we can send the correct FCW message
I think we should block and forward the ACC_HUD message so we can send the correct FCW message
That'll unfortunately only work on TSS2.0 camera ACC cars I think. On TSS-P cars I believe this message is sent by the DSU.
Where we can do it, I think we should. Either SDSU or TSS2 + not radar ACC (does SDSU block ACC_HUD though?). I'd merge that before this, since the alert is still a bit ambiguous here. Is there anything else in ACC_CONTROL that might show a different alert?
Where we can do it, I think we should. Either SDSU or TSS2 + not radar ACC (does SDSU block ACC_HUD though?). I'd merge that before this, since the alert is still a bit ambiguous here. Is there anything else in ACC_CONTROL that might show a different alert?
Not that I am aware of, and SDSU only blocks 0x343 (ACC_CONTROL), so this will be limited to camera ACC cars.
I tested the alert yesterday and I do like it (beeps and shows lead with orange), but I don't like how it asymmetrically doesn't show when you're not engaged. @adeebshihadeh what do you think?
lgtm