Skip to content
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

Standardize powertrain type classification #1478

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ugtthis
Copy link

@ugtthis ugtthis commented Nov 13, 2024

Wanted to add this so I could query powertrain type easier for opendbc-site

Problem

  • Each make has its own way of indicating powertrain type
  • Harder to query well, a certain car's powertrain type.
    Currently I could parse the name which includes the make, model, and model years to see if hybrid, PHEV, or electric is in it or I could check if the certain car make, has a hybrid/EV type flag

Proposed Solution

I am breaking it up into 3 PRs

Current PR:

  • By default, all vehicles are PowertrainType = PowertrainType.ICE for backward compatibility
  • Included changes for Tesla as an example

2nd PR: Added PowertrainType to individual cars #1484

  • Use PowertrainType for all vehicle definitions in values.py
  • I originally thought I would migrate everything to the new powertrain type but then I noticed that Hyundai, Toyota, and Subaru use the older car make specific, powertrain flags on different files that affect hardware. I think it would be better for that migration to be a separate future PR for each make mentioned, which is why you will still see the old powertrain flags in this specific PR

3rd PR: Powertrain name formatter for all car makes #1502

  • Remove older methods of indicating powertrain types from vehicle definitions in values.py
  • Adds a common function into opendbc/car/__init__.py where if a car is a certain PowertrainType then add specified string(EV, Hyrbid, PHEV) to end of name. This is similar to what /car/ford/values.py line 83 does, which I think would be beneficial for all car makes to use versus every car make with their own slightly different solution of accomplishing this

@github-actions github-actions bot added car related to opendbc/car/ tesla labels Nov 13, 2024
@ugtthis
Copy link
Author

ugtthis commented Nov 14, 2024

Ran into a problem where I didn't consider how certain car platforms also have the ability to be available in multiple powertrain types(ex. Ford escape available in ICE, hybrid, and plug-in hybrid ). Converting to draft for now

-UPDATE:-
I ended up explicitly defining the different car models to show separately instead of using the Ford method, which automates creating the separate car model depending on the flag it sees. Refer to commit bb2331c

@ugtthis ugtthis marked this pull request as draft November 14, 2024 18:05
@ugtthis ugtthis marked this pull request as ready for review November 19, 2024 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
car related to opendbc/car/ tesla
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant