openpilot icon indicating copy to clipboard operation
openpilot copied to clipboard

Honda Nidec: HUD set cruise speed doesn't always match UI

Open gadjex opened this issue 2 years ago • 3 comments

Fix bug - Affects only Honda Nidec with comma pedal: HUD set cruise speed doesn't always match UI max cruise speed when units is set to mph.

Description Set cruise speed in KPH is rounded before sent to the HUD resulting in the HUD's conversion to MPH showing +-1 when the HUD is set to MPH. This happens at only specific set cruise speeds, such as 49 and 54mph are displayed on the HUD as 48 and 53 respectively. This only affects Honda Nidec vehicles with the comma pedal. Converting the speed to a MPH rounded integer and back to KPH before rounding the KPH and sending it over CAN ensures the HUD's conversion from KPH to MPH is correct. This fix takes into account if the units are set to metric or imperial.

Verification I applied this fix and tested that the vehicle's HUD from 25mph to 70mph is matching comma's UI.

gadjex avatar Jan 16 '23 01:01 gadjex

Will test this shortly. Has also bugged me to no end, thank you for doing these fixes @gadjex ! Up next, make the pedal actually accurate to the longitudinal plan. Currently it's terribly slow from a stop ;)

VirtuallyChris avatar Jan 17 '23 03:01 VirtuallyChris

This doesn't work on my Nidec Honda. The set speed shown on the dash gets offset by 1 or 2 mph at all times, and is worse than before this PR. There still is a rounding issue on certain speeds like 84mph which you can reproduce in the comma Civic. It's probably a slightly off DBC scaling factor.

VirtuallyChris avatar Feb 14 '23 18:02 VirtuallyChris

Can you guys try this branch? https://github.com/commaai/openpilot/pull/28344

sshane avatar May 31 '23 06:05 sshane

Closing since it's reported to not work on a Civic

sshane avatar Aug 24 '23 22:08 sshane