openpilot is an open source driver assistance system. openpilot performs the functions of Automated Lane Centering and Adaptive Cruise Control for over 200 supported car makes and models.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Shane Smiskol adb04b5dc5
fingerprints: fix formatting (#30814)
1 year ago
..
body Move all fingerprints to fingerprints.py (#30790) 1 year ago
chrysler fingerprints: fix formatting (#30814) 1 year ago
ford Move all fingerprints to fingerprints.py (#30790) 1 year ago
gm fingerprints: fix formatting (#30814) 1 year ago
honda fingerprints: fix formatting (#30814) 1 year ago
hyundai fingerprints: fix formatting (#30814) 1 year ago
mazda fingerprints: fix formatting (#30814) 1 year ago
mock Use StrEnum for car classes (#30114) 2 years ago
nissan fingerprints: fix formatting (#30814) 1 year ago
subaru fingerprints: fix formatting (#30814) 1 year ago
tesla Move all fingerprints to fingerprints.py (#30790) 1 year ago
tests test_models: fuzz test panda and CarState (#30443) 1 year ago
torque_data remove PyYAML package (#30770) 1 year ago
toyota fingerprints: fix formatting (#30814) 1 year ago
volkswagen fingerprints: fix formatting (#30814) 1 year ago
CARS_template.md Fix typo in CARS.md (#30433) 1 year ago
README.md Move all fingerprints to fingerprints.py (#30790) 1 year ago
__init__.py Update Python packages and pre-commit hooks (#29739) 2 years ago
car_helpers.py swaglog.py goes in common/ (#30631) 1 year ago
disable_ecu.py swaglog.py goes in common/ (#30631) 1 year ago
docs.py add openpilot prefix to imports (#29498) 2 years ago
docs_definitions.py GM: update harness parts (#30361) 2 years ago
ecu_addrs.py swaglog.py goes in common/ (#30631) 1 year ago
fingerprints.py fix bad CAN fingerprint type (#30809) 1 year ago
fw_query_definitions.py cleanup fingerprinting typing (#30801) 1 year ago
fw_versions.py Move all fingerprints to fingerprints.py (#30790) 1 year ago
interfaces.py interfaces: fix get_interface_attr typing (#30813) 1 year ago
isotp_parallel_query.py swaglog.py goes in common/ (#30631) 1 year ago
vin.py swaglog.py goes in common/ (#30631) 1 year ago

README.md

selfdrive/car

Check out this blog post for a high-level overview of porting a car.

Useful car porting utilities

Testing car ports in your car is very time-consuming. Check out these utilities to do basic checks on your work before running it in your car.

Cabana

View your car's CAN signals through DBC files, which openpilot uses to parse and create messages that talk to the car.

Example:

> tools/cabana/cabana '1bbe6bf2d62f58a8|2022-07-14--17-11-43'

selfdrive/debug/auto_fingerprint.py

Given a route and platform, automatically inserts FW fingerprints from the platform into the correct place in values.py

Example:

> python selfdrive/debug/auto_fingerprint.py '1bbe6bf2d62f58a8|2022-07-14--17-11-43' 'SUBARU OUTBACK 6TH GEN'
Attempting to add fw version for:  SUBARU OUTBACK 6TH GEN

selfdrive/car/tests/test_car_interfaces.py

Finds common bugs for car interfaces, without even requiring a route.

Example: Typo in signal name

> pytest selfdrive/car/tests/test_car_interfaces.py -k subaru  # replace with the brand you are working on

=====================================================================
FAILED selfdrive/car/tests/test_car_interfaces.py::TestCarInterfaces::test_car_interfaces_165_SUBARU_LEGACY_7TH_GEN - KeyError: 'CruiseControlOOPS'

selfdrive/debug/test_car_model.py

Given a route, runs most of the car interface to check for common errors like missing signals, blocked panda messages, and safety mismatches.

Example: panda safety mismatch for gasPressed

> python selfdrive/debug/test_car_model.py '4822a427b188122a|2023-08-14--16-22-21'

=====================================================================
FAIL: test_panda_safety_carstate (__main__.CarModelTestCase.test_panda_safety_carstate)
Assert that panda safety matches openpilot's carState
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/batman/xx/openpilot/openpilot/selfdrive/car/tests/test_models.py", line 380, in test_panda_safety_carstate
    self.assertFalse(len(failed_checks), f"panda safety doesn't agree with openpilot: {failed_checks}")
AssertionError: 1 is not false : panda safety doesn't agree with openpilot: {'gasPressed': 116}

Car port structure

interface.py

Generic interface to send and receive messages from CAN (controlsd uses this to communicate with car)

fingerprints.py

Fingerprints for matching to a specific car

carcontroller.py

Builds CAN messages to send to car

carstate.py

Reads CAN from car and builds openpilot CarState message

values.py

Limits for actuation, general constants for cars, and supported car documentation

radar_interface.py

Interface for parsing radar points from the car