openpilot icon indicating copy to clipboard operation
openpilot copied to clipboard

Toyota: forward openpilot fcw to cluster when engaged

Open cydia2020 opened this issue 3 years ago • 2 comments

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. image

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

cydia2020 avatar Sep 06 '22 03:09 cydia2020

How does this compare/impact the current FCW alert we send? Is the only purpose is so we can show on Prius V?

sshane avatar Sep 11 '22 10:09 sshane

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"

cydia2020 avatar Sep 11 '22 10:09 cydia2020

I think we should block and forward the ACC_HUD message so we can send the correct FCW message

sshane avatar Jul 26 '23 08:07 sshane

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.

cydia2020 avatar Jul 26 '23 09:07 cydia2020

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?

sshane avatar Aug 01 '23 01:08 sshane

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.

cydia2020 avatar Aug 02 '23 10:08 cydia2020

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?

sshane avatar Aug 25 '23 22:08 sshane

lgtm

adeebshihadeh avatar Aug 26 '23 00:08 adeebshihadeh