openpilot

Application

commaai/openpilot

Openpilot upgrades driver assistance systems in 300+ cars.

Overview

openpilot is an open-source operating system for robotics, currently enhancing driver assistance systems in over 300 supported car models. It provides advanced driver-assistance features and is developed by comma.ai and the community.

README Preview

\n\nopenpilot\n\n\n  openpilot is an operating system for robotics.\n  \n  Currently, it upgrades the driver assistance system in 300+ supported cars.\n\n\n\n  Docs\n   · \n  Roadmap\n   · \n  Contribute\n   · \n  Community\n   · \n  Try it on a comma four\n\n\nQuick start: `bash \n\n\n  \n    \n    \n    \n  \n\n\n\nUsing openpilot in a car\n------\n\nTo use openpilot in a car, you need four things:\n1. **Supported Device:** a comma four, available at [comma.ai/shop/comma-four](https://www.comma.ai/shop/comma-four).\n2. **Software:** The setup procedure for the comma four allows users to enter a URL for custom software. Use the URL `openpilot.comma.ai` to install the release version.\n3. **Supported Car:** Ensure that you have one of [the 300+ supported cars](docs/CARS.md).\n4. **Car Harness:** You will also need a [car harness](https://comma.ai/shop/car-harness) to connect your comma four to your car.\n\nWe have detailed instructions for [how to install the harness and device in a car](https://comma.ai/setup). Note that it's possible to run openpilot on [other hardware](https://blog.comma.ai/self-driving-car-for-free/), although it's not plug-and-play.\n\n\n### Branches\n\nRunning `master` and other branches directly is supported, but it's recommended to run one of the following prebuilt branches:\n\n| comma four branch      | comma 3X branch        | URL                                    | description                                                                         |\n|------------------------|------------------------|----------------------------------------|-------------------------------------------------------------------------------------|\n| `release-mici`         | `release-tizi`         | openpilot.comma.ai                     | This is openpilot's release branch.                                                 |\n| `release-mici-staging` | `release-tizi-staging` | openpilot-test.comma.ai                | This is the staging branch for releases. Us

FAQ (5)

Troubleshooting
How to fix openpilot selfdrived init timeout and DI_cruiseState fault on Tesla after a cold boot?

This occurs when modeld loads the 773 MB big model from a cold page cache while running at realtime priority. The loader inherits modeld's realtime scheduling and starves controlsd/selfdrived during memory reclaim, causing the 6 s init timeout, carControl not alive, blocked DAS_control, and a cruise fault.

Fix by updating to an openpilot build containing [PR #39007](https://github.com/commaai/openpilot/pull/39007), "modeld: set realtime scheduling after model load." When backporting:

1. Load the big model before calling config_realtime_process()/setting realtime scheduling.
2. Keep garbage collection disabled during loading, previously done inside config_realtime_process(), for example with gc.disable().
3. Switch modeld to realtime priority only after the model has finished loading.

This has no measurable model-loading performance impact and prevents controlsd startup from being starved. A second startup after the model is already in the page cache may avoid the fault, but the priority change is the actual fix.

GitHub Issue #39001
Troubleshooting
Why does comma four fail to bootkick and trigger Toyota LKAS/camera dash faults after the car sits idle?

This can occur when the panda's STM32 enters a brown-out/NMI state. The NMI handler stays in an infinite loop instead of resetting, leaving GPIO/relay and CAN bus states in a bad condition. Temporary workaround: unplug and reconnect the comma device; it should boot and work normally afterward. Permanent fix: update openpilot/panda firmware to a build containing PR #38737, "Handle and report NMI/hardfaults," which resets the STM on NMI/hard fault and adds logging. On night-dev, check for updates after the fix is merged; advanced users can flash the test branch. If it repeats, inspect comma power and supply voltage.

GitHub Issue #38488
Troubleshooting
How to fix comma four dmonitoringmodeld not running and driver monitoring calibration stuck at 0% due to missing dm_warp_1344x760_tinygrad.pkl?

This affects nightly builds after PR #38684, where comma ARM64 portable builds only generate the camera warp file for the build device instead of both TICI and MICI resolutions. A comma four/MICI needs selfdrive/modeld/models/dm_warp_1344x760_tinygrad.pkl.

Immediate workaround: reflash or switch the comma four to the known-working release-chestnut build:
- AGNOS: 19.6
- Branch: release-chestnut
- Commit: 053d9c446800df38aca42b69bb99197aefbea77b

Verify the file exists from the openpilot directory:

ls -l selfdrive/modeld/models/dm_warp_1344x760_tinygrad.pkl

That build also contains dm_warp_1928x1208_tinygrad.pkl, and driver-monitoring calibration progresses normally.

For a portable nightly/release build, fix SConscript so comma ARM64 prebuilts include both camera configurations:
- TICI: 1928x1208 from _ar_ox_fisheye
- MICI/comma four: 1344x760 from _os_fisheye

Keep the single-camera optimization only for device-local builds. Rebuild and confirm both files are present before deploying:

ls -l selfdrive/modeld/models/dm_warp_1344x760_tinygrad.pkl \
       selfdrive/modeld/models/dm_warp_1928x1208_tinygrad.pkl

Then reboot or restart openpilot.

GitHub Issue #38762
Troubleshooting
How do I fix openpilot steering disengaging or jerking below 32 MPH in a 2019 Kia Niro PHEV?

The 2019 Kia Niro PHEV's EPS firmware enforces a minimum steering speed of about 32 MPH (14 m/s); openpilot cannot make the car steer from 0 MPH on that EPS. The forks you used did not declare this limit, so openpilot kept requesting steering and could abruptly reapply it when the actual speed crossed 32 MPH.

Fix: use an upstream openpilot build that includes the official HKG 2019 Kia Niro PHEV support/PR instead of v0.8.5 forks such as hkg_085 or Donfyffe. If you maintain a fork, add the vehicle in selfdrive/car/hyundai/interface.py and set ret.minSteerSpeed = 14.0 for the 2019 Niro PHEV, matching the existing 2019 Hyundai Ioniq handling. This lets openpilot cleanly suppress and re-enable steering across the threshold rather than fighting the EPS.

Until upgraded, do not use the system in stop-and-go traffic or when speed may hover around 32 MPH, and be prepared to steer manually. The missing LKAS fault warning is a separate issue and requires logs from an affected route.

GitHub Issue #21479
Troubleshooting
Why does openpilot logmessaged drop the first log messages from newly started processes such as dmonitoringmodeld?

This is a startup-order race. Processes publish their early logs before loggerd/logmessaged has connected the ZeroMQ subscriber, so those initial PUB messages are discarded and cannot be recovered.

Fix:
1. Update openpilot to a version containing both PRs:
- logmessaged: avoid dropping messages
- manager: start loggerd before other processes
2. If backporting manually, edit selfdrive/manager/process_config.py and move loggerd before dmonitoringd, dmonitoringmodeld, modeld, and other processes that emit startup logs.
3. Rebuild and restart the manager, or reboot the device:

cd /data/openpilot
   scons -j$(nproc)
   sudo reboot

4. Verify that early logs are now captured:
./selfdrive/debug/filter_log_message.py "" 0 | grep modeld

The key requirement is that loggerd must be running and subscribed before client processes start logging.

GitHub Issue #29086