-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hyundai CAN: Explicitly parse gear shifter values for EV, HEV, PHEV
#30648
Conversation
elif self.CP.carFingerprint in (HYBRID_CAR | EV_CAR): | ||
self.shifter_values = can_define.dv["ELECT_GEAR"]["Elect_Gear_Shifter"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just makes this gear GearShifter.sport
from GearShifter.unknown
. The wrongGear
alert still checks if it's drive. You need to add the extra gear to create_common_events
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sshane Updated.
@@ -29,6 +29,8 @@ def __init__(self, CP): | |||
"GEAR_SHIFTER" | |||
if CP.carFingerprint in CANFD_CAR: | |||
self.shifter_values = can_define.dv[self.gear_msg_canfd]["GEAR"] | |||
elif self.CP.carFingerprint in (HYBRID_CAR | EV_CAR): | |||
self.shifter_values = can_define.dv["ELECT_GEAR"]["Elect_Gear_Shifter"] | |||
elif self.CP.carFingerprint in CAN_GEARS["use_cluster_gears"]: | |||
self.shifter_values = can_define.dv["CLU15"]["CF_Clu_Gear"] | |||
elif self.CP.carFingerprint in CAN_GEARS["use_tcu_gears"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove # preferred and elect gear methods use same definition
comment below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sshane Updated.
…ev-sport-gear # Conflicts: # opendbc
This PR has had no activity for 30 days. It will be automatically closed in 7 days if there is no activity. |
@sshane can we mark this with |
Now that the big car dataset is out, you should be able to verify this the same way we would do. There's some example notebooks in tools/car_porting. If you have any questions about the process, let's discuss in #dev-openpilot-private. |
…ev-sport-gear # Conflicts: # opendbc
It looks like you didn't use one of the Pull Request templates. Please check the contributing docs. Also make sure that you didn't modify any of the checkboxes or headings within the template. |
This PR has had no activity for 30 days. It will be automatically closed in 7 days if there is no activity. |
We've moved the car interfacing code to our PR_NUMBER=33045
curl -L https://github.com/commaai/openpilot/pull/$PR_NUMBER.patch | sed -e 's/selfdrive\/car/opendbc_repo\/opendbc\/car/g' | git apply -v --reject Simply replace the PR number with your own. Once done, add the files, fix any conflicts, and open a new PR. Alternatively, you may start a new PR from scratch if that is easier for you. |
Description
When the car is In manumatic or different drive modes (e.g. Sport, Snow), openpilot currently does not recognize the signals and returns with "Gear not D" event and exits controls.
Solution
This PR adds support to parse different forward gear signals and adds additional undefined forward gear signals in the DBC.
Route ID
e1107f9d04dfb1e2|2024-02-16--14-51-43
26a38e4bf36bb74a|2023-11-15--10-11-14
Requires
Elect_Gear_Shifter
Sport Gear value opendbc#981