openpilot icon indicating copy to clipboard operation
openpilot copied to clipboard

Hyundai CAN: Explicitly parse gear shifter values for `EV, HEV, PHEV`

Open sunnyhaibin opened this issue 1 year ago • 5 comments

Description

When the vehicle is in manual or alternative drive modes (e.g., Sport), openpilot currently fails to recognize the signals and returns with an “Gear not D” event, exiting the controls.

Added Jupyter notebook for validating Sport gear for CAN hybrid and electric vehicles.

Solution

This pull request implements support for parsing various forward gear signals and adds additional undefined forward gear signals to the DBC.

Validation

Analyzing segment 201c5aaced09a24a/2023-05-20--12-39-01/15/s   for HYUNDAI IONIQ PHEV 2020
  ELECT_GEAR      gear=4.0

Requires

  • https://github.com/commaai/opendbc/pull/1530

Reopen of

  • https://github.com/commaai/openpilot/pull/30648
  • https://github.com/commaai/opendbc/pull/981

sunnyhaibin avatar Nov 26 '24 22:11 sunnyhaibin

After running against all 9000+ segments, only 2 results with the Sport gear on ELECT_GEAR | Elect_Gear_Shifter are found:

Analyzing segment 1220/9107    
Non-Drive gear found in segment 201c5aaced09a24a/2023-05-20--12-39-01/15/s   for HYUNDAI IONIQ PHEV 2020
  ELECT_GEAR      gear=4.0
Analyzing segment 1224/9107    
Non-Drive gear found in segment b28e9dbe4004e915/2023-06-11--19-55-28/2/s    for HYUNDAI IONIQ PHEV 2020
  ELECT_GEAR      gear=4.0
Analyzing segment 9107/9107 ...
Analysis finished. Total segments analyzed: 9107

sunnyhaibin avatar Nov 27 '24 06:11 sunnyhaibin

Tests are failing due to opendbc not having the PR merged yet:

Run release/check-submodules.sh
From https://github.com/commaai/msgq
 * branch            master     -> FETCH_HEAD
  origin/HEAD -> origin/master
  origin/master
msgq_repo ok
From https://github.com/commaai/opendbc
 * branch            master     -> FETCH_HEAD
opendbc_repo: c742d425f[18](https://github.com/commaai/openpilot/actions/runs/12045155969/job/33583311955?pr=34113#step:6:19)5540392896ec2db3b22929a5ecb5f is not on master
Error: Process completed with exit code 1.

sunnyhaibin avatar Nov 27 '24 13:11 sunnyhaibin

This PR has had no activity for 9 days. It will be automatically closed in 2 days if there is no activity.

github-actions[bot] avatar Dec 07 '24 02:12 github-actions[bot]

This PR has been automatically closed due to inactivity. Feel free to re-open once activity resumes.

github-actions[bot] avatar Dec 09 '24 02:12 github-actions[bot]

Can we please reopen this?

sunnyhaibin avatar Dec 09 '24 02:12 sunnyhaibin

can you delete the notebook?

sshane avatar Dec 17 '24 00:12 sshane

can you delete the notebook?

Done!

sunnyhaibin avatar Dec 17 '24 00:12 sunnyhaibin