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

Chrysler: Parse LKAS button from steering wheel #1963

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sunnyhaibin
Copy link
Contributor

  • Reimplements: Chrysler: Parse LKAS button from steering wheel #1277
  • Fixed message address Center_Stack_1 for RAM_HD platforms
  • Utilizes fingerprints for available message detections for RAM_CARS platforms
  • Introduced new ChryslerFlags int flags to identify which button configuration a car uses

@github-actions github-actions bot added DBC signals car related to opendbc/car/ chrysler labels Mar 9, 2025
@sunnyhaibin
Copy link
Contributor Author

(openpilot) YOLO@YOLO openpilot % pytest selfdrive/car/tests/test_models.py
=============================================================================================================================================== test session starts ===============================================================================================================================================
platform darwin -- Python 3.12.0, pytest-8.3.4, pluggy-1.5.0
Using --randomly-seed=2529554695
rootdir: YOLO
configfile: pyproject.toml
plugins: randomly-3.16.0, cov-6.0.0, cpp-2.6.0, subtests-0.14.1, repeat-0.9.3, asyncio-0.25.3, hypothesis-6.47.5, timeout-2.3.1, mock-3.14.0, xdist-3.6.1
asyncio: mode=Mode.STRICT, asyncio_default_fixture_loop_scope=function
10 workers [1883 items]   
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss...sssss.....................................................................................................................................................................s................................................ [ 15%]
.............................................................sssss......................................................................................................................................................................................................................................... [ 31%]
........................................................................................................................................................................................................................................................................................................... [ 47%]
.............................................................................................ss.sss........................................................................................................................................................................................................ [ 63%]
............sssss.....sssss..sssss.........ss.sss.............................sssss..............................................................................................sssss................sssss.........ssssssssss...........ss..sss.....sssss....sssss.......sssss............................ [ 79%]
........................................................................................................................................................................................................................................................s.ssss............sssss............................ [ 95%]
..s.s.sss...........sssss....sss.s.sss...................................................                                                                                                                                                                                                                   [100%]
============================================================================================================================================== slowest 10 durations ===============================================================================================================================================
4.10s setup    selfdrive/car/tests/test_models.py::TestCarModel_201_SUBARU_IMPREZA::test_car_interface@CarTestRoute(route='8de015561e1ea4a0|2023-08-29--17-08-31', car_model=<CAR.SUBARU_IMPREZA>, segment=None)
4.08s setup    selfdrive/car/tests/test_models.py::TestCarModel_44_GENESIS_GV70_1ST_GEN::test_car_interface@CarTestRoute(route='ca4de5b12321bd98|2022-10-18--21-15-59', car_model=<CAR.GENESIS_GV70_1ST_GEN>, segment=None)
4.06s setup    selfdrive/car/tests/test_models.py::TestCarModel_10_CADILLAC_ESCALADE_ESV::test_car_interface@CarTestRoute(route='46460f0da08e621e|2021-10-26--07-21-46', car_model=<CAR.CADILLAC_ESCALADE_ESV>, segment=None)
3.97s setup    selfdrive/car/tests/test_models.py::TestCarModel_6_BUICK_LACROSSE::test_car_interface@CarTestRoute(route='75a6bcb9b8b40373|2023-03-11--22-47-33', car_model=<CAR.BUICK_LACROSSE>, segment=None)
3.91s setup    selfdrive/car/tests/test_models.py::TestCarModel_144_KIA_SORENTO_HEV_4TH_GEN::test_car_interface@CarTestRoute(route='628935d7d3e5f4f7|2022-11-30--01-12-46', car_model=<CAR.KIA_SORENTO_HEV_4TH_GEN>, segment=None)
3.89s setup    selfdrive/car/tests/test_models.py::TestCarModel_4_AUDI_Q2_MK1::test_car_interface@CarTestRoute(route='6c6b466346192818|2021-06-06--14-17-47', car_model=<CAR.AUDI_Q2_MK1>, segment=None)
3.81s setup    selfdrive/car/tests/test_models.py::TestCarModel_5_AUDI_Q3_MK2::test_car_interface@CarTestRoute(route='0cd0b7f7e31a3853|2021-12-03--03-12-05', car_model=<CAR.AUDI_Q3_MK2>, segment=None)
3.80s setup    selfdrive/car/tests/test_models.py::TestCarModel_0_ACURA_ILX::test_car_interface@CarTestRoute(route='917b074700869333|2021-05-24--20-40-20', car_model=<CAR.ACURA_ILX>, segment=None)
3.73s setup    selfdrive/car/tests/test_models.py::TestCarModel_106_HYUNDAI_SANTA_CRUZ_1ST_GEN::test_car_interface@CarTestRoute(route='f0709d2bc6ca451f|2022-10-15--08-13-54', car_model=<CAR.HYUNDAI_SANTA_CRUZ_1ST_GEN>, segment=None)
3.67s setup    selfdrive/car/tests/test_models.py::TestCarModel_1_ACURA_RDX::test_car_interface@CarTestRoute(route='f34a60d68d83b1e5|2020-10-06--14-35-55', car_model=<CAR.ACURA_RDX>, segment=None)
================================================================================================================================== 1698 passed, 185 skipped in 135.17s (0:02:15) ==================================================================================================================================

Copy link
Collaborator

@jyoung8607 jyoung8607 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I love the approach of adding a bunch of flags and conditionals.

All three cases are using reverse-engineered message/signal definitions, and are already pre-processed by the DBC generator. This means we're free to come up with a single message/signal naming scheme that opendbc can use with zero flags and conditionals, and I think we should do that.

Also, the pacifica_2017_hybrid and ram_dt cases may be redundant. They're named entirely differently, but they're the same CAN arb ID, message length, and signal bit offset for the LKAS button.

Lastly, if RAM_DT and RAM_HD don't share 816 and 650 (as this PR implies) then they shouldn't both be present in both generated DBCs, so we shouldn't add them both to HD in this PR and we should probably cleanup RAM_DT.

TL;DR: Tackle #1977 first, then this PR gets dramatically smaller.

@jyoung8607 jyoung8607 marked this pull request as draft March 11, 2025 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
car related to opendbc/car/ chrysler DBC signals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants