docs: car port info cleanup (#33630)
* GC, now duplicated and out of place * typo fix * link to official video with better slides * expansion and cleanuppull/33631/head
parent
62d044c794
commit
900c2c83bd
2 changed files with 24 additions and 26 deletions
@ -1,22 +1,39 @@ |
|||||||
# What is a car port? |
# What is a car port? |
||||||
|
|
||||||
A car port enables openpilot support on a particular car. Each car model openpilot supports needs to be individually ported. All car ports live in `openpilot/selfdrive/car/car_specific.py` and `opendbc_repo/opendbc/car`. |
A car port enables openpilot support on a particular car. Each car model openpilot supports needs to be individually ported. The complexity of a car port varies depending on many factors including: |
||||||
|
|
||||||
The complexity of a car port varies depending on many factors including: |
|
||||||
* existing openpilot support for similar cars |
* existing openpilot support for similar cars |
||||||
* architecture and APIs available in the car |
* architecture and APIs available in the car |
||||||
|
|
||||||
|
|
||||||
# Structure of a car port |
# Structure of a car port |
||||||
|
|
||||||
|
Virtually all car-specific code is contained in two other repositories: [opendbc](https://github.com/commaai/opendbc) and [panda](https://github.com/commaai/panda). |
||||||
|
|
||||||
|
## opendbc |
||||||
|
|
||||||
|
Each car brand is supported by a standard interface structure in `opendbc/car/[brand]`: |
||||||
|
|
||||||
* `interface.py`: Interface for the car, defines the CarInterface class |
* `interface.py`: Interface for the car, defines the CarInterface class |
||||||
* `carstate.py`: Reads CAN from car and builds openpilot CarState message |
* `carstate.py`: Reads CAN messages from the car and builds openpilot CarState messages |
||||||
* `carcontroller.py`: Builds CAN messages to send to car |
* `carcontroller.py`: Control logic for executing openpilot CarControl actions on the car |
||||||
|
* `[brand]can.py`: Composes CAN messages for carcontroller to send |
||||||
* `values.py`: Limits for actuation, general constants for cars, and supported car documentation |
* `values.py`: Limits for actuation, general constants for cars, and supported car documentation |
||||||
* `radar_interface.py`: Interface for parsing radar points from the car |
* `radar_interface.py`: Interface for parsing radar points from the car, if applicable |
||||||
|
|
||||||
|
## panda |
||||||
|
|
||||||
|
* `board/safety/safety_[brand].h`: Brand-specific safety logic |
||||||
|
* `tests/safety/test_[brand].py`: Brand-specific safety CI tests |
||||||
|
|
||||||
|
## openpilot |
||||||
|
|
||||||
|
For historical reasons, openpilot still contains a small amount of car-specific logic. This will eventually be migrated to opendbc or otherwise removed. |
||||||
|
|
||||||
|
* `selfdrive/car/car_specific.py`: Brand-specific event logic |
||||||
|
|
||||||
# Overiew |
# Overview |
||||||
|
|
||||||
[Jason Young](https://github.com/jyoung8607) gave a talk at COMMA_CON with an overview of the car porting process. The talk is available on YouTube: |
[Jason Young](https://github.com/jyoung8607) gave a talk at COMMA_CON with an overview of the car porting process. The talk is available on YouTube: |
||||||
|
|
||||||
https://youtu.be/KcfzEHB6ms4?si=5szh1PX6TksOCKmM |
https://www.youtube.com/watch?v=XxPS5TpTUnI |
||||||
|
@ -1,19 +0,0 @@ |
|||||||
## 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 |
|
Loading…
Reference in new issue