Compare commits

...

63 Commits

Author SHA1 Message Date
Jason Wen c7e57a1bc1 chore: update CHANGELOG for 2026.001.005 2026-05-13 02:22:55 -04:00
Jason Wen 353ed2a9e1 sunnylink: add CarParams fallback for brand-specific capabilities (#1839)
Brand-specific capabilities (hyundai_alpha_long_available,
subaru_has_sng) only resolved from CarPlatformBundle, which requires
manual car selection. Auto-fingerprinted vehicles had no bundle,
leaving these capabilities at default false — hiding vehicle settings
on the dashboard despite working on the device UI.

Add _resolve_brand_capabilities() with bundle-first, CP-fallback
pattern matching the device UI layouts (hyundai.py, subaru.py).

Fixes https://community.sunnypilot.ai/t/5126
2026-05-13 01:54:58 -04:00
Jason Wen 1db8b82f16 version: bump to 2026.001.005 2026-05-13 01:54:53 -04:00
Jason Wen e8964ce7ae chore: update CHANGELOG for 2026.001.004 2026-05-10 01:19:44 -04:00
Jason Wen ad799442a8 chore: bump version to 2026.001.004 2026-05-10 01:14:07 -04:00
Jason Wen 592f062326 ci: simplify cereal validation to sparse-checkout + pycapnp, drop scons (#1836)
* ci: simplify cereal validation to sparse-checkout + pycapnp, drop scons build

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

* more

* fix: resolve cereal_dir to absolute path before passing to capnp.load

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

* ci: init opendbc submodule after sparse checkout to resolve car.capnp symlink

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

* try to break it

* Revert "try to break it"

This reverts commit 79ce135c5f.

* try to break it

* Revert "try to break it"

This reverts commit 1eaa9e79e6.

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-05-10 01:14:00 -04:00
Nayan 70fd56f69c sunnylink: fix max time offroad values (#1835)
fix sunnylink values
2026-05-10 01:13:57 -04:00
DevTekVE 29cd05d6ed sunnylink: switch athena domain (#1826)
use new domain
2026-05-10 01:13:54 -04:00
Jason Wen b1232629c3 chore: update CHANGELOG for 2026.001.003 2026-05-08 07:28:11 -04:00
Jason Wen 8539ad0373 manager: disable DEVELOPMENT_ONLY reset (#1833) 2026-05-08 07:27:59 -04:00
Jason Wen f468467606 chore: version bump 2026.001.003 2026-05-08 07:27:56 -04:00
Jason Wen 4cf822a6cc chore: update CHANGELOG for 2026.001.002 2026-05-07 11:02:40 -04:00
Jason Wen ac8af9aa94 release: ignore upstream IsReleaseBranch (#1831) 2026-05-07 11:01:33 -04:00
Jason Wen 1ac64f7360 chore: bump version to 2026.001.002 2026-05-07 11:01:27 -04:00
Jason Wen 505881cbc5 chore: update CHANGELOG for 2026.001.001 2026-05-06 22:15:17 -04:00
Jason Wen a68ed2fd01 ui: update gates for certain toggles (#1830)
* don't use upstream's

* clean

* update schema

* fix

* mismatch test and fix
2026-05-06 21:41:18 -04:00
Jason Wen 2aa179bcac chore: bump version to 2026.001.001 2026-05-06 21:41:16 -04:00
Jason Wen 090b404fee Update CHANGELOG.md
(cherry picked from commit b9aa1962ca)
2026-05-05 23:00:00 -04:00
Jason Wen 4c36db0091 Revert "sunnylink: switch athena domain (#1826)"
This reverts commit 53e5ae0578.
2026-05-05 22:08:46 -04:00
Jason Wen c25b581ae5 Default model: CD210 model 2026-05-05 22:08:29 -04:00
Jason Wen 2316b1142c Revert "POP model (#37727)"
This reverts commit 12f1be19cc.
2026-05-05 22:02:50 -04:00
Jason Wen 6b1b6aca05 Update CHANGELOG.md 2026-05-05 21:14:19 -04:00
Jason Wen 41a8bc3fc4 Update CHANGELOG.md 2026-05-05 20:54:43 -04:00
Jason Wen 540f4f5933 Platform List: dynamically migrate CarPlatformBundle (#1828) 2026-05-05 20:27:11 -04:00
DevTekVE 53e5ae0578 sunnylink: switch athena domain (#1826)
use new domain
2026-05-05 04:31:07 -04:00
Amy Jeanes 2182be05ea ui: fix cellular toggles (#1810)
UI: Fix ToggleSP._render() missing return value breaking toggle callbacks

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2026-05-03 15:52:35 -04:00
Nayan 3e44c90c68 [MICI] ui: align upstream changes with sunnypilot settings buttons (#1782)
* align with upstream

* lint

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2026-05-03 15:29:19 -04:00
Jason Wen 2d35bd895f sunnylink: SDUI (#1780)
* 1

* fix

* uh

* more

* for now

* v2

* update

* more subs

* readme

* vehicle

* cycle init

* options

* new

* combine

* new

* dynamic unit

* default

* move it

* syncing more

* more

* boom shakalaka

* rearrange

* partial availability

* move

* more

* more

* hide

* move

* revert

* more

* new

* set

* sync

* dynamic

* slightly more

* update

* update

* less

* in another pr

* more

* move and fix

* device type

* order

* order

* order

* fixes

* ew

* Revert "fixes"

This reverts commit 53a2adb45a.

* sunnylink: bundle-first capabilities + protocol_version

Bundle-first brand resolution, fix steer_control_type to use
CP.steerControlType (physical) not lateralTuning.which() (tuning class),
add Subaru/Hyundai opaque per-platform flags from CarPlatformBundle, and
embed PROTOCOL_VERSION in the capabilities payload.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* sunnylink: tighten settings_ui gates against Raylib parity

Brand gates on MadsMainCruiseAllowed/MadsUnifiedEngagementMode (rivian +
tesla-no-bus); convert enablement->visibility on items Raylib hides
(DisableUpdates, EnableGithubRunner, EnableCopyparty, QuickBootToggle,
HyundaiLongitudinalTuning, LaneTurnValue, LagdToggleDelay); drop spurious
offroad_only on DynamicExperimentalControl + DisengageOnAccelerator and
SpeedLimit policy/offset over-gates; replace offroad_only with not_engaged
on AlphaLongitudinalEnabled/Toyota long toggles; extend release-branch
NOTs with is_sp_release; add Test Maneuvers section with attestation,
move LongitudinalManeuverMode in alongside new LateralManeuverMode.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* sunnylink: extend settings_ui validator for new fields

Add SchemaItem fields title_param_suffix (object form), needs_onroad_cycle,
blocked, requires_attestation; add option-level enablement to SchemaOption;
add visibility/enablement/attestation_required to PanelSection; add
not_engaged Rule type; replace vehicle_settings inline shape with
VehicleBrandSettings def (title/description/items).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* sunnylink: inject torque tune options from versions JSON

Read latcontrol_torque_versions.json at schema generation time and
override TorqueControlTune options so adding a version to the JSON
flows to the dashboard without editing settings_ui.json by hand.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* sunnylink: per-bug regression tests for settings_ui parity

Cover the audit findings end-to-end: MADS brand gates, Test Maneuvers
section + attestation, validator accepts the JSON, dynamic torque
options match the versions JSON, SP dev items gate on is_sp_release as
well as is_release, spurious offroad_only dropped from
DisengageOnAccelerator and DynamicExperimentalControl, and offroad_only
replaced with not_engaged on AlphaLongitudinalEnabled and the Toyota
long toggles. Validator test skips when jsonschema is unavailable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* sunnylink: protocol_version sentinel + opaque-flag tests

Pin PROTOCOL_VERSION to KNOWN_PROTOCOL_VERSIONS so a bump shows up in
review, and assert subaru_has_sng / hyundai_alpha_long_available are
declared with safe False defaults.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* schema: convert ShowAdvancedControls visibility to enablement

Items previously hidden when ShowAdvancedControls is off now render
as disabled with an ADVANCED tooltip. Same treatment for dependency-
based hides (LagdToggleDelay, LaneTurnValue) so users see what's
available and why it's locked. CameraOffset gets the Advanced gate it
was missing.

Affected: DisableUpdates, EnableGithubRunner, EnableCopyparty,
QuickBootToggle, LaneTurnValue, LagdToggleDelay, CameraOffset, and the
test_maneuvers section.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* sunnylink: route resume_queued to athena direct

Backend is retiring the CloudFront proxy on stg.api.sunnypilot.ai that
currently forwards ws|settings|navigation to athena.sunnylink.ai. Once
retired, /ws/{id}/resume_queued only resolves via athena.sunnylink.ai.

SunnylinkApi.resume_queued now temporarily swaps self.api_host to
ATHENA_HOST while re-entering api_get (preserves the SunnylinkEnabled
gate and existing JWT/UA header handling). Other device calls
(device/{id}/roles, device/{id}/users, v2/pilotauth/, backups) continue
to hit the sunnylink main API host unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* legacy code

* no

* new

* tests

* lint

* fix

* too verbose

* sunnylink: per-page YAML authoring for settings_ui + named rule macros

Replace hand-edited 2200-line settings_ui.json with a per-page YAML source
tree under settings_ui_src/, plus named rule fragments (`$ref` macros) so
the same condition isn't repeated verbatim across items.

Authoring surface (settings_ui_src/):
  pages/<page>.yaml   one file per panel; sections/items/sub_panels inline
  pages/vehicle.yaml  per-brand settings (kind: vehicle -> vehicle_settings)
  _macros.yaml        named rule fragments referenced via {$ref: "#/macros/<name>"}
  _schemas/*.json     JSON Schemas for IDE autocomplete + CI validation

Pages today: steering, cruise, display, visuals, toggles, device, software,
developer, models, vehicle (10).

Tools:
  compile_settings_ui.py  read src tree, resolve $refs, emit settings_ui.json
                          (--check mode for CI to fail on hand-edits)
  extract_settings_ui.py  one-shot: settings_ui.json -> per-page YAML
  apply_macros.py         one-shot: substitute matching rule blocks with $ref

Rule-block dedup wins (top duplicates collapsed to single macros):
  offroad (9x), longitudinal (4x), longitudinal_and_icbm (5x),
  hide_on_mici (4x), advanced_only (3x), mads_full_platforms (4x ~30-line
  nested any/all/not -> 1 macro + 4x one-line $ref).

Validator drift fixes:
  - Accept not_engaged rule type (already in schema.json + used by
    AlphaLongitudinalEnabled, ToyotaEnforceStockLongitudinal,
    ToyotaStopAndGoHack, LateralManeuverMode, LongitudinalManeuverMode).
  - Enforce {title, description, items} shape on every vehicle brand
    instead of allowing bare-list variants.

Wire format unchanged: compiled settings_ui.json structurally identical to
the prior hand-edited file, so the device generator (generate_settings_schema.py),
SettingsCapabilities, and frontend renderer all keep working without changes.

Tests: 16 new compiler tests (roundtrip, $ref semantics, depth/cycle limits,
page-tree integrity, vehicle kind routing). Existing 42 regression tests in
test_settings_changes.py and test_settings_schema.py remain green.

README rewritten for the new flow:
  - Decision table for offroad_only / not_engaged / param / capability
  - Multi-condition composition examples (AND/OR/mixed/3-way/negation)
  - Full feature walkthrough (multi-toggle + sub_panel + new macro)
  - Workflows for changing rules, widget type, deprecating an item
  - All How-To examples migrated from JSON to YAML

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* sunnylink: add `details` field for popover/modal help text

Adds an optional `details` field on settings items, distinct from the inline
`description`. When present, the frontend renders an info ("i") button on the
row that opens a modal with this content. Either field may be present alone,
or both together; an item with only `details` and no `description` shows just
the title + info button (no inline body).

Migrates `AutoLaneChangeTimer` as the first user: the safety caveat
("Please use caution when using this feature. Only use the blinker when
traffic and road conditions permit.") moves out of the inline description
into `details`, leaving the description focused on what the timer actually
does.

Schema changes:
- settings_ui.schema.json: SchemaItem.details (string, optional)
- settings_ui_src/_schemas/page.schema.json: Item.details (mirror)
- compile_settings_ui.py / extract_settings_ui.py: ordered after description

Frontend support lands in sunnylink-frontend on the design-overhaul branch.
Old frontends ignore the unknown key.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ui: refactor UIStateSP init to eliminate getattr and double update_params

- Remove update_params() and reset_onroad_sleep_timer() from UIStateSP.__init__;
  __init__ is now pure attr initialization with no I/O or side effects
- Add _sp_initialized flag to UIStateSP.update_params() to fire
  reset_onroad_sleep_timer() exactly once after first real param load,
  keeping the call in SP territory and out of stock _initialize()
- Replace getattr(self, 'has_longitudinal_control') / getattr(self, 'CP')
  in _enforce_constraints with direct attr access; safe because
  _enforce_constraints is only called from update_params(), which only
  runs after UIState._initialize() has set both attrs
- Rename _enforce_sp_constraints → _enforce_constraints

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix

* exec

* more exec

* humanize

* sync

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 13:18:15 -04:00
Jason Wen 855d5022ad MADS: suppress espActive event when long is not engaged (#1823) 2026-05-03 02:30:19 -04:00
github-actions[bot] 6a363365ab [bot] Update Python packages (#1822)
Update Python packages

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-05-03 01:00:33 -04:00
Jason Wen ddb9039493 torque: show static override values in Dev UI & gate useParams on custom torque tune (#1821)
torque: show static override values in Dev UI
2026-04-28 07:26:05 -04:00
Jason Wen 0b7df7df10 DM: wheel touch enforcement in MADS (#1820) 2026-04-28 01:29:54 -04:00
github-actions[bot] dd3feac854 [bot] Update Python packages (#1812)
Update Python packages

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-04-27 23:20:24 -04:00
Jason Wen 10a33a4bf1 tg: reapply changes (#1817)
* Reapply "bump tg (#37700)"

This reverts commit 9022b4d322.

* fixup! Reapply "bump tg (#37700)"

* Revert "Revert "autodetect tg backend (#37778)""

This reverts commit b782958a

* Reapply "autodetect tg backend: use CPU:LLVM on Linux (#37785)"

This reverts commit 3fa6726f88.

* Reapply "Modeld: support uncompiled"

This reverts commit 8c240cc1a4.

* fixup! Reapply "bump tg (#37700)"

* fixup! Reapply "autodetect tg backend: use CPU:LLVM on Linux (#37785)"

* fixup! Revert "Revert "autodetect tg backend (#37778)""

* fixup! Reapply "autodetect tg backend: use CPU:LLVM on Linux (#37785)"

* fixup! Reapply "autodetect tg backend: use CPU:LLVM on Linux (#37785)"

* fixup! Revert "Revert "autodetect tg backend (#37778)""

* fixup! Reapply "bump tg (#37700)"

* fixup! Reapply "bump tg (#37700)"
2026-04-26 01:32:55 -04:00
DevTekVE 8714203d2c sunnylink: Remove unused API endpoint (#1814)
remove ws_queue thread and associated api endpoint
- Simplified thread management by removing unused `ws_queue`.
- Eliminated `resume_queued` API call for better maintainability.
2026-04-25 11:21:55 -04:00
Nayan 18406e77ee [MICI] ui: add sunnylink info & connectivity check (#1798)
* add info & connectivity check

* meh, no icon

* lint

* fix state

* good bot

---------

Co-authored-by: DevTekVE <devtekve@gmail.com>
2026-04-19 11:55:00 -04:00
Jason Wen fdd43f49e0 ci: validate upstream compat by schema diff typeId (#1809) 2026-04-18 16:06:15 -04:00
Jason Wen f93481d0d4 Reapply "controls: always default Torque Lateral Control to v0 Tune" (#1806) (#1807)
* Reapply "controls: always default Torque Lateral Control to v0 Tune" (#1806)

This reverts commit 5f6e05410d.

* this is better
2026-04-18 03:10:40 -04:00
Jason Wen 5f6e05410d Revert "controls: always default Torque Lateral Control to v0 Tune" (#1806)
Revert "controls: always default Torque Lateral Control to v0 Tune (#1804)"

This reverts commit d1d6fae613.
2026-04-18 00:48:28 -04:00
Jason Wen d1d6fae613 controls: always default Torque Lateral Control to v0 Tune (#1804)
* controls: always default Torque Lateral Control to v0 Tune

* add fixme
2026-04-17 03:28:58 -04:00
github-actions[bot] 35aeeee657 [bot] Update Python packages (#1799)
Update Python packages

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-04-17 03:07:56 -04:00
Jason Wen a6fdef77df Sync: commaai/openpilot:mastersunnypilot/sunnypilot:master (#1803) 2026-04-17 02:47:36 -04:00
Jason Wen df66604a45 Merge branch 'upstream/openpilot/master' into sync-20260417
# Conflicts:
#	docs/CARS.md
#	opendbc_repo
#	panda
#	system/updated/updated.py
#	tinygrad_repo
2026-04-17 02:36:53 -04:00
Trey Moen c001f3c9b4 esim: implement download profile (#37806) 2026-04-15 22:06:54 -07:00
Adeeb Shihadeh 752fe03118 docs: add feedback guide (#37842)
* docs: add feedback guide

* lil more feedback

* the
2026-04-15 19:13:30 -07:00
Adeeb Shihadeh 84c276bb6c misc docs updates (#37839)
* that's home

* more extensions

* lil fixups

* lil more

* collapse car ports

* fix links
2026-04-15 18:37:23 -07:00
Adeeb Shihadeh 9042cfa1ad rm home 2026-04-15 15:55:37 -07:00
Adeeb Shihadeh 83e6e7da93 docs: setup zensical (#37838) 2026-04-15 15:46:43 -07:00
Adeeb Shihadeh 31403f4a5c jotplugger: render segment range slices properly (#37837) 2026-04-15 10:50:24 -07:00
Ethan Reish 117d5cee4f updated: complete branch migration dict for mici and tizi (#37830) 2026-04-15 10:46:15 -07:00
Adeeb Shihadeh fa18e6395c tools: remove sentry logging (#37836) 2026-04-15 10:26:12 -07:00
Adeeb Shihadeh 75e352e5d0 jotpluggler: CAN parsing is best effort (#37835) 2026-04-15 10:24:37 -07:00
Shane Smiskol 63ab2fb1b3 four: calibrate DM orientation (#37149)
* calib face

* clean up

* fix double neg

* cmt

* local changes

* keep for dm preview for now

* comments

* comments

* Update selfdrive/ui/mici/onroad/driver_state.py

* Update selfdrive/ui/mici/onroad/driver_state.py
2026-04-15 10:15:32 -07:00
commaci-public 97f1bac71d [bot] Update Python packages (#37815)
Update Python packages

Co-authored-by: Vehicle Researcher <user@comma.ai>
2026-04-15 09:54:46 -07:00
Trey Moen 00b7c8e8ad esim: implement ES9P HTTP and notification processing (#37807) 2026-04-15 09:44:28 -07:00
Daniel Koepping 1276452cfc add blocked-startup offroad label (#37833)
add blocked-startup offroad label
2026-04-15 00:15:57 -07:00
Daniel Koepping 8b2eac4d1f use warning as alert icon (#37832)
replace bell with warning icon
2026-04-15 00:09:59 -07:00
Daniel Koepping e78e6261ca Add touch zone for alerts (#37819)
* add touch zone for alerts

* adjust touch zone

* 200 px zones

* 50/30 split

* adjust zones
2026-04-14 23:19:40 -07:00
Daniel Koepping d5f1d8c33a fix compare_logs crash on list field size changes (#37829)
fix crash on list-length changes
2026-04-14 20:18:31 -07:00
stef e16d422cf4 body quality of life (#37803)
* turn off ir leds on notCar

* reduce startup time on notCar

* fix: check notCar once after onroad is true

* save a disk read by using existing is_onroad
2026-04-14 19:13:57 -07:00
Adeeb Shihadeh f70a156c7e docs: fix invalid img tags in car docs (#37828) 2026-04-14 16:35:34 -07:00
Adeeb Shihadeh d204d626bd jp: skip unparsable messages (#37816) 2026-04-14 14:53:49 -07:00
Daniel Koepping 4a15bdcdae Add alerts pill (#37821)
* add notification pill

* add update

* comment

* lfs upload

* rename

* fix

* try widget

* white is banned!

* same for bell

* need everywhere?

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2026-04-14 12:02:30 -07:00
120 changed files with 9591 additions and 1301 deletions
+30 -43
View File
@@ -23,56 +23,43 @@ env:
CI: 1
jobs:
generate_cereal_artifact:
name: Generate cereal validation artifacts
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
submodules: true
- run: ./tools/op.sh setup
- name: Build openpilot
run: scons -j$(nproc) cereal
- name: Generate the log file
run: |
export PYTHONPATH=${{ github.workspace }}
python3 cereal/messaging/tests/validate_sp_cereal_upstream.py -g -f schema_instances.bin
- name: 'Prepare artifact'
run: |
mkdir -p "cereal/messaging/tests/cereal_validations"
cp cereal/messaging/tests/validate_sp_cereal_upstream.py "cereal/messaging/tests/cereal_validations/validate_sp_cereal_upstream.py"
cp schema_instances.bin "cereal/messaging/tests/cereal_validations/schema_instances.bin"
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: cereal_validations
path: cereal/messaging/tests/cereal_validations
validate_cereal_with_upstream:
name: Validate cereal with Upstream
runs-on: ubuntu-24.04
needs: generate_cereal_artifact
steps:
- name: Checkout sunnypilot
- name: Checkout sunnypilot cereal
uses: actions/checkout@v6
- name: Checkout upstream openpilot
with:
sparse-checkout: cereal
- name: Init sunnypilot opendbc submodule
run: git submodule update --init --depth 1 opendbc_repo
- name: Checkout upstream openpilot cereal
uses: actions/checkout@v6
with:
repository: 'commaai/openpilot'
path: openpilot
submodules: true
path: upstream_openpilot
sparse-checkout: cereal
ref: "refs/heads/master"
- run: ./tools/op.sh setup
- name: Build openpilot
working-directory: openpilot
run: scons -j$(nproc) cereal
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: cereal_validations
path: openpilot/cereal/messaging/tests/cereal_validations
- name: 'Run the validation'
- name: Init upstream opendbc submodule
working-directory: upstream_openpilot
run: git submodule update --init --depth 1 opendbc_repo
- name: Install uv
run: pip install uv
- name: Generate sunnypilot schema
run: |
export PYTHONPATH=${{ github.workspace }}/openpilot
chmod +x openpilot/cereal/messaging/tests/cereal_validations/validate_sp_cereal_upstream.py
python3 openpilot/cereal/messaging/tests/cereal_validations/validate_sp_cereal_upstream.py -r -f openpilot/cereal/messaging/tests/cereal_validations/schema_instances.bin
PYCAPNP_VER=$(python3 -c "import re; m=re.search(r'name = \"pycapnp\"\nversion = \"([^\"]+)\"', open('uv.lock').read()); print(m.group(1))")
uv run --isolated --with "pycapnp==${PYCAPNP_VER}" \
python3 cereal/messaging/tests/validate_sp_cereal_upstream.py \
-g -f /tmp/sp_schema.json --cereal-dir cereal
- name: Validate against upstream
run: |
PYCAPNP_VER=$(python3 -c "import re; m=re.search(r'name = \"pycapnp\"\nversion = \"([^\"]+)\"', open('uv.lock').read()); print(m.group(1))")
uv run --isolated --with "pycapnp==${PYCAPNP_VER}" \
python3 cereal/messaging/tests/validate_sp_cereal_upstream.py \
-r -f /tmp/sp_schema.json --cereal-dir upstream_openpilot/cereal
+3 -3
View File
@@ -29,9 +29,9 @@ jobs:
# Build
- name: Build docs
run: |
# TODO: can we install just the "docs" dependency group without the normal deps?
pip install mkdocs
mkdocs build
git lfs pull
pip install zensical
python scripts/docs.py build
# Push to docs.comma.ai
- uses: actions/checkout@v6
+2
View File
@@ -44,8 +44,10 @@ bin/
config.json
compile_commands.json
compare_runtime*.html
selfdrive/modeld/models/tg_compiled_flags.json
# build artifacts
docs_site/
selfdrive/pandad/pandad
cereal/services.h
cereal/gen
+112 -1
View File
@@ -1,4 +1,30 @@
sunnypilot Version 2026.001.000 (2026-03-xx)
sunnypilot Version 2026.001.005 (2026-05-13)
========================
* What's Changed (sunnypilot/sunnypilot)
* sunnylink: add CarParams fallback for brand-specific capabilities by @sunnyhaibin
sunnypilot Version 2026.001.004 (2026-05-10)
========================
* What's Changed (sunnypilot/sunnypilot)
* sunnylink: switch athena domain by @DevTekVE
* sunnylink: fix max time offroad values by @nayan8teen
sunnypilot Version 2026.001.003 (2026-05-08)
========================
* What's Changed (sunnypilot/sunnypilot)
* manager: disable DEVELOPMENT_ONLY reset by @sunnyhaibin
sunnypilot Version 2026.001.002 (2026-05-07)
========================
* What's Changed (sunnypilot/sunnypilot)
* release: ignore upstream IsReleaseBranch by @sunnyhaibin
sunnypilot Version 2026.001.001 (2026-05-06)
========================
* What's Changed (sunnypilot/sunnypilot)
* ui: update gates for certain toggles by @sunnyhaibin
sunnypilot Version 2026.001.000 (2026-05-06)
========================
* What's Changed (sunnypilot/sunnypilot)
* Complete rewrite of the user interface from Qt C++ to Raylib Python
@@ -66,6 +92,64 @@ sunnypilot Version 2026.001.000 (2026-03-xx)
* Pause Lateral Control with Blinker: Post-Blinker Delay by @CHaucke89
* SCC-V: Use p97 for predicted lateral accel by @yasu-oh
* Controls: Support for Torque Lateral Control v0 Tune by @sunnyhaibin
* [TIZI/TICI] ui: ensure null checks for `CarParams` and `CarParamsSP` by @sunnyhaibin
* [TIZI/TICI] ui: use `vCruiseCluster` and `vEgoCluster` for SLA `preActive` by @sunnyhaibin
* Fix display of values when using use_float_scaling by @CHaucke89
* models: fix default & index "0" by @nayan8teen
* [TIZI/TICI] visuals: Improved speed limit by @angaz
* ICBM: ensure button timers update on disable to clear stale presses by @jamesmikesell
* [TIZI/TICI] ui: simplify Smart Cruise Control text rendering by @sunnyhaibin
* controlsd: fix steer_limited_by_safety not updating under MADS by @zephleggett
* soundd: trigger timeout warning during MADS lateral-only by @zephleggett
* pandad: flasher for Rivian long upgrade module by @lukasloetkolben
* modeld_v2: tinygrad transformation warp by @Discountchubbs
* tools: block `manage_sunnylinkd` in sim startup script by @sunnyhaibin
* [MICI] ui: need superclass `_render` in `HudRendererSP` by @sunnyhaibin
* [TIZI/TICI] ui: Speed Limit Assist active status by @sunnyhaibin
* ui: reimplement "Screen Off" option to Onroad Brightness by @sunnyhaibin
* ui: don't hide steering wheel when blindspot disabled by @royjr
* ui: Speed Limit Assist `preActive` improvements by @sunnyhaibin
* ui: consolidate Speed Limit Assist `preActive` status rendering by @sunnyhaibin
* [MICI] ui: Speed Limit Assist `preActive` status by @sunnyhaibin
* sunnypilot modeld: remove thneed modeld by @Discountchubbs
* modeld_v2: decouple planplus scaling from accel by @Discountchubbs
* sunnylink: Handle exceptions in `getParamsAllKeysV1` to log crashes by @devtekve
* [TIZI/TICI] ui: Developer UI cleanup by @sunnyhaibin
* [TIZI/TICI] ui: dynamic alert size by @nayan8teen
* i18n(fr): Add French translations by @didlawowo
* Toyota: Stop and Go Hack (Alpha) by @sunnyhaibin
* ui: `AlertFadeAnimator` for longitudinal-related statuses by @sunnyhaibin
* pandad: gate unsupported pandas before flashing by @sunnyhaibin
* Rivian: Flash xnor's Longitudinal Upgrade Kit prior supported panda check by @lukasloetkolben
* [TIZI/TICI] ui: add back gate steering arc behind toggle by @sunnyhaibin
* ui: gate Onroad Brightness Delay on readiness by @sunnyhaibin
* ui: add new timer options for Onroad Brightness Delay by @sunnyhaibin
* [TIZI/TICI] ui: branch switcher is always available by @sunnyhaibin
* pandad: always prioritize internal panda by @sunnyhaibin
* sunnylinkd: fetch compressed params schema by @sunnyhaibin
* sunnypilot locationd: remove unused car_ekf filter by @sunnyhaibin
* modeld_v2: update deprecated temporalPose ref by @sunnyhaibin
* NNLC: restore pre-v1 PID gains in torque extension by @mmmorks
* MADS safety: enable heartbeat and lateral controls mismatch checks by @sunnyhaibin
* [MICI] ui: models panel enhancements by @nayan8teen
* [TIZI/TICI] ui: fix unintended selection while scrolling in TreeOptionDialog by @TheSecurityDev
* tools: script for video concatenation by @Discountchubbs
* tools: profile memory usage by @Discountchubbs
* [TIZI/TICI] ui: remove per-frame param sync by @sunnyhaibin
* [MICI] ui: always offroad by @nayan8teen
* controls: always default Torque Lateral Control to v0 Tune by @sunnyhaibin
* Revert "controls: always default Torque Lateral Control to v0 Tune" by @sunnyhaibin
* Reapply "controls: always default Torque Lateral Control to v0 Tune" (#1806) by @sunnyhaibin
* [MICI] ui: add sunnylink info & connectivity check by @nayan8teen
* sunnylink: Remove unused API endpoint by @devtekve
* DM: wheel touch enforcement in MADS by @sunnyhaibin
* torque: show static override values in Dev UI & gate `useParams` on custom torque tune by @sunnyhaibin
* MADS: suppress espActive event when long is not engaged by @sunnyhaibin
* sunnylink: SDUI by @sunnyhaibin
* [MICI] ui: align upstream changes with sunnypilot settings buttons by @nayan8teen
* ui: fix cellular toggles by @AmyJeanes
* sunnylink: switch athena domain by @devtekve
* Platform List: dynamically migrate CarPlatformBundle by @sunnyhaibin
* What's Changed (sunnypilot/opendbc)
* Honda: DBC for Accord 9th Generation by @mvl-boston
* FCA: update tire stiffness values for `RAM_HD` by @dparring
@@ -84,12 +168,25 @@ sunnypilot Version 2026.001.000 (2026-03-xx)
* Honda: add missing `GasInterceptor` messages to Taiwan Odyssey DBC by @mvl-boston
* GM: remove `CHEVROLET_EQUINOX_NON_ACC_3RD_GEN` from `dashcamOnly` by @sunnyhaibin
* GM: remove `CHEVROLET_BOLT_NON_ACC_2ND_GEN` from `dashcamOnly` by @sunnyhaibin
* Hyundai Longitudinal: deprecate ramp update for dynamic tune by @Discountchubbs
* Rivian: long upgrade messages on bus 1 by @lukasloetkolben
* Toyota: Stop and Go Hack (Alpha) by @sunnyhaibin
* Toyota: gate Smart DSU behind Alpha Longitudinal by @sunnyhaibin
* Toyota: Gas Interceptor always set `standstill_req` by @sunnyhaibin
* MADS safety: dedicated `controls_allowed_lateral` by @sunnyhaibin
* Platform List: include community supported platforms by @sunnyhaibin
* New Contributors (sunnypilot/sunnypilot)
* @TheSecurityDev made their first contribution in "ui: fix sidebar scroll in UI screenshots"
* @zikeji made their first contribution in "sunnylink: block remote modification of SSH key parameters"
* @Candy0707 made their first contribution in "[TIZI/TICI] ui: Fix misaligned turn signals and blindspot indicators with sidebar"
* @CHaucke89 made their first contribution in "Pause Lateral Control with Blinker: Post-Blinker Delay"
* @yasu-oh made their first contribution in "SCC-V: Use p97 for predicted lateral accel"
* @angaz made their first contribution in "[TIZI/TICI] visuals: Improved speed limit"
* @jamesmikesell made their first contribution in "ICBM: ensure button timers update on disable to clear stale presses"
* @zephleggett made their first contribution in "controlsd: fix steer_limited_by_safety not updating under MADS"
* @lukasloetkolben made their first contribution in "pandad: flasher for Rivian long upgrade module"
* @didlawowo made their first contribution in "i18n(fr): Add French translations"
* @mmmorks made their first contribution in "NNLC: restore pre-v1 PID gains in torque extension"
* New Contributors (sunnypilot/opendbc)
* @AmyJeanes made their first contribution in "Tesla: Fix stock LKAS being blocked when MADS is enabled"
* @mvl-boston made their first contribution in "Honda: Update Clarity brake to renamed DBC message name"
@@ -99,6 +196,20 @@ sunnypilot Version 2026.001.000 (2026-03-xx)
* @royjr made their first contribution in "HKG: add KIA_FORTE_2019_NON_SCC fingerprint"
* @ssysm made their first contribution in "Tesla: remove `TESLA_MODEL_X` from `dashcamOnly`"
* Full Changelog: https://github.com/sunnypilot/sunnypilot/compare/v2025.002.000...v2026.001.000
************************
* Synced with commaai's openpilot (v0.11.1)
* master commit c001f3c9b490a80e69539f0af6022f6e07ceb721 (April 16, 2026)
* New driver monitoring model
* Improved image processing pipeline for driver camera
* Rivian R1S and R1T 2025 support thanks to lukasloetkolben!
* New driving model #36798
* Fully trained using a learned simulator
* Improved longitudinal performance in Experimental mode
* Reduce comma four standby power usage by 77% to 52 mW
* Kia K7 2017 support thanks to royjr!
* Lexus LS 2018 support thanks to Hacheoy!
* Improved inter-process communication memory efficiency
* comma four support
sunnypilot Version 2025.002.000 (2025-11-06)
========================
@@ -1,222 +1,256 @@
#!/usr/bin/env python3
"""Schema-level cereal compat check between sunnypilot and upstream openpilot.
Rules (per struct matched across sides by typeId):
R1 shared ordinal must reference the same type.
R2 sunnypilot-only ordinal in a union -> FAIL (unknown discriminant upstream).
R3 sunnypilot-only ordinal on a regular field -> OK (additive struct evolution).
R4 upstream-only ordinal -> OK.
R5 sunnypilot-only struct referenced via an upstream-shared field -> FAIL.
"""
from __future__ import annotations
import argparse
import json
import os
import sys
from typing import Any, List, Tuple
from typing import Any
DEBUG = False
NO_DISCRIMINANT = 0xFFFF
def print_debug(string: str) -> None:
if DEBUG:
print(string)
def hex_id(value: int) -> str:
return f"0x{value:016x}"
def create_schema_instance(struct: Any, prop: Tuple[str, Any]) -> Any:
"""
Create a new instance of a schema type, handling different field types.
Args:
struct: The Cap'n Proto schema structure
prop: A tuple containing the field name and field metadata
Returns:
A new initialized schema instance
"""
struct_instance = struct.new_message()
field_name, field_metadata = prop
try:
field_type = field_metadata.proto.slot.type.which()
# Initialize different types of fields
if field_type in ('list', 'text', 'data'):
struct_instance.init(field_name, 1)
print_debug(f"Initialized list/text/data field: {field_name}")
elif field_type in ('struct', 'object'):
struct_instance.init(field_name)
print_debug(f"Initialized struct/object field: {field_name}")
return struct_instance
except Exception as e:
print(f"Error creating instance for {field_name}: {e}")
return None
def encode_type(type_node: Any) -> dict:
which = type_node.which()
if which == "struct":
return {"kind": "struct", "typeId": hex_id(type_node.struct.typeId)}
if which == "enum":
return {"kind": "enum", "typeId": hex_id(type_node.enum.typeId)}
if which == "interface":
return {"kind": "interface", "typeId": hex_id(type_node.interface.typeId)}
if which == "list":
return {"kind": "list", "element": encode_type(type_node.list.elementType)}
if which == "anyPointer":
return {"kind": "anyPointer"}
return {"kind": which}
def get_schema_fields(schema_struct: Any) -> List[Tuple[str, Any]]:
"""
Retrieve all fields from a given schema structure.
def encode_field(name: str, field: Any) -> dict:
proto = field.proto
ordinal = proto.ordinal.explicit if proto.ordinal.which() == "explicit" else None
discriminant = proto.discriminantValue if proto.discriminantValue != NO_DISCRIMINANT else None
Args:
schema_struct: The Cap'n Proto schema structure
if proto.which() == "group":
type_desc = {"kind": "group", "typeId": hex_id(proto.group.typeId)}
else:
type_desc = encode_type(proto.slot.type)
Returns:
A list of field names and their metadata
"""
try:
# Get all fields from the schema
schema_fields = list(schema_struct.schema.fields.items())
print_debug("Discovered schema fields:")
for field_name, field_metadata in schema_fields:
print_debug(f"- {field_name}")
return schema_fields
except Exception as e:
print(f"Error retrieving schema fields: {e}")
return []
return {
"name": name,
"ordinal": ordinal,
"discriminant": discriminant,
"type": type_desc,
}
def generate_schema_instances(schema_struct: Any) -> List[Any]:
"""
Generate instances for all fields in a given schema.
Args:
schema_struct: The Cap'n Proto schema structure
Returns:
A list of schema instances
"""
schema_fields = get_schema_fields(schema_struct)
instances = []
for field_prop in schema_fields:
try:
instance = create_schema_instance(schema_struct, field_prop)
if instance is not None:
instances.append(instance)
except Exception as e:
print(f"Skipping field due to error: {e}")
print(f"Generated {len(instances)} schema instances")
return instances
def encode_struct(schema: Any) -> dict:
node = schema.node
return {
"typeId": hex_id(node.id),
"displayName": node.displayName,
"hasUnion": node.struct.discriminantCount > 0,
"fields": [encode_field(name, field) for name, field in schema.fields.items()],
}
def persist_instances(instances: List[Any], filename: str) -> None:
"""
Write schema instances to a binary file.
Args:
instances: List of schema instances
filename: Output file path
"""
try:
with open(filename, 'wb') as f:
for instance in instances:
f.write(instance.to_bytes())
print(f"Successfully wrote {len(instances)} instances to {filename}")
except Exception as e:
print(f"Error persisting instances: {e}")
sys.exit(1)
def _child_struct_schema(field: Any) -> Any:
proto = field.proto
if proto.which() == "group":
return field.schema
type_node = proto.slot.type
which = type_node.which()
if which == "struct":
return field.schema
if which == "list":
container = field.schema
element_type = type_node.list.elementType
while element_type.which() == "list":
container = container.elementType
element_type = element_type.list.elementType
if element_type.which() == "struct":
return container.elementType
return None
def read_instances(filename: str, schema_type: Any) -> List[Any]:
"""
Read schema instances from a binary file.
Args:
filename: Input file path
schema_type: The schema type to use for reading
Returns:
A list of read schema instances
"""
try:
with open(filename, 'rb') as f:
data = f.read()
instances = list(schema_type.read_multiple_bytes(data))
print(f"Read {len(instances)} instances from {filename}")
return instances
except Exception as e:
print(f"Error reading instances: {e}")
sys.exit(1)
def collect_schema(root: Any) -> dict[str, dict]:
structs: dict[str, dict] = {}
stack = [root]
while stack:
schema = stack.pop()
type_id = hex_id(schema.node.id)
if type_id in structs:
continue
structs[type_id] = encode_struct(schema)
for _name, field in schema.fields.items():
try:
child = _child_struct_schema(field)
except Exception:
child = None
if child is not None:
stack.append(child)
return structs
def compare_schemas(original_instances: List[Any], read_instances: List[Any]) -> bool:
"""
Compare original and read-back instances to detect potential breaking changes.
def load_log(cereal_dir: str) -> Any:
import capnp
cereal_dir = os.path.abspath(cereal_dir)
capnp.remove_import_hook()
return capnp.load(os.path.join(cereal_dir, "log.capnp"), imports=[cereal_dir])
Args:
original_instances: List of originally generated instances
read_instances: List of instances read back from file
Returns:
Boolean indicating whether schemas appear compatible
"""
if len(original_instances) != len(read_instances):
print("❌ Schema Compatibility Warning: Instance count mismatch")
def dump_schema(cereal_dir: str, path: str) -> None:
log = load_log(cereal_dir)
payload = {
"root": hex_id(log.Event.schema.node.id),
"structs": collect_schema(log.Event.schema),
}
with open(path, "w", encoding="utf-8") as handle:
json.dump(payload, handle, indent=2, sort_keys=True)
print(f"wrote schema dump with {len(payload['structs'])} structs to {path}")
def types_equal(a: dict, b: dict) -> bool:
if a.get("kind") != b.get("kind"):
return False
compatible = True
for struct in read_instances:
try:
getattr(struct, struct.which()) # Attempting to access the field to validate readability
except Exception as e:
print(f"❌ Structural change detected: {struct.which()} is not readable.\nFull error: {e}")
compatible = False
return compatible
kind = a["kind"]
if kind in ("struct", "enum", "interface", "group"):
return a.get("typeId") == b.get("typeId")
if kind == "list":
return types_equal(a["element"], b["element"])
return True
def main():
"""
CLI entry point for schema compatibility testing.
"""
# Setup argument parser
def type_repr(t: dict) -> str:
kind = t.get("kind", "?")
if kind in ("struct", "enum", "interface", "group"):
return f"{kind}({t.get('typeId')})"
if kind == "list":
return f"list<{type_repr(t['element'])}>"
return kind
def field_is_union_variant(field: dict) -> bool:
return field.get("discriminant") is not None
def index_fields_by_ordinal(struct: dict) -> dict[int, dict]:
indexed: dict[int, dict] = {}
for field in struct["fields"]:
ordinal = field.get("ordinal")
if ordinal is None:
continue
indexed[ordinal] = field
return indexed
def compare(sunnypilot_dump: dict, upstream_dump: dict) -> list[str]:
violations: list[str] = []
sunnypilot_structs: dict[str, dict] = sunnypilot_dump["structs"]
upstream_structs: dict[str, dict] = upstream_dump["structs"]
sunnypilot_struct_referenced_from_shared: set[str] = set()
for type_id, sunnypilot_struct in sunnypilot_structs.items():
upstream_struct = upstream_structs.get(type_id)
if upstream_struct is None:
continue
sunnypilot_fields = index_fields_by_ordinal(sunnypilot_struct)
upstream_fields = index_fields_by_ordinal(upstream_struct)
display = sunnypilot_struct["displayName"]
for ordinal, sunnypilot_field in sunnypilot_fields.items():
upstream_field = upstream_fields.get(ordinal)
if upstream_field is None:
if field_is_union_variant(sunnypilot_field):
violations.append(
f"[R2] {display} @{ordinal} ('{sunnypilot_field['name']}', {type_repr(sunnypilot_field['type'])}): "
f"union variant not present upstream. upstream cannot parse this discriminant."
)
continue
if not types_equal(sunnypilot_field["type"], upstream_field["type"]):
violations.append(
f"[R1] {display} @{ordinal}: type mismatch. "
f"sunnypilot='{sunnypilot_field['name']}' {type_repr(sunnypilot_field['type'])} vs "
f"upstream='{upstream_field['name']}' {type_repr(upstream_field['type'])}."
)
continue
cursor = sunnypilot_field["type"]
while cursor.get("kind") == "list":
cursor = cursor["element"]
if cursor.get("kind") in ("struct", "group", "interface") and cursor.get("typeId"):
sunnypilot_struct_referenced_from_shared.add(cursor["typeId"])
for type_id, sunnypilot_struct in sunnypilot_structs.items():
if type_id in upstream_structs:
continue
if type_id in sunnypilot_struct_referenced_from_shared:
violations.append(
f"[R5] struct {sunnypilot_struct['displayName']} ({type_id}) exists only on sunnypilot "
f"but is referenced from an upstream-shared field. upstream cannot resolve this type."
)
return violations
def load_peer(path: str) -> dict:
with open(path, "r", encoding="utf-8") as handle:
return json.load(handle)
def run_read(cereal_dir: str, peer_path: str) -> int:
log = load_log(cereal_dir)
peer_dump = load_peer(peer_path)
local_dump = {
"root": hex_id(log.Event.schema.node.id),
"structs": collect_schema(log.Event.schema),
}
violations = compare(sunnypilot_dump=peer_dump, upstream_dump=local_dump)
if not violations:
print("cereal compat OK: upstream openpilot can parse sunnypilot routes "
"(no leaked structs, no ordinal collisions).")
return 0
print(f"cereal compat FAIL: upstream openpilot would misparse sunnypilot routes "
f"({len(violations)} violation(s)):")
for v in violations:
print(f" {v}")
return 1
def main() -> int:
parser = argparse.ArgumentParser(
description='Cap\'n Proto Schema Compatibility Testing Tool',
epilog='Test schema compatibility by generating and reading back instances.'
description="sunnypilot <-> upstream cereal compatibility validator (schema-level)."
)
# Add mutually exclusive group for generation or reading mode
mode_group = parser.add_mutually_exclusive_group(required=True)
mode_group.add_argument('-g', '--generate', action='store_true',
help='Generate schema instances')
mode_group.add_argument('-r', '--read', action='store_true',
help='Read and validate schema instances')
# Common arguments
parser.add_argument('-f', '--file',
default='schema_instances.bin',
help='Output/input binary file (default: schema_instances.bin)')
# Parse arguments
mode = parser.add_mutually_exclusive_group(required=True)
mode.add_argument("-g", "--generate", action="store_true", help="dump local schema to JSON")
mode.add_argument("-r", "--read", action="store_true", help="load peer JSON and diff against local")
parser.add_argument("-f", "--file", default="schema.json", help="JSON file path (default: schema.json)")
parser.add_argument("--cereal-dir", required=True, help="path to cereal directory containing log.capnp")
args = parser.parse_args()
# Import the schema dynamically
try:
from cereal import log
schema_type = log.Event
except ImportError:
print("Error: Unable to import schema. Ensure 'cereal' is installed.")
sys.exit(1)
# Execute based on mode
if args.generate:
print("🔧 Generating Schema Instances")
instances = generate_schema_instances(schema_type)
persist_instances(instances, args.file)
print("✅ Instance generation complete")
elif args.read:
print("🔍 Reading and Validating Schema Instances")
generated_instances = generate_schema_instances(schema_type)
read_back_instances = read_instances(args.file, schema_type)
# Compare schemas
if compare_schemas(generated_instances, read_back_instances):
print("✅ Schema Compatibility: No breaking changes detected")
sys.exit(0)
else:
print("❌ Potential Schema Breaking Changes Detected")
sys.exit(1)
dump_schema(args.cereal_dir, args.file)
return 0
return run_read(args.cereal_dir, args.file)
if __name__ == "__main__":
main()
sys.exit(main())
+1 -1
View File
@@ -1 +1 @@
#define DEFAULT_MODEL "POP model (Default)"
#define DEFAULT_MODEL "CD210 (Default)"
+1
View File
@@ -204,6 +204,7 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
// sunnylink params
{"EnableSunnylinkUploader", {PERSISTENT | BACKUP, BOOL}},
{"LastSunnylinkPingTime", {CLEAR_ON_MANAGER_START, INT}},
{"ParamsVersion", {PERSISTENT, INT}},
{"SunnylinkCache_Roles", {PERSISTENT, STRING}},
{"SunnylinkCache_Users", {PERSISTENT, STRING}},
{"SunnylinkDongleId", {PERSISTENT, STRING}},
+67 -67
View File
@@ -22,7 +22,7 @@ A supported vehicle is one that just works when you install a comma device. All
|Audi[<sup>11</sup>](#footnotes)|Q3 2019-24|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Audi Q3 2019-24">Buy Here</a></sub></details>|||
|Audi[<sup>11</sup>](#footnotes)|RS3 2018|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Audi RS3 2018">Buy Here</a></sub></details>|||
|Audi[<sup>11</sup>](#footnotes)|S3 2015-17|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Audi S3 2015-17">Buy Here</a></sub></details>|||
|Chevrolet|Bolt EUV 2022-23|Premier or Premier Redline Trim, without Super Cruise Package|openpilot available[<sup>1</sup>](#footnotes)|3 mph|6 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 GM connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Chevrolet Bolt EUV 2022-23">Buy Here</a></sub></details>|<a href="https://youtu.be/xvwzGMUA210" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Chevrolet|Bolt EUV 2022-23|Premier or Premier Redline Trim, without Super Cruise Package|openpilot available[<sup>1</sup>](#footnotes)|3 mph|6 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 GM connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Chevrolet Bolt EUV 2022-23">Buy Here</a></sub></details>|<a href="https://youtu.be/xvwzGMUA210" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Chevrolet|Bolt EV 2022-23|2LT Trim with Adaptive Cruise Control Package|openpilot available[<sup>1</sup>](#footnotes)|3 mph|6 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 GM connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Chevrolet Bolt EV 2022-23">Buy Here</a></sub></details>|||
|Chevrolet|Equinox 2019-22|Adaptive Cruise Control (ACC)|openpilot available[<sup>1</sup>](#footnotes)|3 mph|6 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 GM connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Chevrolet Equinox 2019-22">Buy Here</a></sub></details>|||
|Chevrolet|Silverado 1500 2020-21|Safety Package II|openpilot available[<sup>1</sup>](#footnotes)|0 mph|6 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 GM connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Chevrolet Silverado 1500 2020-21">Buy Here</a></sub></details>|||
@@ -32,34 +32,34 @@ A supported vehicle is one that just works when you install a comma device. All
|Chrysler|Pacifica 2021-23|All|Stock|0 mph|39 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 FCA connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Chrysler Pacifica 2021-23">Buy Here</a></sub></details>|||
|Chrysler|Pacifica Hybrid 2017-18|Adaptive Cruise Control (ACC)|Stock|0 mph|9 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 FCA connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Chrysler Pacifica Hybrid 2017-18">Buy Here</a></sub></details>|||
|Chrysler|Pacifica Hybrid 2019-25|Adaptive Cruise Control (ACC)|Stock|0 mph|39 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 FCA connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Chrysler Pacifica Hybrid 2019-25">Buy Here</a></sub></details>|||
|comma|body|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|None|<a href="https://youtu.be/VT-i3yRsX2s?t=2736" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|comma|body|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|None|<a href="https://youtu.be/VT-i3yRsX2s?t=2736" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|CUPRA[<sup>11</sup>](#footnotes)|Ateca 2018-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=CUPRA Ateca 2018-23">Buy Here</a></sub></details>|||
|Dodge|Durango 2020-21|Adaptive Cruise Control (ACC)|Stock|0 mph|39 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 FCA connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Dodge Durango 2020-21">Buy Here</a></sub></details>|||
|Ford|Bronco Sport 2021-24|Co-Pilot360 Assist+|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Bronco Sport 2021-24">Buy Here</a></sub></details>|||
|Ford|Escape 2020-22|Co-Pilot360 Assist+|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Escape 2020-22">Buy Here</a></sub></details>|||
|Ford|Escape 2023-24|Co-Pilot360 Assist+|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q4 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Escape 2023-24">Buy Here</a></sub></details>||<a href="https://www.youtube.com/watch?v=uUGkH6C_EQU" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Ford|Escape 2023-24|Co-Pilot360 Assist+|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q4 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Escape 2023-24">Buy Here</a></sub></details>||<a href="https://www.youtube.com/watch?v=uUGkH6C_EQU" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>|
|Ford|Escape Hybrid 2020-22|Co-Pilot360 Assist+|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Escape Hybrid 2020-22">Buy Here</a></sub></details>|||
|Ford|Escape Hybrid 2023-24|Co-Pilot360 Assist+|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q4 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Escape Hybrid 2023-24">Buy Here</a></sub></details>||<a href="https://www.youtube.com/watch?v=uUGkH6C_EQU" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Ford|Escape Hybrid 2023-24|Co-Pilot360 Assist+|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q4 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Escape Hybrid 2023-24">Buy Here</a></sub></details>||<a href="https://www.youtube.com/watch?v=uUGkH6C_EQU" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>|
|Ford|Escape Plug-in Hybrid 2020-22|Co-Pilot360 Assist+|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Escape Plug-in Hybrid 2020-22">Buy Here</a></sub></details>|||
|Ford|Escape Plug-in Hybrid 2023-24|Co-Pilot360 Assist+|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q4 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Escape Plug-in Hybrid 2023-24">Buy Here</a></sub></details>||<a href="https://www.youtube.com/watch?v=uUGkH6C_EQU" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Ford|Expedition 2022-24|Co-Pilot360 Assist 2.0|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q4 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Expedition 2022-24">Buy Here</a></sub></details>||<a href="https://www.youtube.com/watch?v=MewJc9LYp9M" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Ford|Escape Plug-in Hybrid 2023-24|Co-Pilot360 Assist+|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q4 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Escape Plug-in Hybrid 2023-24">Buy Here</a></sub></details>||<a href="https://www.youtube.com/watch?v=uUGkH6C_EQU" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>|
|Ford|Expedition 2022-24|Co-Pilot360 Assist 2.0|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q4 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Expedition 2022-24">Buy Here</a></sub></details>||<a href="https://www.youtube.com/watch?v=MewJc9LYp9M" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>|
|Ford|Explorer 2020-24|Co-Pilot360 Assist+|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Explorer 2020-24">Buy Here</a></sub></details>|||
|Ford|Explorer Hybrid 2020-24|Co-Pilot360 Assist+|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Explorer Hybrid 2020-24">Buy Here</a></sub></details>|||
|Ford|F-150 2021-23|Co-Pilot360 Assist 2.0|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q4 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford F-150 2021-23">Buy Here</a></sub></details>||<a href="https://www.youtube.com/watch?v=MewJc9LYp9M" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Ford|F-150 Hybrid 2021-23|Co-Pilot360 Assist 2.0|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q4 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford F-150 Hybrid 2021-23">Buy Here</a></sub></details>||<a href="https://www.youtube.com/watch?v=MewJc9LYp9M" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Ford|F-150 2021-23|Co-Pilot360 Assist 2.0|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q4 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford F-150 2021-23">Buy Here</a></sub></details>||<a href="https://www.youtube.com/watch?v=MewJc9LYp9M" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>|
|Ford|F-150 Hybrid 2021-23|Co-Pilot360 Assist 2.0|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q4 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford F-150 Hybrid 2021-23">Buy Here</a></sub></details>||<a href="https://www.youtube.com/watch?v=MewJc9LYp9M" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>|
|Ford|Focus 2018[<sup>2</sup>](#footnotes)|Adaptive Cruise Control with Lane Centering|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Focus 2018">Buy Here</a></sub></details>|||
|Ford|Focus Hybrid 2018[<sup>2</sup>](#footnotes)|Adaptive Cruise Control with Lane Centering|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Focus Hybrid 2018">Buy Here</a></sub></details>|||
|Ford|Kuga 2020-23|Adaptive Cruise Control with Lane Centering|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Kuga 2020-23">Buy Here</a></sub></details>|||
|Ford|Kuga Hybrid 2020-23|Adaptive Cruise Control with Lane Centering|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Kuga Hybrid 2020-23">Buy Here</a></sub></details>|||
|Ford|Kuga Hybrid 2024|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q4 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Kuga Hybrid 2024">Buy Here</a></sub></details>||<a href="https://www.youtube.com/watch?v=uUGkH6C_EQU" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Ford|Kuga Hybrid 2024|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q4 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Kuga Hybrid 2024">Buy Here</a></sub></details>||<a href="https://www.youtube.com/watch?v=uUGkH6C_EQU" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>|
|Ford|Kuga Plug-in Hybrid 2020-23|Adaptive Cruise Control with Lane Centering|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Kuga Plug-in Hybrid 2020-23">Buy Here</a></sub></details>|||
|Ford|Kuga Plug-in Hybrid 2024|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q4 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Kuga Plug-in Hybrid 2024">Buy Here</a></sub></details>||<a href="https://www.youtube.com/watch?v=uUGkH6C_EQU" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Ford|Kuga Plug-in Hybrid 2024|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q4 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Kuga Plug-in Hybrid 2024">Buy Here</a></sub></details>||<a href="https://www.youtube.com/watch?v=uUGkH6C_EQU" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>|
|Ford|Maverick 2022|LARIAT Luxury|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Maverick 2022">Buy Here</a></sub></details>|||
|Ford|Maverick 2023-24|Co-Pilot360 Assist|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Maverick 2023-24">Buy Here</a></sub></details>|||
|Ford|Maverick Hybrid 2022|LARIAT Luxury|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Maverick Hybrid 2022">Buy Here</a></sub></details>|||
|Ford|Maverick Hybrid 2023-24|Co-Pilot360 Assist|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Maverick Hybrid 2023-24">Buy Here</a></sub></details>|||
|Ford|Mustang Mach-E 2021-24|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q4 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Mustang Mach-E 2021-24">Buy Here</a></sub></details>||<a href="https://www.youtube.com/watch?v=uUGkH6C_EQU" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Ford|Ranger 2024|Adaptive Cruise Control with Lane Centering|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q4 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Ranger 2024">Buy Here</a></sub></details>||<a href="https://www.youtube.com/watch?v=uUGkH6C_EQU" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Ford|Mustang Mach-E 2021-24|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q4 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Mustang Mach-E 2021-24">Buy Here</a></sub></details>||<a href="https://www.youtube.com/watch?v=uUGkH6C_EQU" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>|
|Ford|Ranger 2024|Adaptive Cruise Control with Lane Centering|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q4 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ford Ranger 2024">Buy Here</a></sub></details>||<a href="https://www.youtube.com/watch?v=uUGkH6C_EQU" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>|
|Genesis|G70 2018|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai F connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Genesis G70 2018">Buy Here</a></sub></details>|||
|Genesis|G70 2019-21|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai F connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Genesis G70 2019-21">Buy Here</a></sub></details>|||
|Genesis|G70 2022-23|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai L connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Genesis G70 2022-23">Buy Here</a></sub></details>|||
@@ -74,18 +74,18 @@ A supported vehicle is one that just works when you install a comma device. All
|Genesis|GV70 Electrified (Australia Only) 2022|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai Q connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Genesis GV70 Electrified (Australia Only) 2022">Buy Here</a></sub></details>|||
|Genesis|GV70 Electrified (with HDA II) 2023-24|Highway Driving Assist II|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai Q connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Genesis GV70 Electrified (with HDA II) 2023-24">Buy Here</a></sub></details>|||
|Genesis|GV80 2023|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai M connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Genesis GV80 2023">Buy Here</a></sub></details>|||
|GMC|Sierra 1500 2020-21|Driver Alert Package II|openpilot available[<sup>1</sup>](#footnotes)|0 mph|6 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 GM connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=GMC Sierra 1500 2020-21">Buy Here</a></sub></details>|<a href="https://youtu.be/5HbNoBLzRwE" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Honda|Accord 2018-22|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|3 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch A connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Honda Accord 2018-22">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=mrUwlj3Mi58" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|GMC|Sierra 1500 2020-21|Driver Alert Package II|openpilot available[<sup>1</sup>](#footnotes)|0 mph|6 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 GM connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=GMC Sierra 1500 2020-21">Buy Here</a></sub></details>|<a href="https://youtu.be/5HbNoBLzRwE" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Honda|Accord 2018-22|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|3 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch A connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Honda Accord 2018-22">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=mrUwlj3Mi58" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Honda|Accord 2023-25|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch C connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Honda Accord 2023-25">Buy Here</a></sub></details>|||
|Honda|Accord Hybrid 2018-22|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|3 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch A connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Honda Accord Hybrid 2018-22">Buy Here</a></sub></details>|||
|Honda|Accord Hybrid 2023-25|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch C connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Honda Accord Hybrid 2023-25">Buy Here</a></sub></details>|||
|Honda|City (Brazil only) 2023|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|14 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch B connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Honda City (Brazil only) 2023">Buy Here</a></sub></details>|||
|Honda|Civic 2016-18|Honda Sensing|openpilot|0 mph|12 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Nidec connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Honda Civic 2016-18">Buy Here</a></sub></details>|<a href="https://youtu.be/-IkImTe1NYE" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Honda|Civic 2019-21|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|2 mph[<sup>4</sup>](#footnotes)|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch A connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Honda Civic 2019-21">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=4Iz1Mz5LGF8" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Honda|Civic 2022-24|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch B connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Honda Civic 2022-24">Buy Here</a></sub></details>|<a href="https://youtu.be/ytiOT5lcp6Q" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Honda|Civic 2016-18|Honda Sensing|openpilot|0 mph|12 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Nidec connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Honda Civic 2016-18">Buy Here</a></sub></details>|<a href="https://youtu.be/-IkImTe1NYE" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Honda|Civic 2019-21|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|2 mph[<sup>4</sup>](#footnotes)|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch A connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Honda Civic 2019-21">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=4Iz1Mz5LGF8" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Honda|Civic 2022-24|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch B connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Honda Civic 2022-24">Buy Here</a></sub></details>|<a href="https://youtu.be/ytiOT5lcp6Q" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Honda|Civic Hatchback 2017-18|Honda Sensing|openpilot available[<sup>1</sup>](#footnotes)|0 mph|12 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch A connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Honda Civic Hatchback 2017-18">Buy Here</a></sub></details>|||
|Honda|Civic Hatchback 2019-21|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|12 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch A connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Honda Civic Hatchback 2019-21">Buy Here</a></sub></details>|||
|Honda|Civic Hatchback 2022-24|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch B connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Honda Civic Hatchback 2022-24">Buy Here</a></sub></details>|<a href="https://youtu.be/ytiOT5lcp6Q" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Honda|Civic Hatchback 2022-24|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch B connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Honda Civic Hatchback 2022-24">Buy Here</a></sub></details>|<a href="https://youtu.be/ytiOT5lcp6Q" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Honda|Civic Hatchback Hybrid 2025-26|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch B connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Honda Civic Hatchback Hybrid 2025-26">Buy Here</a></sub></details>|||
|Honda|Civic Hatchback Hybrid (Europe only) 2023|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch B connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Honda Civic Hatchback Hybrid (Europe only) 2023">Buy Here</a></sub></details>|||
|Honda|Civic Hybrid 2025-26|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch B connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Honda Civic Hybrid 2025-26">Buy Here</a></sub></details>|||
@@ -117,9 +117,9 @@ A supported vehicle is one that just works when you install a comma device. All
|Hyundai|Custin 2023|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai K connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Custin 2023">Buy Here</a></sub></details>|||
|Hyundai|Elantra 2017-18|Smart Cruise Control (SCC)|Stock|19 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai B connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Elantra 2017-18">Buy Here</a></sub></details>|||
|Hyundai|Elantra 2019|Smart Cruise Control (SCC)|Stock|19 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai G connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Elantra 2019">Buy Here</a></sub></details>|||
|Hyundai|Elantra 2021-23|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai K connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Elantra 2021-23">Buy Here</a></sub></details>|<a href="https://youtu.be/_EdYQtV52-c" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Hyundai|Elantra 2021-23|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai K connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Elantra 2021-23">Buy Here</a></sub></details>|<a href="https://youtu.be/_EdYQtV52-c" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Hyundai|Elantra GT 2017-20|Smart Cruise Control (SCC)|Stock|0 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai E connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Elantra GT 2017-20">Buy Here</a></sub></details>|||
|Hyundai|Elantra Hybrid 2021-23|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai K connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Elantra Hybrid 2021-23">Buy Here</a></sub></details>|<a href="https://youtu.be/_EdYQtV52-c" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Hyundai|Elantra Hybrid 2021-23|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai K connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Elantra Hybrid 2021-23">Buy Here</a></sub></details>|<a href="https://youtu.be/_EdYQtV52-c" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Hyundai|Genesis 2015-16|Smart Cruise Control (SCC)|Stock|19 mph|37 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai J connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Genesis 2015-16">Buy Here</a></sub></details>|||
|Hyundai|i30 2017-19|Smart Cruise Control (SCC)|Stock|0 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai E connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai i30 2017-19">Buy Here</a></sub></details>|||
|Hyundai|Ioniq 5 (Southeast Asia and Europe only) 2022-24|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai Q connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Ioniq 5 (Southeast Asia and Europe only) 2022-24">Buy Here</a></sub></details>|||
@@ -136,17 +136,17 @@ A supported vehicle is one that just works when you install a comma device. All
|Hyundai|Kona 2022-23|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai O connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Kona 2022-23">Buy Here</a></sub></details>|||
|Hyundai|Kona Electric 2018-21|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai G connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Kona Electric 2018-21">Buy Here</a></sub></details>|||
|Hyundai|Kona Electric 2022-23|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai O connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Kona Electric 2022-23">Buy Here</a></sub></details>|||
|Hyundai|Kona Electric (with HDA II, Korea only) 2023|Smart Cruise Control (SCC)|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai R connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Kona Electric (with HDA II, Korea only) 2023">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=U2fOCmcQ8hw" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Hyundai|Kona Electric (with HDA II, Korea only) 2023|Smart Cruise Control (SCC)|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai R connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Kona Electric (with HDA II, Korea only) 2023">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=U2fOCmcQ8hw" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Hyundai|Kona Hybrid 2020|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai I connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Kona Hybrid 2020">Buy Here</a></sub></details>|||
|Hyundai|Nexo 2021|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai H connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Nexo 2021">Buy Here</a></sub></details>|||
|Hyundai|Palisade 2020-22|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai H connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Palisade 2020-22">Buy Here</a></sub></details>|<a href="https://youtu.be/TAnDqjF4fDY?t=456" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Hyundai|Palisade 2020-22|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai H connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Palisade 2020-22">Buy Here</a></sub></details>|<a href="https://youtu.be/TAnDqjF4fDY?t=456" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Hyundai|Santa Cruz 2022-24|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai N connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Santa Cruz 2022-24">Buy Here</a></sub></details>|||
|Hyundai|Santa Fe 2019-20|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai D connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Santa Fe 2019-20">Buy Here</a></sub></details>|<a href="https://youtu.be/bjDR0YjM__s" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Hyundai|Santa Fe 2021-23|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai L connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Santa Fe 2021-23">Buy Here</a></sub></details>|<a href="https://youtu.be/VnHzSTygTS4" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Hyundai|Santa Fe 2019-20|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai D connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Santa Fe 2019-20">Buy Here</a></sub></details>|<a href="https://youtu.be/bjDR0YjM__s" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Hyundai|Santa Fe 2021-23|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai L connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Santa Fe 2021-23">Buy Here</a></sub></details>|<a href="https://youtu.be/VnHzSTygTS4" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Hyundai|Santa Fe Hybrid 2022-23|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai L connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Santa Fe Hybrid 2022-23">Buy Here</a></sub></details>|||
|Hyundai|Santa Fe Plug-in Hybrid 2022-23|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai L connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Santa Fe Plug-in Hybrid 2022-23">Buy Here</a></sub></details>|||
|Hyundai|Sonata 2018-19|Smart Cruise Control (SCC)|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai E connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Sonata 2018-19">Buy Here</a></sub></details>|||
|Hyundai|Sonata 2020-23|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai A connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Sonata 2020-23">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=ix63r9kE3Fw" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Hyundai|Sonata 2020-23|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai A connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Sonata 2020-23">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=ix63r9kE3Fw" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Hyundai|Sonata Hybrid 2020-23|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai A connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Sonata Hybrid 2020-23">Buy Here</a></sub></details>|||
|Hyundai|Staria 2023|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai K connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Staria 2023">Buy Here</a></sub></details>|||
|Hyundai|Tucson 2021|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai L connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Tucson 2021">Buy Here</a></sub></details>|||
@@ -156,8 +156,8 @@ A supported vehicle is one that just works when you install a comma device. All
|Hyundai|Tucson Hybrid 2022-24|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai N connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Tucson Hybrid 2022-24">Buy Here</a></sub></details>|||
|Hyundai|Tucson Plug-in Hybrid 2024|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai N connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Tucson Plug-in Hybrid 2024">Buy Here</a></sub></details>|||
|Hyundai|Veloster 2019-20|Smart Cruise Control (SCC)|Stock|5 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai E connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Hyundai Veloster 2019-20">Buy Here</a></sub></details>|||
|Jeep|Grand Cherokee 2016-18|Adaptive Cruise Control (ACC)|Stock|0 mph|9 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 FCA connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Jeep Grand Cherokee 2016-18">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=eLR9o2JkuRk" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Jeep|Grand Cherokee 2019-21|Adaptive Cruise Control (ACC)|Stock|0 mph|39 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 FCA connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Jeep Grand Cherokee 2019-21">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=jBe4lWnRSu4" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Jeep|Grand Cherokee 2016-18|Adaptive Cruise Control (ACC)|Stock|0 mph|9 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 FCA connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Jeep Grand Cherokee 2016-18">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=eLR9o2JkuRk" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Jeep|Grand Cherokee 2019-21|Adaptive Cruise Control (ACC)|Stock|0 mph|39 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 FCA connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Jeep Grand Cherokee 2019-21">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=jBe4lWnRSu4" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Kia|Carnival 2022-24|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai A connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Carnival 2022-24">Buy Here</a></sub></details>|||
|Kia|Carnival (China only) 2023|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai K connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Carnival (China only) 2023">Buy Here</a></sub></details>|||
|Kia|Ceed 2019-21|Smart Cruise Control (SCC)|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai E connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Ceed 2019-21">Buy Here</a></sub></details>|||
@@ -170,10 +170,10 @@ A supported vehicle is one that just works when you install a comma device. All
|Kia|K5 Hybrid 2020-22|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai A connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia K5 Hybrid 2020-22">Buy Here</a></sub></details>|||
|Kia|K7 2017|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai C connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia K7 2017">Buy Here</a></sub></details>|||
|Kia|K8 Hybrid (with HDA II) 2023|Highway Driving Assist II|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai Q connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia K8 Hybrid (with HDA II) 2023">Buy Here</a></sub></details>|||
|Kia|Niro EV 2019|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai H connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Niro EV 2019">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=lT7zcG6ZpGo" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Kia|Niro EV 2020|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai F connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Niro EV 2020">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=lT7zcG6ZpGo" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Kia|Niro EV 2021|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai C connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Niro EV 2021">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=lT7zcG6ZpGo" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Kia|Niro EV 2022|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai H connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Niro EV 2022">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=lT7zcG6ZpGo" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Kia|Niro EV 2019|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai H connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Niro EV 2019">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=lT7zcG6ZpGo" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Kia|Niro EV 2020|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai F connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Niro EV 2020">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=lT7zcG6ZpGo" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Kia|Niro EV 2021|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai C connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Niro EV 2021">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=lT7zcG6ZpGo" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Kia|Niro EV 2022|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai H connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Niro EV 2022">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=lT7zcG6ZpGo" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Kia|Niro EV (with HDA II) 2024-25|Highway Driving Assist II|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai R connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Niro EV (with HDA II) 2024-25">Buy Here</a></sub></details>|||
|Kia|Niro EV (without HDA II) 2023-25|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai A connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Niro EV (without HDA II) 2023-25">Buy Here</a></sub></details>|||
|Kia|Niro Hybrid 2018|Smart Cruise Control (SCC)|Stock|10 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai C connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Niro Hybrid 2018">Buy Here</a></sub></details>|||
@@ -188,21 +188,21 @@ A supported vehicle is one that just works when you install a comma device. All
|Kia|Optima 2019-20|Smart Cruise Control (SCC)|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai G connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Optima 2019-20">Buy Here</a></sub></details>|||
|Kia|Optima Hybrid 2019|Smart Cruise Control (SCC)|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai H connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Optima Hybrid 2019">Buy Here</a></sub></details>|||
|Kia|Seltos 2021|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai A connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Seltos 2021">Buy Here</a></sub></details>|||
|Kia|Sorento 2018|Advanced Smart Cruise Control & LKAS|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai E connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Sorento 2018">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=Fkh3s6WHJz8" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Kia|Sorento 2019|Smart Cruise Control (SCC)|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai E connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Sorento 2019">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=Fkh3s6WHJz8" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Kia|Sorento 2018|Advanced Smart Cruise Control & LKAS|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai E connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Sorento 2018">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=Fkh3s6WHJz8" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Kia|Sorento 2019|Smart Cruise Control (SCC)|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai E connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Sorento 2019">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=Fkh3s6WHJz8" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Kia|Sorento 2021-23|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai K connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Sorento 2021-23">Buy Here</a></sub></details>|||
|Kia|Sorento Hybrid 2021-23|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai A connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Sorento Hybrid 2021-23">Buy Here</a></sub></details>|||
|Kia|Sorento Plug-in Hybrid 2022-23|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai A connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Sorento Plug-in Hybrid 2022-23">Buy Here</a></sub></details>|||
|Kia|Sportage 2023-24|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai N connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Sportage 2023-24">Buy Here</a></sub></details>|||
|Kia|Sportage Hybrid 2023|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai N connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Sportage Hybrid 2023">Buy Here</a></sub></details>|||
|Kia|Stinger 2018-20|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai C connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Stinger 2018-20">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=MJ94qoofYw0" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Kia|Stinger 2018-20|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai C connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Stinger 2018-20">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=MJ94qoofYw0" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Kia|Stinger 2022-23|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai K connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Stinger 2022-23">Buy Here</a></sub></details>|||
|Kia|Telluride 2020-22|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai H connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Kia Telluride 2020-22">Buy Here</a></sub></details>|||
|Lexus|CT Hybrid 2017-18|Lexus Safety System+|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Lexus CT Hybrid 2017-18">Buy Here</a></sub></details>|||
|Lexus|ES 2017-18|All|Stock|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Lexus ES 2017-18">Buy Here</a></sub></details>|||
|Lexus|ES 2019-25|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Lexus ES 2019-25">Buy Here</a></sub></details>|||
|Lexus|ES Hybrid 2017-18|All|Stock|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Lexus ES Hybrid 2017-18">Buy Here</a></sub></details>|||
|Lexus|ES Hybrid 2019-25|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Lexus ES Hybrid 2019-25">Buy Here</a></sub></details>|<a href="https://youtu.be/BZ29osRVJeg?t=12" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Lexus|ES Hybrid 2019-25|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Lexus ES Hybrid 2019-25">Buy Here</a></sub></details>|<a href="https://youtu.be/BZ29osRVJeg?t=12" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Lexus|GS F 2016|All|Stock|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Lexus GS F 2016">Buy Here</a></sub></details>|||
|Lexus|IS 2017-19|All|Stock|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Lexus IS 2017-19">Buy Here</a></sub></details>|||
|Lexus|IS 2022-24|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Lexus IS 2022-24">Buy Here</a></sub></details>|||
@@ -223,25 +223,25 @@ A supported vehicle is one that just works when you install a comma device. All
|Lexus|UX Hybrid 2019-24|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Lexus UX Hybrid 2019-24">Buy Here</a></sub></details>|||
|Lincoln|Aviator 2020-24|Co-Pilot360 Plus|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Lincoln Aviator 2020-24">Buy Here</a></sub></details>|||
|Lincoln|Aviator Plug-in Hybrid 2020-24|Co-Pilot360 Plus|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Lincoln Aviator Plug-in Hybrid 2020-24">Buy Here</a></sub></details>|||
|MAN[<sup>11</sup>](#footnotes)|eTGE 2020-24|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|31 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=MAN eTGE 2020-24">Buy Here</a></sub></details>|<a href="https://youtu.be/4100gLeabmo" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|MAN[<sup>11</sup>](#footnotes)|TGE 2017-24|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|31 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=MAN TGE 2017-24">Buy Here</a></sub></details>|<a href="https://youtu.be/4100gLeabmo" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|MAN[<sup>11</sup>](#footnotes)|eTGE 2020-24|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|31 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=MAN eTGE 2020-24">Buy Here</a></sub></details>|<a href="https://youtu.be/4100gLeabmo" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|MAN[<sup>11</sup>](#footnotes)|TGE 2017-24|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|31 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=MAN TGE 2017-24">Buy Here</a></sub></details>|<a href="https://youtu.be/4100gLeabmo" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Mazda|CX-5 2022-25|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Mazda connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Mazda CX-5 2022-25">Buy Here</a></sub></details>|||
|Mazda|CX-9 2021-23|All|Stock|0 mph|28 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Mazda connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Mazda CX-9 2021-23">Buy Here</a></sub></details>|<a href="https://youtu.be/dA3duO4a0O4" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Mazda|CX-9 2021-23|All|Stock|0 mph|28 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Mazda connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Mazda CX-9 2021-23">Buy Here</a></sub></details>|<a href="https://youtu.be/dA3duO4a0O4" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Nissan[<sup>5</sup>](#footnotes)|Altima 2019-20, 2024|ProPILOT Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 Nissan B connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Nissan Altima 2019-20, 2024">Buy Here</a></sub></details>|||
|Nissan[<sup>5</sup>](#footnotes)|Leaf 2018-23|ProPILOT Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 Nissan A connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Nissan Leaf 2018-23">Buy Here</a></sub></details>|<a href="https://youtu.be/vaMbtAh_0cY" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Nissan[<sup>5</sup>](#footnotes)|Leaf 2018-23|ProPILOT Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 Nissan A connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Nissan Leaf 2018-23">Buy Here</a></sub></details>|<a href="https://youtu.be/vaMbtAh_0cY" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Nissan[<sup>5</sup>](#footnotes)|Rogue 2018-20|ProPILOT Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 Nissan A connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Nissan Rogue 2018-20">Buy Here</a></sub></details>|||
|Nissan[<sup>5</sup>](#footnotes)|X-Trail 2017|ProPILOT Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 Nissan A connector<br>- 1 OBD-C cable (2 ft)<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Nissan X-Trail 2017">Buy Here</a></sub></details>|||
|Ram|1500 2019-24|Adaptive Cruise Control (ACC)|Stock|32 mph|1 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Ram connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ram 1500 2019-24">Buy Here</a></sub></details>|||
|Ram|2500 2020-24|Adaptive Cruise Control (ACC)|Stock|0 mph|36 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Ram connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ram 2500 2020-24">Buy Here</a></sub></details>|||
|Ram|3500 2019-22|Adaptive Cruise Control (ACC)|Stock|0 mph|36 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Ram connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Ram 3500 2019-22">Buy Here</a></sub></details>|||
|Rivian|R1S 2022-24|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Rivian A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Rivian R1S 2022-24">Buy Here</a></sub></details>||<a href="https://youtu.be/uaISd1j7Z4U" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Rivian|R1S 2022-24|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Rivian A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Rivian R1S 2022-24">Buy Here</a></sub></details>||<a href="https://youtu.be/uaISd1j7Z4U" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>|
|Rivian|R1S 2025|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Rivian B connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Rivian R1S 2025">Buy Here</a></sub></details>|||
|Rivian|R1T 2022-24|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Rivian A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Rivian R1T 2022-24">Buy Here</a></sub></details>||<a href="https://youtu.be/uaISd1j7Z4U" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Rivian|R1T 2022-24|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Rivian A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Rivian R1T 2022-24">Buy Here</a></sub></details>||<a href="https://youtu.be/uaISd1j7Z4U" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>|
|Rivian|R1T 2025|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Rivian B connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Rivian R1T 2025">Buy Here</a></sub></details>|||
|SEAT[<sup>11</sup>](#footnotes)|Ateca 2016-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=SEAT Ateca 2016-23">Buy Here</a></sub></details>|||
|SEAT[<sup>11</sup>](#footnotes)|Leon 2014-20|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=SEAT Leon 2014-20">Buy Here</a></sub></details>|||
|Subaru|Ascent 2019-21|All[<sup>6</sup>](#footnotes)|openpilot available[<sup>1,7</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Subaru A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Subaru Ascent 2019-21">Buy Here</a></sub></details><details><summary>Tools</summary><sub>- 1 Pry Tool<br>- 1 Socket Wrench 8mm or 5/16" (deep)</sub></details>|||
|Subaru|Crosstrek 2018-19|EyeSight Driver Assistance[<sup>6</sup>](#footnotes)|openpilot available[<sup>1,7</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Subaru A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Subaru Crosstrek 2018-19">Buy Here</a></sub></details><details><summary>Tools</summary><sub>- 1 Pry Tool<br>- 1 Socket Wrench 8mm or 5/16" (deep)</sub></details>|<a href="https://youtu.be/Agww7oE1k-s?t=26" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Subaru|Crosstrek 2018-19|EyeSight Driver Assistance[<sup>6</sup>](#footnotes)|openpilot available[<sup>1,7</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Subaru A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Subaru Crosstrek 2018-19">Buy Here</a></sub></details><details><summary>Tools</summary><sub>- 1 Pry Tool<br>- 1 Socket Wrench 8mm or 5/16" (deep)</sub></details>|<a href="https://youtu.be/Agww7oE1k-s?t=26" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Subaru|Crosstrek 2020-23|EyeSight Driver Assistance[<sup>6</sup>](#footnotes)|openpilot available[<sup>1,7</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Subaru A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Subaru Crosstrek 2020-23">Buy Here</a></sub></details><details><summary>Tools</summary><sub>- 1 Pry Tool<br>- 1 Socket Wrench 8mm or 5/16" (deep)</sub></details>|||
|Subaru|Forester 2017-18|EyeSight Driver Assistance[<sup>6</sup>](#footnotes)|Stock|0 mph|0 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Subaru A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Subaru Forester 2017-18">Buy Here</a></sub></details><details><summary>Tools</summary><sub>- 1 Pry Tool<br>- 1 Socket Wrench 8mm or 5/16" (deep)</sub></details>|||
|Subaru|Forester 2019-21|All[<sup>6</sup>](#footnotes)|openpilot available[<sup>1,7</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Subaru A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Subaru Forester 2019-21">Buy Here</a></sub></details><details><summary>Tools</summary><sub>- 1 Pry Tool<br>- 1 Socket Wrench 8mm or 5/16" (deep)</sub></details>|||
@@ -252,7 +252,7 @@ A supported vehicle is one that just works when you install a comma device. All
|Subaru|Outback 2015-17|EyeSight Driver Assistance[<sup>6</sup>](#footnotes)|Stock|0 mph|0 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Subaru A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Subaru Outback 2015-17">Buy Here</a></sub></details><details><summary>Tools</summary><sub>- 1 Pry Tool<br>- 1 Socket Wrench 8mm or 5/16" (deep)</sub></details>|||
|Subaru|Outback 2018-19|EyeSight Driver Assistance[<sup>6</sup>](#footnotes)|Stock|0 mph|0 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Subaru A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Subaru Outback 2018-19">Buy Here</a></sub></details><details><summary>Tools</summary><sub>- 1 Pry Tool<br>- 1 Socket Wrench 8mm or 5/16" (deep)</sub></details>|||
|Subaru|Outback 2020-22|All[<sup>6</sup>](#footnotes)|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Subaru B connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Subaru Outback 2020-22">Buy Here</a></sub></details><details><summary>Tools</summary><sub>- 1 Pry Tool<br>- 1 Socket Wrench 8mm or 5/16" (deep)</sub></details>|||
|Subaru|XV 2018-19|EyeSight Driver Assistance[<sup>6</sup>](#footnotes)|openpilot available[<sup>1,7</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Subaru A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Subaru XV 2018-19">Buy Here</a></sub></details><details><summary>Tools</summary><sub>- 1 Pry Tool<br>- 1 Socket Wrench 8mm or 5/16" (deep)</sub></details>|<a href="https://youtu.be/Agww7oE1k-s?t=26" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Subaru|XV 2018-19|EyeSight Driver Assistance[<sup>6</sup>](#footnotes)|openpilot available[<sup>1,7</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Subaru A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Subaru XV 2018-19">Buy Here</a></sub></details><details><summary>Tools</summary><sub>- 1 Pry Tool<br>- 1 Socket Wrench 8mm or 5/16" (deep)</sub></details>|<a href="https://youtu.be/Agww7oE1k-s?t=26" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Subaru|XV 2020-21|EyeSight Driver Assistance[<sup>6</sup>](#footnotes)|openpilot available[<sup>1,7</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Subaru A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Subaru XV 2020-21">Buy Here</a></sub></details><details><summary>Tools</summary><sub>- 1 Pry Tool<br>- 1 Socket Wrench 8mm or 5/16" (deep)</sub></details>|||
|Škoda|Fabia 2022-23[<sup>14</sup>](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Škoda Fabia 2022-23">Buy Here</a></sub></details>[<sup>16</sup>](#footnotes)|||
|Škoda|Kamiq 2021-23[<sup>12,14</sup>](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Škoda Kamiq 2021-23">Buy Here</a></sub></details>[<sup>16</sup>](#footnotes)|||
@@ -279,50 +279,50 @@ A supported vehicle is one that just works when you install a comma device. All
|Toyota|C-HR 2021|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota C-HR 2021">Buy Here</a></sub></details>|||
|Toyota|C-HR Hybrid 2017-20|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota C-HR Hybrid 2017-20">Buy Here</a></sub></details>|||
|Toyota|C-HR Hybrid 2021-22|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota C-HR Hybrid 2021-22">Buy Here</a></sub></details>|||
|Toyota|Camry 2018-20|All|Stock|0 mph[<sup>10</sup>](#footnotes)|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Camry 2018-20">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=fkcjviZY9CM" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Toyota|Camry 2018-20|All|Stock|0 mph[<sup>10</sup>](#footnotes)|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Camry 2018-20">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=fkcjviZY9CM" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Toyota|Camry 2021-24|All|openpilot|0 mph[<sup>10</sup>](#footnotes)|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Camry 2021-24">Buy Here</a></sub></details>|||
|Toyota|Camry Hybrid 2018-20|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Camry Hybrid 2018-20">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=Q2DYY0AWKgk" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Toyota|Camry Hybrid 2018-20|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Camry Hybrid 2018-20">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=Q2DYY0AWKgk" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Toyota|Camry Hybrid 2021-24|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Camry Hybrid 2021-24">Buy Here</a></sub></details>|||
|Toyota|Corolla 2017-19|All|Stock|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Corolla 2017-19">Buy Here</a></sub></details>|||
|Toyota|Corolla 2020-22|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Corolla 2020-22">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=_66pXk0CBYA" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Toyota|Corolla 2020-22|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Corolla 2020-22">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=_66pXk0CBYA" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Toyota|Corolla Cross (Non-US only) 2020-23|All|openpilot|17 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Corolla Cross (Non-US only) 2020-23">Buy Here</a></sub></details>|||
|Toyota|Corolla Cross Hybrid (Non-US only) 2020-22|All|openpilot|17 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Corolla Cross Hybrid (Non-US only) 2020-22">Buy Here</a></sub></details>|||
|Toyota|Corolla Hatchback 2019-22|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Corolla Hatchback 2019-22">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=_66pXk0CBYA" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Toyota|Corolla Hatchback 2019-22|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Corolla Hatchback 2019-22">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=_66pXk0CBYA" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Toyota|Corolla Hybrid 2020-22|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Corolla Hybrid 2020-22">Buy Here</a></sub></details>|||
|Toyota|Corolla Hybrid (South America only) 2020-23|All|openpilot|17 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Corolla Hybrid (South America only) 2020-23">Buy Here</a></sub></details>|||
|Toyota|Highlander 2017-19|All|Stock|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Highlander 2017-19">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=0wS0wXSLzoo" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Toyota|Highlander 2017-19|All|Stock|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Highlander 2017-19">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=0wS0wXSLzoo" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Toyota|Highlander 2020-23|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Highlander 2020-23">Buy Here</a></sub></details>|||
|Toyota|Highlander Hybrid 2017-19|All|Stock|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Highlander Hybrid 2017-19">Buy Here</a></sub></details>|||
|Toyota|Highlander Hybrid 2020-23|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Highlander Hybrid 2020-23">Buy Here</a></sub></details>|||
|Toyota|Mirai 2021|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Mirai 2021">Buy Here</a></sub></details>|||
|Toyota|Prius 2016|Toyota Safety Sense P|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Prius 2016">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=8zopPJI8XQ0" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Toyota|Prius 2017-20|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Prius 2017-20">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=8zopPJI8XQ0" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Toyota|Prius 2021-22|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Prius 2021-22">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=J58TvCpUd4U" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Toyota|Prius Prime 2017-20|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Prius Prime 2017-20">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=8zopPJI8XQ0" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Toyota|Prius Prime 2021-22|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Prius Prime 2021-22">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=J58TvCpUd4U" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Toyota|Prius 2016|Toyota Safety Sense P|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Prius 2016">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=8zopPJI8XQ0" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Toyota|Prius 2017-20|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Prius 2017-20">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=8zopPJI8XQ0" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Toyota|Prius 2021-22|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Prius 2021-22">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=J58TvCpUd4U" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Toyota|Prius Prime 2017-20|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Prius Prime 2017-20">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=8zopPJI8XQ0" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Toyota|Prius Prime 2021-22|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Prius Prime 2021-22">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=J58TvCpUd4U" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Toyota|Prius v 2017|Toyota Safety Sense P|Stock|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Prius v 2017">Buy Here</a></sub></details>|||
|Toyota|RAV4 2016|Toyota Safety Sense P|Stock|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota RAV4 2016">Buy Here</a></sub></details>|||
|Toyota|RAV4 2017-18|All|Stock|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota RAV4 2017-18">Buy Here</a></sub></details>|||
|Toyota|RAV4 2019-21|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota RAV4 2019-21">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=wJxjDd42gGA" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Toyota|RAV4 2019-21|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota RAV4 2019-21">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=wJxjDd42gGA" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Toyota|RAV4 2022|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota RAV4 2022">Buy Here</a></sub></details>|||
|Toyota|RAV4 2023-25|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota RAV4 2023-25">Buy Here</a></sub></details>|||
|Toyota|RAV4 Hybrid 2016|Toyota Safety Sense P|Stock|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota RAV4 Hybrid 2016">Buy Here</a></sub></details>|<a href="https://youtu.be/LhT5VzJVfNI?t=26" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Toyota|RAV4 Hybrid 2017-18|All|Stock|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota RAV4 Hybrid 2017-18">Buy Here</a></sub></details>|<a href="https://youtu.be/LhT5VzJVfNI?t=26" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Toyota|RAV4 Hybrid 2016|Toyota Safety Sense P|Stock|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota RAV4 Hybrid 2016">Buy Here</a></sub></details>|<a href="https://youtu.be/LhT5VzJVfNI?t=26" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Toyota|RAV4 Hybrid 2017-18|All|Stock|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota RAV4 Hybrid 2017-18">Buy Here</a></sub></details>|<a href="https://youtu.be/LhT5VzJVfNI?t=26" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Toyota|RAV4 Hybrid 2019-21|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota RAV4 Hybrid 2019-21">Buy Here</a></sub></details>|||
|Toyota|RAV4 Hybrid 2022|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota RAV4 Hybrid 2022">Buy Here</a></sub></details>|<a href="https://youtu.be/U0nH9cnrFB0" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Toyota|RAV4 Hybrid 2023-25|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota RAV4 Hybrid 2023-25">Buy Here</a></sub></details>|<a href="https://youtu.be/4eIsEq4L4Ng" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Toyota|Sienna 2018-20|All|Stock|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Sienna 2018-20">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=q1UPOo4Sh68" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Volkswagen[<sup>11</sup>](#footnotes)|Arteon 2018-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Arteon 2018-23">Buy Here</a></sub></details>|<a href="https://youtu.be/FAomFKPFlDA" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Volkswagen[<sup>11</sup>](#footnotes)|Arteon eHybrid 2020-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Arteon eHybrid 2020-23">Buy Here</a></sub></details>|<a href="https://youtu.be/FAomFKPFlDA" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Volkswagen[<sup>11</sup>](#footnotes)|Arteon R 2020-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Arteon R 2020-23">Buy Here</a></sub></details>|<a href="https://youtu.be/FAomFKPFlDA" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Volkswagen[<sup>11</sup>](#footnotes)|Arteon Shooting Brake 2020-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Arteon Shooting Brake 2020-23">Buy Here</a></sub></details>|<a href="https://youtu.be/FAomFKPFlDA" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Toyota|RAV4 Hybrid 2022|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota RAV4 Hybrid 2022">Buy Here</a></sub></details>|<a href="https://youtu.be/U0nH9cnrFB0" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Toyota|RAV4 Hybrid 2023-25|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota RAV4 Hybrid 2023-25">Buy Here</a></sub></details>|<a href="https://youtu.be/4eIsEq4L4Ng" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Toyota|Sienna 2018-20|All|Stock|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 Toyota A connector<br>- 1 comma four<br>- 1 comma power v3<br>- 1 harness box<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Toyota Sienna 2018-20">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=q1UPOo4Sh68" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Volkswagen[<sup>11</sup>](#footnotes)|Arteon 2018-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Arteon 2018-23">Buy Here</a></sub></details>|<a href="https://youtu.be/FAomFKPFlDA" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Volkswagen[<sup>11</sup>](#footnotes)|Arteon eHybrid 2020-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Arteon eHybrid 2020-23">Buy Here</a></sub></details>|<a href="https://youtu.be/FAomFKPFlDA" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Volkswagen[<sup>11</sup>](#footnotes)|Arteon R 2020-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Arteon R 2020-23">Buy Here</a></sub></details>|<a href="https://youtu.be/FAomFKPFlDA" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Volkswagen[<sup>11</sup>](#footnotes)|Arteon Shooting Brake 2020-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Arteon Shooting Brake 2020-23">Buy Here</a></sub></details>|<a href="https://youtu.be/FAomFKPFlDA" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Volkswagen[<sup>11</sup>](#footnotes)|Atlas 2018-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Atlas 2018-23">Buy Here</a></sub></details>|||
|Volkswagen[<sup>11</sup>](#footnotes)|Atlas Cross Sport 2020-22|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Atlas Cross Sport 2020-22">Buy Here</a></sub></details>|||
|Volkswagen[<sup>11</sup>](#footnotes)|California 2021-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|31 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen California 2021-23">Buy Here</a></sub></details>|||
|Volkswagen[<sup>11</sup>](#footnotes)|Caravelle 2020|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|31 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Caravelle 2020">Buy Here</a></sub></details>|||
|Volkswagen[<sup>11</sup>](#footnotes)|CC 2018-22|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen CC 2018-22">Buy Here</a></sub></details>|<a href="https://youtu.be/FAomFKPFlDA" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Volkswagen[<sup>11</sup>](#footnotes)|Crafter 2017-24|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|31 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Crafter 2017-24">Buy Here</a></sub></details>|<a href="https://youtu.be/4100gLeabmo" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Volkswagen[<sup>11</sup>](#footnotes)|e-Crafter 2018-24|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|31 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen e-Crafter 2018-24">Buy Here</a></sub></details>|<a href="https://youtu.be/4100gLeabmo" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Volkswagen[<sup>11</sup>](#footnotes)|CC 2018-22|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen CC 2018-22">Buy Here</a></sub></details>|<a href="https://youtu.be/FAomFKPFlDA" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Volkswagen[<sup>11</sup>](#footnotes)|Crafter 2017-24|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|31 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Crafter 2017-24">Buy Here</a></sub></details>|<a href="https://youtu.be/4100gLeabmo" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Volkswagen[<sup>11</sup>](#footnotes)|e-Crafter 2018-24|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|31 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen e-Crafter 2018-24">Buy Here</a></sub></details>|<a href="https://youtu.be/4100gLeabmo" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Volkswagen[<sup>11</sup>](#footnotes)|e-Golf 2014-20|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen e-Golf 2014-20">Buy Here</a></sub></details>|||
|Volkswagen[<sup>11</sup>](#footnotes)|Golf 2015-20|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Golf 2015-20">Buy Here</a></sub></details>|||
|Volkswagen[<sup>11</sup>](#footnotes)|Golf Alltrack 2015-19|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Golf Alltrack 2015-19">Buy Here</a></sub></details>|||
@@ -331,7 +331,7 @@ A supported vehicle is one that just works when you install a comma device. All
|Volkswagen[<sup>11</sup>](#footnotes)|Golf GTI 2015-21|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Golf GTI 2015-21">Buy Here</a></sub></details>|||
|Volkswagen[<sup>11</sup>](#footnotes)|Golf R 2015-19|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Golf R 2015-19">Buy Here</a></sub></details>|||
|Volkswagen[<sup>11</sup>](#footnotes)|Golf SportsVan 2015-20|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Golf SportsVan 2015-20">Buy Here</a></sub></details>|||
|Volkswagen[<sup>11</sup>](#footnotes)|Grand California 2019-24|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|31 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Grand California 2019-24">Buy Here</a></sub></details>|<a href="https://youtu.be/4100gLeabmo" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>||
|Volkswagen[<sup>11</sup>](#footnotes)|Grand California 2019-24|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|31 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Grand California 2019-24">Buy Here</a></sub></details>|<a href="https://youtu.be/4100gLeabmo" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>||
|Volkswagen[<sup>11</sup>](#footnotes)|Jetta 2019-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Jetta 2019-23">Buy Here</a></sub></details>|||
|Volkswagen[<sup>11</sup>](#footnotes)|Jetta GLI 2021-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Jetta GLI 2021-23">Buy Here</a></sub></details>|||
|Volkswagen|Passat 2015-22[<sup>13</sup>](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,15</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 OBD-C cable (2 ft)<br>- 1 VW J533 connector<br>- 1 comma four<br>- 1 harness box<br>- 1 long OBD-C cable (9.5 ft)<br>- 1 mount<br><a href="https://comma.ai/shop/comma-3x?harness=Volkswagen Passat 2015-22">Buy Here</a></sub></details>|||
+24
View File
@@ -0,0 +1,24 @@
# Docs development
The `docs/` tree is the source for [docs.comma.ai](https://docs.comma.ai).
The site is updated on pushes to master by this [workflow](../.github/workflows/docs.yaml).
Those commands must be run in the root directory of openpilot, **not /docs**
**1. Install the docs dependencies**
``` bash
uv pip install .[docs]
```
**2. Build the new site**
``` bash
docs build
```
**3. Run the new site locally**
``` bash
docs serve
```
References:
* https://zensical.org/docs/
-26
View File
@@ -1,26 +0,0 @@
# openpilot docs
This is the source for [docs.comma.ai](https://docs.comma.ai).
The site is updated on pushes to master by this [workflow](../.github/workflows/docs.yaml).
## Development
NOTE: Those commands must be run in the root directory of openpilot, **not /docs**
**1. Install the docs dependencies**
``` bash
uv pip install .[docs]
```
**2. Build the new site**
``` bash
mkdocs build
```
**3. Run the new site locally**
``` bash
mkdocs serve
```
References:
* https://www.mkdocs.org/getting-started/
* https://github.com/ntno/mkdocs-terminal
+1
View File
@@ -0,0 +1 @@
../../selfdrive/assets/icons_mici/settings/comma_icon.png
-5
View File
@@ -1,5 +0,0 @@
# Developing a car brand port
A brand port is a port of openpilot to a substantially new car brand or platform within a brand.
Here's an example of one: https://github.com/commaai/openpilot/pull/23331.
-65
View File
@@ -1,65 +0,0 @@
# CarState signals
## Required for basic lateral control
* `brakePressed`
* `cruiseState`
* `doorOpen`
* `espDisabled`
* `gasPressed`
* `gearShifter`
* `leftBlinker` / `rightBlinker`
* `seatbeltUnlatched`
* `standstill`
* `steeringAngleDeg`
* `steeringPressed`
* `steeringTorque`
* `steerFaultPermanent`
* `steerFaultTemporary`
* `vCruise`
* `wheelSpeeds.[fl|fr|rl|rr]`: Speed of each of the car's four wheels, in m/s. The car's CAN bus often broadcasts the
speed in kph, so the helper function `parse_wheel_speeds` performs this conversion by default.
## Recommended / Required for openpilot longitudinal control
* `accFaulted`
* `espActive`
* `parkingBrake`
## Application Dependent
* `blockPcmEnable`
* `buttonEnable`
* `brakeHoldActive`
* `carFaultedNonCritical`
* `invalidLkasSetting`
* `lowSpeedAlert`
* `regenBraking`
* `steeringAngleOffsetDeg`
* `steeringDisengage`
* `steeringTorqueEps`
* `stockLkas`
* `vCruiseCluster`
* `vEgoCluster`
* `vehicleSensorsInvalid`
## Automatically populated
* `buttonEvents`
These values are populated automatically by `parse_wheel_speeds`:
* `aEgo`: Acceleration of the ego vehicle, Kalman filtered derivative of `vEgo`.
* `vEgo`: Speed of the ego vehicle, Kalman filtered from `vEgoRaw`.
* `vEgoRaw`: Speed of the ego vehicle, based on the average of all four wheel speeds, unfiltered.
## Optional
* `brake`
* `charging`
* `fuelGauge`
* `leftBlindspot` / `rightBlindspot`
* `steeringRateDeg`
* `stockAeb`
* `stockFcw`
* `yawRate`
-5
View File
@@ -1,5 +0,0 @@
# Developing a car model port
A model port is a port of openpilot to a new car model within an already supported brand. Model ports are easier than brand ports because the car's existing APIs are already known.
Here's an example of one: https://github.com/commaai/openpilot/pull/30672/.
-85
View File
@@ -1,85 +0,0 @@
# Stimulus-Response Tests
These are example test drives that can help identify the CAN bus messaging necessary for ADAS control. Each scripted
test should be done in a separate route (ignition cycle). These tests are a guide, not necessarily exhaustive.
While testing, constant power to the comma device is highly recommended, using [comma power](https://comma.ai/shop/comma-power) if
necessary to make sure all test activity is fully captured and for ease of uploading. If constant power isn't
available, keep the ignition on for at least one minute after your test to make sure power loss doesn't result
in loss of the last minute of testing data.
## Stationary ignition-only tests, part 1
1. Ignition on, but don't start engine, remain in Park
2. Open and close each door in a defined order: driver, passenger, rear left, rear right
3. Re-enter the vehicle, close the driver's door, and fasten the driver's seatbelt
4. Slowly press and release the accelerator pedal 3 times
5. Slowly press and release the brake pedal 3 times
6. Hold the brake and move the gearshift to reverse, then neutral, then drive, then sport/eco/etc if applicable
7. Return to Park, ignition off
Brake-pressed information may show up in several messages and signals, both as on/off states and as a percentage or
pressure. It may reflect a switch on the driver's brake pedal, or a pressure-threshold state, or signals to turn on
the rear brake lights. Start by identifying all the potential signals, and confirm while driving with ACC later.
Locate signals for all four door states if possible, but some cars only expose the driver's door state on the ADAS bus.
Driver/passenger door signals may or may not change positions for LHD vs RHD cars. For cars where only the driver's
door signal is available, the same signal may follow the driver.
## Stationary ignition-only tests, part 2
1. Ignition on, but don't start engine, remain in Park
2. Press each ACC button in a defined order: main switch on/off, set, resume, cancel, accel, decel, gap adjust
3. Set the left turn signal for about five seconds
4. Operate the left turn signal one time in its touch-to-pass mode
5. Set the right turn signal for about five seconds
6. Operate the right turn signal one time in its touch-to-pass mode
7. Set the hazard / emergency indicator switch for about five seconds
8. Ignition off
Your vehicle may have a momentary-press main ACC switch or a physical toggle that remains set. Actual ACC engagement
isn't necessary for purposes of detecting the ACC button presses.
## Steering angle and steering torque tests
Power steering should be available. On ICE cars, engine RPM may be present.
1. Ignition on, start engine if applicable, remain in Park
2. Rotate the steering wheel as follows, with a few seconds pause between each step
* Start as close to exact center as possible
* Turn to 45 degrees right and hold
* Turn to 90 degrees right and hold
* Turn to 180 degrees right and hold
* Turn to full lock right and hold, with firm pressure against lock
* Release the wheel and allow it to bounce back slightly from lock
* Turn to 180 degrees left and hold
* Return to center and release
3. Ignition off
Performing the full test to the right, followed by an abbreviated test to the left, helps give additional confirmation
of signal scale, and sign/direction for both the steering wheel angle and driver input torque signals.
## Low speed / parking lot driving tests
Before this test, drive to a place like an empty parking lot where you are free to drive in a series of curves.
1. Ignition on, start engine if applicable, prepare to drive
2. Slowly (10-20mph at most) drive a figure-8 if possible, or at least one sharp left and one sharp right.
3. Come to a complete stop
4. When and where safe, drive in reverse for a short distance (10-15 feet)
5. Park the car in a safe place, ignition off
## High speed / highway driving tests
Select a place and time where you can safely set cruise control at normal travel speeds with little interference from
traffic ahead, and safely test the response of your factory lane guidance system.
1. Ignition on, start engine if applicable, prepare to drive
2. When safely able, engage adaptive cruise control below 50 mph
3. When safely able, use the ACC buttons to accelerate to 50mph, then 55mph, then 60mph
4. Disengage adaptive cruise
5. When safely able, allow your factory lane guidance to prevent lane departures, 2-3 times on both the left and right
The series of setpoints can be adjusted to local traffic regulations, and of course metric units. The specific cruise
setpoints are useful for locating the ACC HUD signals later, and confirming their precise scaling. When the car reaches
and holds the setpoint, that can also provide additional confirmation of wheel speed scaling.
+1 -7
View File
@@ -1,9 +1,3 @@
# openpilot glossary
* **onroad**: openpilot's system state while ignition is on
* **offroad**: openpilot's system state while ignition is off
* **route**: a route is a recording of an onroad session
* **segment**: routes are split into one minute chunks called segments.
* **comma connect**: the web viewer for all your routes; check it out at [connect.comma.ai](https://connect.comma.ai).
* **panda**: this is the secondary processor on the device that implements the functional safety and directly talks to the car over CAN. See the [panda repo](https://github.com/commaai/panda).
* **comma four**: the latest hardware by comma.ai for running openpilot. more info at [comma.ai/shop/comma-four](https://www.comma.ai/shop/comma-four).
{{GLOSSARY_DEFINITIONS}}
+4 -6
View File
@@ -6,9 +6,9 @@ Check out our [Python library](https://github.com/commaai/openpilot/blob/master/
For each segment, openpilot records the following log types:
## rlog.bz2
## rlog.zst
rlogs contain all the messages passed amongst openpilot's processes. See [cereal/services.py](https://github.com/commaai/cereal/blob/master/services.py) for a list of all the logged services. They're a bzip2 archive of the serialized capnproto messages.
rlogs contain all the messages passed amongst openpilot's processes. See [cereal/services.py](https://github.com/commaai/openpilot/blob/master/cereal/services.py) for a list of all the logged services. They're a zstd archive of the serialized [Capn Proto](https://capnproto.org/) messages.
## {f,e,d}camera.hevc
@@ -18,12 +18,10 @@ Each camera stream is H.265 encoded and written to its respective file.
* `ecamera.hevc` is the wide road camera
* `dcamera.hevc` is the driver camera
## qlog.bz2 & qcamera.ts
## qlog.zst & qcamera.ts
qlogs are a decimated subset of the rlogs. Check out [cereal/services.py](https://github.com/commaai/cereal/blob/master/services.py) for the decimation.
qcameras are H.264 encoded, lower res versions of the fcamera.hevc. The video shown in [comma connect](https://connect.comma.ai/) is from the qcameras.
qlogs and qcameras are designed to be small enough to upload instantly on slow internet and store forever, yet useful enough for most analysis and debugging.
qlogs and qcameras are designed to be small enough to upload instantly on slow internet, yet useful enough for most analysis and debugging.
+36
View File
@@ -0,0 +1,36 @@
# How to Give Feedback
Feedback is one of the highest leverage ways to contribute to openpilot as a user.
## Driving
Got feedback about how your car drives?
Join the community Discord, then use the form in `#submit-feedback`.
Before posting feedback, please ensure:
- **openpilot is up to date** you should be on the latest openpilot release or nightly
- **both road-facing cameras have a clear view** your windshield is clean, lenses are clean, etc.
- **your device is mounted properly** your device must be mounted horizontally center and relatively high on the windshield
## Driver Monitoring
If you find DM annoying while being perfectly attentive, these are likely false positives and we want to fix them!
In general, driver monitoring feedback is very actionable, and we can fix your complaint within a release cycle.
To post your feedback:
1. Join the [community Discord](https://discord.comma.ai).
2. If driver camera recording is toggled off, temporarily enable driver camera recording in the settings until you reproduce the issue.
3. Using comma connect, identify the relevant segment and upload the segment's logs and driver camera.
4. Post the segment in the `#openpilot-experience` channel on Discord with a good description.
Before posting feedback, please ensure:
- **openpilot is up to date** you should be on the latest openpilot release or nightly
- **the driver camera has a clear view of the driver** ensure nothing blocks view of the driver (e.g. a cable), the lens is clean, etc.
- **your device is mounted properly** your device must be mounted horizontally center and relatively high on the windshield
## Other bugs
Got an issue with something else? Open an issue on our [GitHub issue tracker](https://github.com/commaai/openpilot/issues/new/choose).
-14
View File
@@ -7,25 +7,11 @@ This is the roadmap for the next major openpilot releases. Also check out
* [Bounties](https://comma.ai/bounties) for paid individual issues
* [#current-projects](https://discord.com/channels/469524606043160576/1249579909739708446) in Discord for discussion on work-in-progress projects
## openpilot 0.10
openpilot 0.10 will be the first release with a driving policy trained in
a [learned simulator](https://youtu.be/EqQNZXqzFSI).
* Driving model trained in a learned simulator
* Always-on driver monitoring (behind a toggle)
* GPS removed from the driving stack
* 100KB qlogs
* `nightly` pushed after 1000 hours of hardware-in-the-loop testing
* Car interface code moved into [opendbc](https://github.com/commaai/opendbc)
* openpilot on PC for Linux x86, Linux arm64, and Mac (Apple Silicon)
## openpilot 1.0
openpilot 1.0 will feature a fully end-to-end driving policy.
* End-to-end longitudinal control in Chill mode
* Automatic Emergency Braking (AEB)
* Driver monitoring with sleep detection
* Rolling updates/releases pushed out by CI
* [panda safety 1.0](https://github.com/orgs/commaai/projects/27)
-44
View File
@@ -1,44 +0,0 @@
[data-tooltip] {
position: relative;
display: inline-block;
border-bottom: 1px dotted black;
}
[data-tooltip] .tooltip-content {
width: max-content;
max-width: 25em;
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
background-color: white;
color: #404040;
box-shadow: 0 4px 14px 0 rgba(0,0,0,.2), 0 0 0 1px rgba(0,0,0,.05);
padding: 10px;
font: 14px/1.5 Lato, proxima-nova, Helvetica Neue, Arial, sans-serif;
text-decoration: none;
opacity: 0;
visibility: hidden;
transition: opacity 0.1s, visibility 0s;
z-index: 1000;
pointer-events: none; /* Prevent accidental interaction */
}
[data-tooltip]:hover .tooltip-content {
opacity: 1;
visibility: visible;
pointer-events: auto; /* Allow interaction when visible */
}
.tooltip-content .tooltip-glossary-link {
display: inline-block;
margin-top: 8px;
font-size: 12px;
color: #007bff;
text-decoration: none;
}
.tooltip-content .tooltip-glossary-link:hover {
color: #0056b3;
text-decoration: underline;
}
+216
View File
@@ -0,0 +1,216 @@
import posixpath
import re
import tomllib
import xml.etree.ElementTree as ET
from pathlib import Path
from markdown.extensions import Extension
from markdown.preprocessors import Preprocessor
from markdown.treeprocessors import Treeprocessor
from zensical.extensions.links import LinksProcessor
GlossaryTerm = tuple[str, re.Pattern[str], str]
GLOSSARY_FILE = Path(__file__).with_name("glossary.toml")
GLOSSARY_PAGE = "concepts/glossary.md"
GLOSSARY_PLACEHOLDER = "{{GLOSSARY_DEFINITIONS}}"
SKIP_TAGS = {
"a",
"code",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"kbd",
"pre",
"script",
"style",
}
def clean_tooltip(description: str) -> str:
text = re.sub(r"\[([^\]]+)]\([^)]+\)", r"\1", description)
text = re.sub(r"`([^`]+)`", r"\1", text)
text = re.sub(r"[*_~]", "", text)
return re.sub(r"\s+", " ", text).strip()
def load_glossary() -> tuple[list[GlossaryTerm], str]:
with GLOSSARY_FILE.open("rb") as f:
glossary_data = tomllib.load(f).get("glossary", {})
glossary: list[GlossaryTerm] = []
rendered = []
for key, value in glossary_data.items():
label = str(key).strip().replace("_", " ")
description = str(value).strip()
if not description:
continue
slug = label.replace(" ", "-").replace("_", "-").lower()
glossary.append((slug, re.compile(rf"(?<!\w){re.escape(label)}(?!\w)", re.IGNORECASE), clean_tooltip(description)))
rendered.append(f'* <span id="{slug}"></span>**{label}**: {description}')
return glossary, "\n".join(rendered)
class GlossaryPreprocessor(Preprocessor):
def __init__(self, md, glossary: str):
super().__init__(md)
self.glossary = glossary
def run(self, lines: list[str]) -> list[str]:
markdown = "\n".join(lines)
if GLOSSARY_PLACEHOLDER not in markdown:
return lines
return markdown.replace(GLOSSARY_PLACEHOLDER, self.glossary).splitlines()
class GlossaryTreeprocessor(Treeprocessor):
def __init__(self, md, glossary: list[GlossaryTerm]):
super().__init__(md)
self.glossary = glossary
self.seen: set[str] = set()
def run(self, root: ET.Element) -> None:
at = self.md.treeprocessors.get_index_for_name("zrelpath")
processor = self.md.treeprocessors[at]
if not isinstance(processor, LinksProcessor):
raise TypeError("Links processor not registered")
if processor.path == GLOSSARY_PAGE:
return
self.seen.clear()
glossary_href = f"{posixpath.relpath(GLOSSARY_PAGE, posixpath.dirname(processor.path) or '.')}#"
self._walk(root, glossary_href)
def _walk(self, element: ET.Element, glossary_href: str) -> None:
if element.tag in SKIP_TAGS or element.attrib.get("data-glossary-skip") is not None:
return
self._replace(element, glossary_href)
idx = 0
while idx < len(element):
child = element[idx]
self._walk(child, glossary_href)
idx = self._replace(element, glossary_href, idx) + 1
def _replace(self, parent: ET.Element, glossary_href: str, index: int | None = None) -> int:
child = None if index is None else parent[index]
text = parent.text if child is None else child.tail
pieces = self._pieces(text or "", glossary_href)
if not pieces:
return -1 if index is None else index
if child is None:
parent.text = pieces[0] if isinstance(pieces[0], str) else ""
# Insert replacements for parent.text before the first existing child.
insert_at = -1
else:
assert index is not None
child.tail = pieces[0] if isinstance(pieces[0], str) else ""
insert_at = index
start = 1 if isinstance(pieces[0], str) else 0
previous = child
for piece in pieces[start:]:
if isinstance(piece, str):
previous.tail = (previous.tail or "") + piece
continue
insert_at += 1
parent.insert(insert_at, piece)
previous = piece
return insert_at
def _pieces(self, text: str, glossary_href: str) -> list[str | ET.Element]:
if not text.strip():
return []
pieces: list[str | ET.Element] = []
cursor = 0
while True:
best = None
for slug, pattern, tooltip in self.glossary:
if slug in self.seen:
continue
found = pattern.search(text, cursor)
if found is None:
continue
candidate = (slug, tooltip, found.start(), found.end())
if best is None:
best = candidate
continue
_, _, best_start, best_end = best
_, _, current_start, current_end = candidate
if current_start < best_start:
best = candidate
continue
if current_start == best_start and current_end - current_start > best_end - best_start:
best = candidate
if best is None:
break
slug, tooltip, start, end = best
if start > cursor:
pieces.append(text[cursor:start])
link = ET.Element(
"a",
{
"class": "glossary-term",
"data-glossary-term": "",
"href": f"{glossary_href}{slug}",
},
)
ET.SubElement(link, "span", {"class": "glossary-term__label"}).text = text[start:end]
ET.SubElement(
link,
"span",
{
"class": "glossary-term__tooltip",
"data-search-exclude": "",
},
).text = tooltip
pieces.append(link)
self.seen.add(slug)
cursor = end
if not pieces:
return []
if cursor < len(text):
pieces.append(text[cursor:])
return pieces
class GlossaryExtension(Extension):
def extendMarkdown(self, md) -> None:
md.registerExtension(self)
glossary, rendered = load_glossary()
md.preprocessors.register(
GlossaryPreprocessor(md, rendered),
"docs-ext-glossary-preprocessor",
27,
)
md.treeprocessors.register(
GlossaryTreeprocessor(md, glossary),
"docs-ext-glossary-treeprocessor",
0,
)
def makeExtension(**kwargs) -> GlossaryExtension:
return GlossaryExtension(**kwargs)
+8
View File
@@ -0,0 +1,8 @@
[glossary]
onroad = "openpilot's system state while ignition is on."
offroad = "openpilot's system state while ignition is off."
route = "A route is a recording of an onroad session."
segment = "Routes are split into one minute chunks called segments."
"comma connect" = "The web viewer for all your routes; check it out at [connect.comma.ai](https://connect.comma.ai)."
panda = "The secondary processor on the device that implements the functional safety and directly talks to the car over CAN. See the [panda repo](https://github.com/commaai/panda)."
"comma four" = "The latest hardware by comma.ai for running openpilot. More info at [comma.ai/shop/comma-four](https://www.comma.ai/shop/comma-four)."
-12
View File
@@ -1,12 +0,0 @@
# What is openpilot?
[openpilot](http://github.com/commaai/openpilot) is an open source driver assistance system. Currently, openpilot performs the functions of Adaptive Cruise Control (ACC), Automated Lane Centering (ALC), Forward Collision Warning (FCW), and Lane Departure Warning (LDW) for a growing variety of [supported car makes, models, and model years](https://github.com/commaai/openpilot/blob/master/docs/CARS.md). In addition, while openpilot is engaged, a camera-based Driver Monitoring (DM) feature alerts distracted and asleep drivers. See more about [the vehicle integration](https://github.com/commaai/openpilot/blob/master/docs/INTEGRATION.md) and [limitations](https://github.com/commaai/openpilot/blob/master/docs/LIMITATIONS.md).
## How do I use it?
openpilot is designed to be used on the comma four.
## How does it work?
In short, openpilot uses the car's existing APIs for the built-in [ADAS](https://en.wikipedia.org/wiki/Advanced_driver-assistance_system) system and simply provides better acceleration, braking, and steering inputs than the stock system.
View File
-68
View File
@@ -1,68 +0,0 @@
import re
import tomllib
def load_glossary(file_path="docs/glossary.toml"):
with open(file_path, "rb") as f:
glossary_data = tomllib.load(f)
return glossary_data.get("glossary", {})
def generate_anchor_id(name):
return name.replace(" ", "-").replace("_", "-").lower()
def format_markdown_term(name, definition):
anchor_id = generate_anchor_id(name)
markdown = f"* [**{name.replace('_', ' ').title()}**](#{anchor_id})"
if definition.get("abbreviation"):
markdown += f" *({definition['abbreviation']})*"
if definition.get("description"):
markdown += f": {definition['description']}\n"
return markdown
def glossary_markdown(vocabulary):
markdown = ""
for category, terms in vocabulary.items():
markdown += f"## {category.replace('_', ' ').title()}\n\n"
for name, definition in terms.items():
markdown += format_markdown_term(name, definition)
return markdown
def format_tooltip_html(term_key, definition, html):
display_term = term_key.replace("_", " ").title()
clean_description = re.sub(r"\[(.+)]\(.+\)", r"\1", definition["description"])
glossary_link = (
f"<a href='/concepts/glossary#{term_key}' class='tooltip-glossary-link' title='View in glossary'>Glossary🔗</a>"
)
return re.sub(
re.escape(display_term),
lambda
match: f"<span data-tooltip>{match.group(0)}<span class='tooltip-content'>{clean_description} {glossary_link}</span></span>",
html,
flags=re.IGNORECASE,
)
def apply_tooltip(_term_key, _definition, pattern, html):
return re.sub(
pattern,
lambda match: format_tooltip_html(_term_key, _definition, match.group(0)),
html,
flags=re.IGNORECASE,
)
def tooltip_html(vocabulary, html):
for _category, terms in vocabulary.items():
for term_key, definition in terms.items():
if definition.get("description"):
pattern = rf"(?<!\w){re.escape(term_key.replace('_', ' ').title())}(?![^<]*<\/a>)(?!\([^)]*\))"
html = apply_tooltip(term_key, definition, pattern, html)
return html
# Page Hooks
def on_page_markdown(markdown, **kwargs):
glossary = load_glossary()
return markdown.replace("{{GLOSSARY_DEFINITIONS}}", glossary_markdown(glossary))
def on_page_content(html, **kwargs):
if kwargs.get("page").title == "Glossary":
return html
glossary = load_glossary()
return tooltip_html(glossary, html)
@@ -8,7 +8,7 @@ A car port enables openpilot support on a particular car. Each car model openpil
# 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).
All car-specific code is contained in the [opendbc](https://github.com/commaai/opendbc) project.
## opendbc
@@ -23,8 +23,8 @@ Each car brand is supported by a standard interface structure in `opendbc/car/[b
## safety
* `opendbc_repo/opendbc/safety/modes/[brand].h`: Brand-specific safety logic
* `opendbc_repo/opendbc/safety/tests/test_[brand].py`: Brand-specific safety CI tests
* `opendbc/safety/modes/[brand].h`: Brand-specific safety logic
* `opendbc/safety/tests/test_[brand].py`: Brand-specific safety CI tests
## openpilot
@@ -32,8 +32,20 @@ For historical reasons, openpilot still contains a small amount of car-specific
* `selfdrive/car/car_specific.py`: Brand-specific event logic
# Overview
# How do I port car?
[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://www.youtube.com/watch?v=XxPS5TpTUnI
## Brand Port
A brand port is a port of openpilot to a substantially new car brand or platform within a brand.
Here's an example of one: https://github.com/commaai/openpilot/pull/23331.
## Model Port
A model port is a port of openpilot to a new car model within an already supported brand. Model ports are easier than brand ports because the car's existing APIs are already known.
Here's an example of one: https://github.com/commaai/openpilot/pull/30672/.
+10 -9
View File
@@ -1,15 +1,15 @@
# connect to a comma four
# connect to a comma 3X or comma four
A comma four is a normal [Linux](https://github.com/commaai/agnos-builder) computer that exposes [SSH](https://wiki.archlinux.org/title/Secure_Shell) and a [serial console](https://wiki.archlinux.org/title/Working_with_the_serial_console).
A comma device is a normal [Linux](https://github.com/commaai/agnos-builder) computer that exposes [SSH](https://wiki.archlinux.org/title/Secure_Shell) and a [serial console](https://wiki.archlinux.org/title/Working_with_the_serial_console).
## Serial Console
On both the comma three and comma four, the serial console is accessible from the main OBD-C port.
Connect the comma four to your computer with a normal USB C cable, or use a [comma serial](https://comma.ai/shop/comma-serial) for steady 12V power.
On the comma 3X, the serial console is accessible from the main OBD-C port, forwarded through the panda.
Access it using `panda/scripts/som_debug.sh`.
On the comma three, the serial console is exposed through a UART-to-USB chip, and `tools/scripts/serial.sh` can be used to connect.
comma four also exposes a serial console, albeit through an internal debug connector. Dedicated debug hardware coming soon to the comma shop.
On the comma four, the serial console is accessible through the [panda](https://github.com/commaai/panda) using the `panda/tests/som_debug.sh` script.
Login to the default user with:
* Username: `comma`
* Password: `comma`
@@ -25,7 +25,7 @@ In order to SSH into your device, you'll need a GitHub account with SSH keys. Se
* Port: `22`
Here's an example command for connecting to your device using its tethered connection:<br />
`ssh comma@192.168.43.1`
`ssh comma@192.168.43.1 -i ~/.ssh/my_github_key`
For doing development work on device, it's recommended to use [SSH agent forwarding](https://docs.github.com/en/developers/overview/using-ssh-agent-forwarding).
@@ -45,7 +45,7 @@ In order to use ADB on your device, you'll need to perform the following steps u
* Here's an example command for connecting to your device using its tethered connection: `adb connect 192.168.43.1:5555`
> [!NOTE]
> The default port for ADB is 5555 on the comma four.
> The default port for ADB is 5555.
For more info on ADB, see the [Android Debug Bridge (ADB) documentation](https://developer.android.com/tools/adb).
@@ -55,7 +55,7 @@ The public keys are only fetched from your GitHub account once. In order to upda
The `id_rsa` key in this directory only works while your device is in the setup state with no software installed. After installation, that default key will be removed.
#### ssh.comma.ai proxy
## ssh.comma.ai proxy
With a [comma prime subscription](https://comma.ai/connect), you can SSH into your comma device from anywhere.
@@ -79,6 +79,7 @@ Host ssh.comma.ai
```
ssh -i ~/.ssh/my_github_key -o ProxyCommand="ssh -i ~/.ssh/my_github_key -W %h:%p -p %p %h@ssh.comma.ai" comma@ffffffffffffffff
```
(Replace `ffffffffffffffff` with your dongle_id)
### ssh.comma.ai host key fingerprint
-1
View File
@@ -1 +0,0 @@
getting-started/what-is-openpilot.md
+12
View File
@@ -0,0 +1,12 @@
# What is openpilot?
[openpilot](http://github.com/commaai/openpilot) is an open source driver assistance system. Currently, openpilot performs the functions of Adaptive Cruise Control (ACC), Automated Lane Centering (ALC), Forward Collision Warning (FCW), and Lane Departure Warning (LDW) for a growing variety of [supported car makes, models, and model years](https://github.com/commaai/openpilot/blob/master/docs/CARS.md). In addition, while openpilot is engaged, a camera-based Driver Monitoring (DM) feature alerts distracted and asleep drivers. See more about [the vehicle integration](https://github.com/commaai/openpilot/blob/master/docs/INTEGRATION.md) and [limitations](https://github.com/commaai/openpilot/blob/master/docs/LIMITATIONS.md).
## How do I use it?
openpilot is designed to be used on the comma four.
## How does it work?
In short, openpilot uses the car's existing APIs for the built-in [ADAS](https://en.wikipedia.org/wiki/Advanced_driver-assistance_system) system and simply provides better acceleration, braking, and steering inputs than the stock system.
+42
View File
@@ -0,0 +1,42 @@
.md-logo img {
filter: invert(1);
}
.glossary-term {
position: relative;
color: inherit;
text-decoration: none;
}
.glossary-term__label {
border-bottom: 1px dotted currentColor;
}
.glossary-term__tooltip {
position: absolute;
top: calc(100% + 0.4rem);
left: 50%;
width: max-content;
max-width: min(30rem, 80vw);
padding: 0.65rem 0.8rem;
border-radius: 0.6rem;
background: rgb(26 26 26 / 96%);
color: white;
box-shadow: 0 0.6rem 1.8rem rgb(0 0 0 / 22%);
font-size: 0.85rem;
line-height: 1.45;
opacity: 0;
pointer-events: none;
transform: translateX(-50%) translateY(-0.15rem);
transition: opacity 120ms ease, transform 120ms ease;
visibility: hidden;
z-index: 20;
}
.glossary-term:hover .glossary-term__tooltip,
.glossary-term:focus-visible .glossary-term__tooltip,
.glossary-term:focus-within .glossary-term__tooltip {
opacity: 1;
transform: translateX(-50%) translateY(0);
visibility: visible;
}
-44
View File
@@ -1,44 +0,0 @@
site_name: openpilot docs
repo_url: https://github.com/commaai/openpilot/
site_url: https://docs.comma.ai
exclude_docs: README.md
strict: true
docs_dir: docs
site_dir: docs_site/
hooks:
- docs/hooks/glossary.py
extra_css:
- css/tooltip.css
theme:
name: readthedocs
navigation_depth: 3
nav:
- Getting Started:
- What is openpilot?: getting-started/what-is-openpilot.md
- How-to:
- Turn the speed blue: how-to/turn-the-speed-blue.md
- Connect to a comma 3X: how-to/connect-to-comma.md
# - Make your first pull request: how-to/make-first-pr.md
#- Replay a drive: how-to/replay-a-drive.md
- Concepts:
- Logs: concepts/logs.md
- Safety: concepts/safety.md
- Glossary: concepts/glossary.md
- Car Porting:
- What is a car port?: car-porting/what-is-a-car-port.md
- Porting a car brand: car-porting/brand-port.md
- Porting a car model: car-porting/model-port.md
- Contributing:
- Roadmap: contributing/roadmap.md
#- Architecture: contributing/architecture.md
- Contributing Guide →: https://github.com/commaai/openpilot/blob/master/docs/CONTRIBUTING.md
- Links:
- Blog →: https://blog.comma.ai
- Bounties →: https://comma.ai/bounties
- GitHub →: https://github.com/commaai
- Discord →: https://discord.comma.ai
- X →: https://x.com/comma_ai
+1 -1
Submodule panda updated: c0cc96fbad...0a9ef7ab54
+2 -2
View File
@@ -82,7 +82,7 @@ dependencies = [
[project.optional-dependencies]
docs = [
"Jinja2",
"mkdocs",
"zensical",
]
testing = [
@@ -150,7 +150,7 @@ quiet-level = 3
# if you've got a short variable name that's getting flagged, add it here
ignore-words-list = "bu,ro,te,ue,alo,hda,ois,nam,nams,ned,som,parm,setts,inout,warmup,bumb,nd,sie,preints,whit,indexIn,ws,uint,grey,deque,stdio,amin,BA,LITE,atEnd,UIs,errorString,arange,FocusIn,od,tim,relA,hist,copyable,jupyter,thead,TGE,abl,lite,ser"
builtin = "clear,rare,informal,code,names,en-GB_to_en-US"
skip = "./third_party/*, ./tinygrad/*, ./tinygrad_repo/*, ./msgq/*, ./panda/*, ./opendbc/*, ./opendbc_repo/*, ./rednose/*, ./rednose_repo/*, ./teleoprtc/*, ./teleoprtc_repo/*, *.po, uv.lock, *.onnx, ./cereal/gen/*, */c_generated_code/*, docs/assets/*, tools/plotjuggler/layouts/*, selfdrive/assets/offroad/mici_fcc.html"
skip = "./third_party/*, ./tinygrad/*, ./tinygrad_repo/*, ./msgq/*, ./panda/*, ./opendbc/*, ./opendbc_repo/*, ./rednose/*, ./rednose_repo/*, ./teleoprtc/*, ./teleoprtc_repo/*, *.po, uv.lock, *.onnx, *.pem, ./cereal/gen/*, */c_generated_code/*, docs/assets/*, tools/plotjuggler/layouts/*, selfdrive/assets/offroad/mici_fcc.html"
# https://docs.astral.sh/ruff/configuration/#using-pyprojecttoml
[tool.ruff]
+63
View File
@@ -0,0 +1,63 @@
"""
wrapper that materializes symlinks in docs/ before build
we can delete this once zensical supports symlinks:
https://github.com/zensical/backlog/issues/55
"""
import os
import shutil
import signal
import sys
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parent.parent
DOCS_DIR = REPO_ROOT / "docs"
SITE_DIR = REPO_ROOT / "docs_site"
sys.path.insert(0, str(REPO_ROOT))
# Local docs build helpers live under docs/ so they stay near the content
# source. The wrapper prunes them from docs_site/ after build.
sys.path.insert(0, str(DOCS_DIR))
def _materialize(docs: Path) -> dict[Path, str]:
originals: dict[Path, str] = {}
for link in docs.rglob("*"):
if not link.is_symlink():
continue
target = link.resolve()
if not target.is_file():
continue
originals[link] = os.readlink(link)
link.unlink()
shutil.copy2(target, link)
return originals
def _restore(originals: dict[Path, str]) -> None:
for link, target in originals.items():
link.unlink(missing_ok=True)
os.symlink(target, link)
def _raise_interrupt(*_):
raise KeyboardInterrupt
def _prune_site_output() -> None:
shutil.rmtree(SITE_DIR / "ext", ignore_errors=True)
def main() -> None:
signal.signal(signal.SIGTERM, _raise_interrupt)
originals = _materialize(DOCS_DIR)
try:
from zensical.main import cli
cli(standalone_mode=False)
if len(sys.argv) > 1 and sys.argv[1] == "build":
_prune_site_output()
finally:
_restore(originals)
if __name__ == "__main__":
main()
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4ce1d357acadd798939b398cce1761ceb05564b44f2a5bc6865c7842e60e79f2
size 1474
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b3fe73cd1a24c05346a9b4a02e4f900a314c83a422beb38b0f88f91389582cd4
size 3960
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b5aee9f6cec03f1967014cd2ea2a23982b262e7d86dadca602ecfa8875b38101
size 5875
+1 -1
View File
@@ -1,6 +1,6 @@
{% set footnote_tag = '[<sup>{}</sup>](#footnotes)' %}
{% set star_icon = '[![star](assets/icon-star-{}.svg)](##)' %}
{% set video_icon = '<a href="{}" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>' %}
{% set video_icon = '<a href="{}" target="_blank"><img height="18px" src="assets/icon-youtube.svg" /></a>' %}
{# Force hardware column wider by using a blank image with max width. #}
{% set width_tag = '<a href="##"><img width=2000></a>%s<br>&nbsp;' %}
{% set hardware_col_name = 'Hardware Needed' %}
+1 -1
View File
@@ -86,7 +86,7 @@ class Car:
self.can_callbacks = can_comm_callbacks(self.can_sock, self.pm.sock['sendcan'])
is_release = self.params.get_bool("IsReleaseBranch")
is_release = False # self.params.get_bool("IsReleaseBranch")
is_release_sp = self.params.get_bool("IsReleaseSpBranch")
if CI is None:
+1 -1
View File
@@ -11,7 +11,7 @@ FOOTNOTE_TAG = "<sup>{}</sup>"
STAR_ICON = '<a href="##"><img valign="top" ' + \
'src="https://media.githubusercontent.com/media/commaai/openpilot/master/docs/assets/icon-star-{}.svg" width="22" /></a>'
VIDEO_ICON = '<a href="{}" target="_blank">' + \
'<img height="18px" src="https://media.githubusercontent.com/media/commaai/openpilot/master/docs/assets/icon-youtube.svg"></img></a>'
'<img height="18px" src="https://media.githubusercontent.com/media/commaai/openpilot/master/docs/assets/icon-youtube.svg" /></a>'
COLUMNS = "|" + "|".join([column.value for column in Column]) + "|"
COLUMN_HEADER = "|---|---|---|{}|".format("|".join([":---:"] * (len(Column) - 3)))
ARROW_SYMBOL = "➡️"
+35 -11
View File
@@ -1,6 +1,9 @@
import os
import glob
import json
import os
from SCons.Script import Value
from openpilot.common.file_chunker import chunk_file, get_chunk_paths
from tinygrad import Device
Import('env', 'arch')
chunker_file = File("#common/file_chunker.py")
@@ -13,31 +16,52 @@ tinygrad_files = ["#"+x for x in glob.glob(env.Dir("#tinygrad_repo").relpath + "
def estimate_pickle_max_size(onnx_size):
return 1.2 * onnx_size + 10 * 1024 * 1024 # 20% + 10MB is plenty
# compile warp
# THREADS=0 is need to prevent bug: https://github.com/tinygrad/tinygrad/issues/14689
tg_flags = {
'larch64': 'DEV=QCOM FLOAT16=1 NOLOCALS=1 JIT_BATCH_SIZE=0',
'Darwin': f'DEV=CPU THREADS=0 HOME={os.path.expanduser("~")}', # tinygrad calls brew which needs a $HOME in the env
}.get(arch, 'DEV=CPU CPU_LLVM=1 THREADS=0')
# get fastest TG config
available = set(Device.get_available_devices())
# FIXME-SP: reset when we bump tg
if False: # 'CUDA' in available:
tg_backend = 'CUDA'
tg_flags = f'DEV={tg_backend}'
elif 'QCOM' in available:
tg_backend = 'QCOM'
tg_flags = f'DEV={tg_backend} FLOAT16=1 NOLOCALS=1 JIT_BATCH_SIZE=0'
else:
tg_backend = 'CPU' if arch == 'Darwin' else 'CPU CPU_LLVM=1' # FIXME-SP: reset when we bump tg
tg_flags = f'DEV={tg_backend} THREADS=0'
def write_tg_compiled_flags(target, source, env):
with open(str(target[0]), "w") as f:
json.dump({"DEV": tg_backend}, f)
f.write("\n")
compiled_flags_node = lenv.Command(
File("models/tg_compiled_flags.json").abspath,
tinygrad_files + [Value(tg_backend)],
write_tg_compiled_flags,
)
# tinygrad calls brew which needs a $HOME in the env
mac_brew_string = f'HOME={os.path.expanduser("~")}' if arch == 'Darwin' else ''
# Get model metadata
for model_name in ['driving_vision', 'driving_policy', 'dmonitoring_model']:
fn = File(f"models/{model_name}").abspath
script_files = [File(Dir("#selfdrive/modeld").File("get_model_metadata.py").abspath)]
cmd = f'{tg_flags} python3 {Dir("#selfdrive/modeld").abspath}/get_model_metadata.py {fn}.onnx'
lenv.Command(fn + "_metadata.pkl", [fn + ".onnx"] + tinygrad_files + script_files, cmd)
cmd = f'{tg_flags} {mac_brew_string} python3 {Dir("#selfdrive/modeld").abspath}/get_model_metadata.py {fn}.onnx'
lenv.Command(fn + "_metadata.pkl", [fn + ".onnx"] + tinygrad_files + script_files + [compiled_flags_node], cmd)
image_flag = {
'larch64': 'IMAGE=2',
}.get(arch, 'IMAGE=0')
script_files = [File(Dir("#selfdrive/modeld").File("compile_warp.py").abspath)]
compile_warp_cmd = f'{tg_flags} python3 {Dir("#selfdrive/modeld").abspath}/compile_warp.py '
compile_warp_cmd = f'{tg_flags} {mac_brew_string} python3 {Dir("#selfdrive/modeld").abspath}/compile_warp.py '
from openpilot.common.transformations.camera import _ar_ox_fisheye, _os_fisheye
warp_targets = []
for cam in [_ar_ox_fisheye, _os_fisheye]:
w, h = cam.width, cam.height
warp_targets += [File(f"models/warp_{w}x{h}_tinygrad.pkl").abspath, File(f"models/dm_warp_{w}x{h}_tinygrad.pkl").abspath]
lenv.Command(warp_targets, tinygrad_files + script_files, compile_warp_cmd)
lenv.Command(warp_targets, tinygrad_files + script_files + [compiled_flags_node], compile_warp_cmd)
def tg_compile(flags, model_name):
pythonpath_string = 'PYTHONPATH="${PYTHONPATH}:' + env.Dir("#tinygrad_repo").abspath + '"'
@@ -47,7 +71,7 @@ def tg_compile(flags, model_name):
chunk_targets = get_chunk_paths(pkl, estimate_pickle_max_size(os.path.getsize(onnx_path)))
compile_node = lenv.Command(
pkl,
[onnx_path] + tinygrad_files + [chunker_file],
[onnx_path] + tinygrad_files + [chunker_file, compiled_flags_node],
f'{pythonpath_string} {flags} {image_flag} python3 {Dir("#tinygrad_repo").abspath}/examples/openpilot/compile3.py {fn}.onnx {pkl}',
)
def do_chunk(target, source, env):
+10 -18
View File
@@ -97,8 +97,8 @@ def make_update_img_input(frame_prepare, model_w, model_h):
def update_img_input_tinygrad(tensor, frame, M_inv):
M_inv = M_inv.to(Device.DEFAULT)
new_img = frame_prepare(frame, M_inv)
full_buffer = tensor[6:].cat(new_img, dim=0).contiguous()
return full_buffer, Tensor.cat(full_buffer[:6], full_buffer[-6:], dim=0).contiguous().reshape(1, 12, model_h//2, model_w//2)
tensor.assign(tensor[6:].cat(new_img, dim=0).contiguous())
return Tensor.cat(tensor[:6], tensor[-6:], dim=0).contiguous().reshape(1, 12, model_h//2, model_w//2)
return update_img_input_tinygrad
@@ -107,9 +107,9 @@ def make_update_both_imgs(frame_prepare, model_w, model_h):
def update_both_imgs_tinygrad(calib_img_buffer, new_img, M_inv,
calib_big_img_buffer, new_big_img, M_inv_big):
calib_img_buffer, calib_img_pair = update_img(calib_img_buffer, new_img, M_inv)
calib_big_img_buffer, calib_big_img_pair = update_img(calib_big_img_buffer, new_big_img, M_inv_big)
return calib_img_buffer, calib_img_pair, calib_big_img_buffer, calib_big_img_pair
calib_img_pair = update_img(calib_img_buffer, new_img, M_inv)
calib_big_img_pair = update_img(calib_big_img_buffer, new_big_img, M_inv_big)
return calib_img_pair, calib_big_img_pair
return update_both_imgs_tinygrad
@@ -136,29 +136,20 @@ def compile_modeld_warp(cam_w, cam_h):
full_buffer = Tensor.zeros(IMG_BUFFER_SHAPE, dtype='uint8').contiguous().realize()
big_full_buffer = Tensor.zeros(IMG_BUFFER_SHAPE, dtype='uint8').contiguous().realize()
full_buffer_np = np.zeros(IMG_BUFFER_SHAPE, dtype=np.uint8)
big_full_buffer_np = np.zeros(IMG_BUFFER_SHAPE, dtype=np.uint8)
new_frame_np = np.random.randint(0, 256, yuv_size, dtype=np.uint8)
new_big_frame_np = np.random.randint(0, 256, yuv_size, dtype=np.uint8)
for i in range(10):
new_frame_np = (32 * np.random.randn(yuv_size).astype(np.float32) + 128).clip(0, 255).astype(np.uint8)
img_inputs = [full_buffer,
Tensor.from_blob(new_frame_np.ctypes.data, (yuv_size,), dtype='uint8').realize(),
Tensor(Tensor.randn(3, 3).mul(8).realize().numpy(), device='NPY')]
new_big_frame_np = (32 * np.random.randn(yuv_size).astype(np.float32) + 128).clip(0, 255).astype(np.uint8)
big_img_inputs = [big_full_buffer,
Tensor.from_blob(new_big_frame_np.ctypes.data, (yuv_size,), dtype='uint8').realize(),
Tensor(Tensor.randn(3, 3).mul(8).realize().numpy(), device='NPY')]
inputs = img_inputs + big_img_inputs
Device.default.synchronize()
inputs_np = [x.numpy() for x in inputs]
inputs_np[0] = full_buffer_np
inputs_np[3] = big_full_buffer_np
st = time.perf_counter()
out = update_img_jit(*inputs)
full_buffer = out[0].contiguous().realize().clone()
big_full_buffer = out[2].contiguous().realize().clone()
_ = update_img_jit(*inputs)
mt = time.perf_counter()
Device.default.synchronize()
et = time.perf_counter()
@@ -182,8 +173,9 @@ def compile_dm_warp(cam_w, cam_h):
warp_dm = make_warp_dm(cam_w, cam_h, dm_w, dm_h)
warp_dm_jit = TinyJit(warp_dm, prune=True)
new_frame_np = np.random.randint(0, 256, yuv_size, dtype=np.uint8)
for i in range(10):
inputs = [Tensor.from_blob((32 * Tensor.randn(yuv_size,) + 128).cast(dtype='uint8').realize().numpy().ctypes.data, (yuv_size,), dtype='uint8'),
inputs = [Tensor.from_blob(new_frame_np.ctypes.data, (yuv_size,), dtype='uint8').realize(),
Tensor(Tensor.randn(3, 3).mul(8).realize().numpy(), device='NPY')]
Device.default.synchronize()
st = time.perf_counter()
+7 -4
View File
@@ -1,12 +1,16 @@
#!/usr/bin/env python3
import os
from openpilot.selfdrive.modeld.tinygrad_helpers import MODELS_DIR, set_tinygrad_backend_from_compiled_flags
set_tinygrad_backend_from_compiled_flags()
# FIXME-SP: remove once we bump tg
from openpilot.system.hardware import TICI
os.environ['DEV'] = 'QCOM' if TICI else 'CPU'
from tinygrad.tensor import Tensor
import time
import pickle
import numpy as np
from pathlib import Path
from cereal import messaging
from cereal.messaging import PubMaster, SubMaster
@@ -21,9 +25,8 @@ from openpilot.selfdrive.modeld.parse_model_outputs import sigmoid, safe_exp
PROCESS_NAME = "selfdrive.modeld.dmonitoringmodeld"
SEND_RAW_PRED = os.getenv('SEND_RAW_PRED')
MODEL_PKL_PATH = Path(__file__).parent / 'models/dmonitoring_model_tinygrad.pkl'
METADATA_PATH = Path(__file__).parent / 'models/dmonitoring_model_metadata.pkl'
MODELS_DIR = Path(__file__).parent / 'models'
MODEL_PKL_PATH = MODELS_DIR / 'dmonitoring_model_tinygrad.pkl'
METADATA_PATH = MODELS_DIR / 'dmonitoring_model_metadata.pkl'
class ModelState:
inputs: dict[str, np.ndarray]
+6 -4
View File
@@ -1,7 +1,12 @@
#!/usr/bin/env python3
import os
from openpilot.selfdrive.modeld.tinygrad_helpers import MODELS_DIR, set_tinygrad_backend_from_compiled_flags
set_tinygrad_backend_from_compiled_flags()
# FIXME-SP: remove once we bump tg
from openpilot.system.hardware import TICI
os.environ['DEV'] = 'QCOM' if TICI else 'CPU'
USBGPU = "USBGPU" in os.environ
if USBGPU:
os.environ['DEV'] = 'AMD'
@@ -12,7 +17,6 @@ import pickle
import numpy as np
import cereal.messaging as messaging
from cereal import car, log
from pathlib import Path
from cereal.messaging import PubMaster, SubMaster
from msgq.visionipc import VisionIpcClient, VisionStreamType, VisionBuf
from opendbc.car.car_helpers import get_demo_car_params
@@ -37,7 +41,6 @@ from openpilot.sunnypilot.modeld_v2.modeld_base import ModelStateBase
PROCESS_NAME = "selfdrive.modeld.modeld"
SEND_RAW_PRED = os.getenv('SEND_RAW_PRED')
MODELS_DIR = Path(__file__).parent / 'models'
VISION_PKL_PATH = MODELS_DIR / 'driving_vision_tinygrad.pkl'
VISION_METADATA_PATH = MODELS_DIR / 'driving_vision_metadata.pkl'
POLICY_PKL_PATH = MODELS_DIR / 'driving_policy_tinygrad.pkl'
@@ -217,8 +220,7 @@ class ModelState(ModelStateBase):
out = self.update_imgs(self.img_queues['img'], self.full_frames['img'], self.transforms['img'],
self.img_queues['big_img'], self.full_frames['big_img'], self.transforms['big_img'])
self.img_queues['img'], self.img_queues['big_img'] = out[0].realize(), out[2].realize()
vision_inputs = {'img': out[1], 'big_img': out[3]}
vision_inputs = {'img': out[0], 'big_img': out[1]}
if prepare_only:
return None
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:853c6634746ff439a848349d00e4d5581cd941f13f7c1862c31b72a31cc24858
size 14061595
oid sha256:78477124cbf3ffe30fa951ebada8410b43c4242c6054584d656f1d329b067e15
size 14060847
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:940e9006a25f27f0b6e85da798e6a8fd1f6dd492dd7d0b9ff1a9436460f46129
size 46887794
oid sha256:ee29ee5bce84d1ce23e9ff381280de9b4e4d96d2934cd751740354884e112c66
size 46877473
+12
View File
@@ -0,0 +1,12 @@
import json
import os
from pathlib import Path
MODELS_DIR = Path(__file__).parent / 'models'
COMPILED_FLAGS_PATH = MODELS_DIR / 'tg_compiled_flags.json'
def set_tinygrad_backend_from_compiled_flags() -> None:
if os.path.isfile(COMPILED_FLAGS_PATH):
with open(COMPILED_FLAGS_PATH) as f:
os.environ['DEV'] = str(json.load(f)['DEV'])
+1 -1
View File
@@ -434,7 +434,7 @@ class DriverMonitoring:
enabled = sm['selfdriveState'].enabled or sm['carControl'].latActive
wrong_gear = sm['carState'].gearShifter not in (car.CarState.GearShifter.drive, car.CarState.GearShifter.low)
standstill = sm['carState'].standstill
driver_engaged = sm['carState'].steeringPressed or sm['carState'].gasPressed
driver_engaged = sm['carState'].steeringPressed or (sm['selfdriveState'].enabled and sm['carState'].gasPressed)
brake_disengage_prob = sm['modelV2'].meta.disengagePredictions.brakeDisengageProbs[0] # brake disengage prob in next 2s
rpyCalib = sm['liveCalibration'].rpyCalib
self._set_policy(
+31 -47
View File
@@ -215,64 +215,48 @@ class TestMonitoring:
events[int((INVISIBLE_SECONDS_TO_RED-1+DT_DMON*d_status.settings._HI_STD_FALLBACK_TIME+0.1)/DT_DMON)].names
@pytest.mark.parametrize("enabled_state, lat_active_state, expected", [
(False, False, False), # Both Disabled
(True, False, True), # OP Enabled, Lat Inactive
(False, True, True), # OP Disabled, Lat Active (e.g. MADS)
(True, True, True) # Both Active
])
def test_enabled_states(enabled_state, lat_active_state, expected):
"""
Test DriverMonitoring.run_step with all 4 combinations of:
- selfdriveState.enabled (True/False)
- carControl.latActive (True/False)
"""
def _build_sm(selfdrive_enabled, lat_active, steering_pressed, gas_pressed):
cs = car.CarState.new_message()
cs.vEgo = 30.0
cs.gearShifter = car.CarState.GearShifter.drive
cs.standstill = False
cs.steeringPressed = False
cs.gasPressed = False
cs.steeringPressed = steering_pressed
cs.gasPressed = gas_pressed
ss = log.SelfdriveState.new_message()
ss.enabled = enabled_state
ss.enabled = selfdrive_enabled
cc = car.CarControl.new_message()
cc.latActive = lat_active_state
cc.latActive = lat_active
mv2 = log.ModelDataV2.new_message()
mv2.meta.disengagePredictions.brakeDisengageProbs = [0.0]
lc = log.LiveCalibrationData.new_message()
lc.rpyCalib = [0.0, 0.0, 0.0]
ds = make_msg(False)
sm = {
'carState': cs,
'selfdriveState': ss,
'carControl': cc,
'modelV2': mv2,
'liveCalibration': lc,
'driverStateV2': ds
return {
'carState': cs, 'selfdriveState': ss, 'carControl': cc,
'modelV2': mv2, 'liveCalibration': lc, 'driverStateV2': make_msg(False),
}
driver_monitoring = DriverMonitoring()
# run_test doesn't assign enabled to a variable, so we need to spy on _update_events to see its value
captured_args = []
original_update_events = driver_monitoring._update_events
@pytest.mark.parametrize("selfdrive_enabled, lat_active, steering, gas, expected_op_engaged, expected_driver_engaged", [
(False, False, False, False, False, False), # disabled
(True, False, False, False, True, False), # OP enabled
(False, True, False, False, True, False), # MADS lat-only
(True, True, False, False, True, False), # both active
(False, True, False, True, True, False), # MADS lat-only + gas
(True, True, False, True, True, True), # full op + gas: override
(False, True, True, False, True, True), # MADS lat-only + wheel touch: override
])
def test_run_step_engagement(selfdrive_enabled, lat_active, steering, gas,
expected_op_engaged, expected_driver_engaged):
sm = _build_sm(selfdrive_enabled, lat_active, steering, gas)
dm = DriverMonitoring()
captured = {}
orig = dm._update_events
def spy_update_events(driver_engaged, op_engaged, standstill, wrong_gear, car_speed):
captured_args.append(op_engaged)
return original_update_events(driver_engaged, op_engaged, standstill, wrong_gear, car_speed)
def spy(driver_engaged, op_engaged, standstill, wrong_gear, car_speed):
captured['driver_engaged'] = driver_engaged
captured['op_engaged'] = op_engaged
return orig(driver_engaged, op_engaged, standstill, wrong_gear, car_speed)
driver_monitoring._update_events = spy_update_events
driver_monitoring.run_step(sm, demo=False)
# Assertion
assert len(captured_args) == 1, "Expected _update_events to be called exactly once"
actual_enabled = captured_args[0]
assert actual_enabled == expected, f"Expected op_engaged={expected}, but got {actual_enabled}"
dm._update_events = spy
dm.run_step(sm, demo=False)
assert captured['op_engaged'] == expected_op_engaged
assert captured['driver_engaged'] == expected_driver_engaged
+19 -2
View File
@@ -299,7 +299,7 @@ void process_panda_state(Panda *panda, PubMaster *pm, bool engaged, bool engaged
panda->send_heartbeat(engaged, engaged_mads);
}
void process_peripheral_state(Panda *panda, PubMaster *pm, bool no_fan_control) {
void process_peripheral_state(Panda *panda, PubMaster *pm, bool no_fan_control, bool is_onroad) {
static Params params;
static SubMaster sm({"deviceState", "driverCameraState"});
@@ -309,6 +309,8 @@ void process_peripheral_state(Panda *panda, PubMaster *pm, bool no_fan_control)
static int prev_ir_pwr = 999;
static uint32_t prev_frame_id = UINT32_MAX;
static bool driver_view = false;
static bool not_car = false;
static bool not_car_checked = false;
// TODO: can we merge these?
static FirstOrderFilter integ_lines_filter(0, 30.0, 0.05);
@@ -354,6 +356,21 @@ void process_peripheral_state(Panda *panda, PubMaster *pm, bool no_fan_control)
ir_pwr = 0;
}
// turn off IR leds if body
if (!not_car_checked && is_onroad) {
std::string cp_bytes = params.get("CarParams");
if (cp_bytes.size() > 0) {
AlignedBuffer aligned_buf;
capnp::FlatArrayMessageReader cmsg(aligned_buf.align(cp_bytes.data(), cp_bytes.size()));
cereal::CarParams::Reader CP = cmsg.getRoot<cereal::CarParams>();
not_car = CP.getNotCar();
not_car_checked = true;
}
}
if (not_car) {
ir_pwr = 0;
}
if (ir_pwr != prev_ir_pwr || sm.frame % 100 == 0) {
int16_t ir_panda = util::map_val(ir_pwr, 0, 100, 0, MAX_IR_PANDA_VAL);
panda->set_ir_pwr(ir_panda);
@@ -387,7 +404,7 @@ void pandad_run(Panda *panda) {
// Process peripheral state at 20 Hz
if (rk.frame() % 5 == 0) {
process_peripheral_state(panda, &pm, no_fan_control);
process_peripheral_state(panda, &pm, no_fan_control, is_onroad);
}
// Process panda state at 10 Hz
+1 -1
View File
@@ -230,7 +230,7 @@ class SelfdriveD(CruiseHelper):
if self.CP.notCar:
# wait for everything to init first
if self.sm.frame > int(5. / DT_CTRL) and self.initialized:
if self.sm.frame > int(2. / DT_CTRL) and self.initialized:
# body always wants to enable
self.events.add(EventName.pcmEnable)
@@ -76,7 +76,7 @@ def _diff_capnp_values(v1, v2, path, tolerance):
for i in range(n):
yield from _diff_capnp_values(v1[i], v2[i], path + (str(i),), tolerance)
if n2 > n:
yield 'add', dot, list(enumerate(v2[n:], n))
yield 'add', dot, [(i, v2[i]) for i in range(n, n2)]
if n1 > n:
yield 'remove', dot, list(reversed([(i, v1[i]) for i in range(n, n1)]))
@@ -49,6 +49,8 @@ def diff_format(diffs, ref, new, field) -> list[str]:
msg_type = field.split(".")[0]
ref_ts = [(m.logMonoTime, MsgWrap(m)) for m in ref.get(msg_type, [])]
new_wrapped = [MsgWrap(m) for m in new.get(msg_type, [])]
if not ref_ts or not new_wrapped:
return format_numeric_diffs(diffs)
return format_diff(diffs, ref_ts, new_wrapped, field)
+1 -1
View File
@@ -36,7 +36,7 @@ class DeveloperLayout(Widget):
def __init__(self):
super().__init__()
self._params = Params()
self._is_release = self._params.get_bool("IsReleaseBranch")
self._is_release = False # self._params.get_bool("IsReleaseBranch")
# Build items and keep references for callbacks/state updates
self._adb_toggle = toggle_item(
+1 -1
View File
@@ -42,7 +42,7 @@ class TogglesLayout(Widget):
def __init__(self):
super().__init__()
self._params = Params()
self._is_release = self._params.get_bool("IsReleaseBranch")
self._is_release = False # self._params.get_bool("IsReleaseBranch")
# param, title, desc, icon, needs_restart
self._toggle_defs = {
+56 -4
View File
@@ -7,13 +7,15 @@ from collections.abc import Callable
from openpilot.system.ui.widgets import Widget
from openpilot.system.ui.widgets.layouts import HBoxLayout
from openpilot.system.ui.widgets.icon_widget import IconWidget
from openpilot.system.ui.widgets.label import UnifiedLabel
from openpilot.system.ui.widgets.label import UnifiedLabel, gui_label
from openpilot.system.ui.lib.application import gui_app, FontWeight, MousePos
from openpilot.selfdrive.ui.ui_state import ui_state
from openpilot.system.version import RELEASE_BRANCHES
HEAD_BUTTON_FONT_SIZE = 40
HOME_PADDING = 8
SETTINGS_ZONE_WIDTH = 280
ALERTS_ZONE_WIDTH = 180
NetworkType = log.DeviceState.NetworkType
@@ -28,6 +30,37 @@ NETWORK_TYPES = {
}
class AlertsPill(Widget):
ICON_OFFSET = 12
COUNT_OFFSET = 40
def __init__(self):
super().__init__()
self.set_rect(rl.Rectangle(0, 0, 104, 52))
self._pill_bg_txt = gui_app.texture("icons_mici/alerts_pill.png", 104, 52)
self._warning_txt = gui_app.texture("icons_mici/offroad_alerts/red_warning.png", 36, 36)
self._alert_count_callback: Callable[[], int] | None = None
def set_alert_count_callback(self, callback: Callable[[], int] | None):
self._alert_count_callback = callback
def _render(self, _):
alert_count = self._alert_count_callback() if self._alert_count_callback else 0
if alert_count > 0:
pill_w, pill_h = self._pill_bg_txt.width, self._pill_bg_txt.height
rl.draw_texture_ex(self._pill_bg_txt, rl.Vector2(self.rect.x, self.rect.y), 0.0, 1.0, rl.WHITE)
warn_x = self.rect.x + self.ICON_OFFSET
warn_y = self.rect.y + (pill_h - self._warning_txt.height) / 2
rl.draw_texture_ex(self._warning_txt, rl.Vector2(warn_x, warn_y), 0.0, 1.0, rl.WHITE)
count_rect = rl.Rectangle(self.rect.x + self.COUNT_OFFSET, self.rect.y, pill_w - self.COUNT_OFFSET, pill_h)
gui_label(count_rect, str(alert_count), font_size=36,
alignment=rl.GuiTextAlignment.TEXT_ALIGN_CENTER,
alignment_vertical=rl.GuiTextAlignmentVertical.TEXT_ALIGN_MIDDLE)
class NetworkIcon(Widget):
def __init__(self):
super().__init__()
@@ -84,6 +117,8 @@ class MiciHomeLayout(Widget):
def __init__(self):
super().__init__()
self._on_settings_click: Callable | None = None
self._on_alerts_click: Callable | None = None
self._alert_count_callback: Callable[[], int] | None = None
self._last_refresh = 0
self._mouse_down_t: None | float = None
@@ -96,6 +131,8 @@ class MiciHomeLayout(Widget):
self._experimental_icon = IconWidget("icons_mici/experimental_mode.png", (48, 48))
self._mic_icon = IconWidget("icons_mici/microphone.png", (32, 46))
self._alerts_pill = AlertsPill()
self._status_bar_layout = HBoxLayout([
IconWidget("icons_mici/settings.png", (48, 48), opacity=0.9),
NetworkIcon(),
@@ -141,13 +178,23 @@ class MiciHomeLayout(Widget):
self._last_refresh = rl.get_time()
self._update_params()
def set_callbacks(self, on_settings: Callable | None = None):
def set_callbacks(self, on_settings: Callable | None = None, on_alerts: Callable | None = None,
alert_count_callback: Callable[[], int] | None = None):
self._on_settings_click = on_settings
self._on_alerts_click = on_alerts
self._alert_count_callback = alert_count_callback
self._alerts_pill.set_alert_count_callback(alert_count_callback)
def _handle_mouse_release(self, mouse_pos: MousePos):
if not self._did_long_press:
if self._on_settings_click:
self._on_settings_click()
relative_x = mouse_pos.x - self.rect.x
has_alerts = self._alert_count_callback and self._alert_count_callback() > 0
if relative_x < SETTINGS_ZONE_WIDTH:
if self._on_settings_click:
self._on_settings_click()
elif has_alerts and relative_x > self.rect.width - ALERTS_ZONE_WIDTH:
if self._on_alerts_click:
self._on_alerts_click()
self._did_long_press = False
def _get_version_text(self) -> tuple[str, str, str, str] | None:
@@ -203,3 +250,8 @@ class MiciHomeLayout(Widget):
footer_rect = rl.Rectangle(self.rect.x + HOME_PADDING, self.rect.y + self.rect.height - 48, self.rect.width - HOME_PADDING, 48)
self._status_bar_layout.render(footer_rect)
# TODO: add alignment to hboxlayout and add to there
self._alerts_pill.set_position(self.rect.x + self.rect.width - self._alerts_pill.rect.width - HOME_PADDING,
self.rect.y + self.rect.height - self._alerts_pill.rect.height)
self._alerts_pill.render()
+10 -1
View File
@@ -60,7 +60,11 @@ class MiciMainLayout(Scroller):
gui_app.push_widget(self._onboarding_window)
def _setup_callbacks(self):
self._home_layout.set_callbacks(on_settings=lambda: gui_app.push_widget(self._settings_layout))
self._home_layout.set_callbacks(
on_settings=lambda: gui_app.push_widget(self._settings_layout),
on_alerts=lambda: self._scroll_to(self._alerts_layout),
alert_count_callback=self._alerts_layout.active_alerts,
)
self._onroad_layout.set_click_callback(lambda: self._scroll_to(self._home_layout))
device.add_interactive_timeout_callback(self._on_interactive_timeout)
@@ -68,6 +72,11 @@ class MiciMainLayout(Scroller):
layout_x = int(layout.rect.x)
self._scroller.scroll_to(layout_x, smooth=True)
def _update_state(self):
super()._update_state()
# TODO: Hack to run alert updates while not in view. Add a nav stack tick?
self._alerts_layout._update_state()
def _render(self, _):
if not self._setup:
if self._alerts_layout.active_alerts() > 0:
@@ -178,6 +178,8 @@ class AugmentedRoadView(CameraView):
# update offroad label
if ui_state.panda_type == log.PandaState.PandaType.unknown:
self._offroad_label.set_text("system booting")
elif ui_state.ignition and not ui_state.started:
self._offroad_label.set_text("openpilot can't start\ncheck alerts")
else:
self._offroad_label.set_text("start the car to\nuse sunnypilot")
+16 -17
View File
@@ -6,11 +6,13 @@ from openpilot.common.filter_simple import FirstOrderFilter
from openpilot.system.ui.lib.application import gui_app
from openpilot.system.ui.widgets import Widget
from openpilot.selfdrive.ui.ui_state import ui_state
from openpilot.selfdrive.monitoring.helpers import face_orientation_from_net
AlertSize = log.SelfdriveState.AlertSize
DEBUG = False
# TODO: Only left for DM preview, remove
LOOKING_CENTER_THRESHOLD_UPPER = math.radians(6)
LOOKING_CENTER_THRESHOLD_LOWER = math.radians(3)
@@ -59,8 +61,6 @@ class DriverStateRenderer(Widget):
self._dm_person = gui_app.texture("icons_mici/onroad/driver_monitoring/dm_person.png", cone_and_person_size, cone_and_person_size)
self._dm_cone = gui_app.texture("icons_mici/onroad/driver_monitoring/dm_cone.png", cone_and_person_size, cone_and_person_size)
center_size = round(36 / self.BASE_SIZE * self._rect.width)
self._dm_center = gui_app.texture("icons_mici/onroad/driver_monitoring/dm_center.png", center_size, center_size)
self._dm_background = gui_app.texture("icons_mici/onroad/driver_monitoring/dm_background.png", int(self._rect.width), int(self._rect.height))
def set_should_draw(self, should_draw: bool):
@@ -113,16 +113,7 @@ class DriverStateRenderer(Widget):
dest_rect,
rl.Vector2(dest_rect.width / 2, dest_rect.height / 2),
self._rotation_filter.x - 90,
rl.Color(255, 255, 255, int(255 * self._fade_filter.x * (1 - self._looking_center_filter.x))),
)
rl.draw_texture_ex(
self._dm_center,
(int(self._rect.x + (self._rect.width - self._dm_center.width) / 2),
int(self._rect.y + (self._rect.height - self._dm_center.height) / 2)),
0,
1.0,
rl.Color(255, 255, 255, int(255 * self._fade_filter.x * self._looking_center_filter.x)),
rl.Color(255, 255, 255, int(255 * self._fade_filter.x)),
)
else:
@@ -174,11 +165,22 @@ class DriverStateRenderer(Widget):
# Get monitoring state
driver_data = self.get_driver_data()
driver_orient = driver_data.faceOrientation
driver_position = driver_data.facePosition
if len(driver_orient) != 3:
return
pitch, yaw, roll = driver_orient
# Calibrate orientation so looking straight ahead at road (instead of at device) is (0, 0, 0)
sm = ui_state.sm
if sm.valid['liveCalibration'] and len(sm['liveCalibration'].rpyCalib) == 3:
cal_rpy = sm['liveCalibration'].rpyCalib
else:
cal_rpy = [0.0, 0.0, 0.0]
_, pitch, yaw = face_orientation_from_net(driver_orient, driver_position, cal_rpy)
pitch += math.radians(6) # calib or DM pose is not accurate, add a fake upward pitch to bias forward
yaw = -yaw # undo sign flip in face_orientation_from_net to match UI convention
pitch = self._pitch_filter.update(pitch)
yaw = self._yaw_filter.update(yaw)
@@ -192,7 +194,6 @@ class DriverStateRenderer(Widget):
if DEBUG:
pitchd = math.degrees(pitch)
yawd = math.degrees(yaw)
rolld = math.degrees(roll)
rl.draw_line_ex((0, 100), (200, 100), 3, rl.RED)
rl.draw_line_ex((0, 120), (200, 120), 3, rl.RED)
@@ -200,13 +201,11 @@ class DriverStateRenderer(Widget):
pitch_x = 100 + pitchd
yaw_x = 100 + yawd
roll_x = 100 + rolld
rl.draw_circle(int(pitch_x), 100, 5, rl.GREEN)
rl.draw_circle(int(yaw_x), 120, 5, rl.GREEN)
rl.draw_circle(int(roll_x), 140, 5, rl.GREEN)
# filter head rotation, handling wrap-around
rotation = math.degrees(math.atan2(pitch, yaw))
rotation = math.degrees(math.atan2(pitch * 2, yaw)) # reduce yaw sensitivity
angle_diff = rotation - self._rotation_filter.x
angle_diff = ((angle_diff + 180) % 360) - 180
self._rotation_filter.update(self._rotation_filter.x + angle_diff)
@@ -120,20 +120,12 @@ class SteeringLayout(Widget):
def _update_state(self):
super()._update_state()
torque_allowed = True
torque_allowed = ui_state.CP is not None and ui_state.CP.steerControlType != car.CarParams.SteerControlType.angle
if ui_state.CP is not None:
mads_main_desc = self._mads_limited_desc if self._mads_settings_layout._mads_limited_settings() else self._mads_full_desc
self._mads_toggle.set_description(f"<b>{mads_main_desc}</b><br><br>{self._mads_base_desc}")
if ui_state.CP.steerControlType == car.CarParams.SteerControlType.angle:
ui_state.params.remove("EnforceTorqueControl")
ui_state.params.remove("NeuralNetworkLateralControl")
torque_allowed = False
else:
self._mads_toggle.set_description(f"<b>{self._mads_check_compat_desc}</b><br><br>{self._mads_base_desc}")
ui_state.params.remove("EnforceTorqueControl")
ui_state.params.remove("NeuralNetworkLateralControl")
torque_allowed = False
self._mads_toggle.action_item.set_enabled(ui_state.is_offroad())
self._mads_settings_button.action_item.set_enabled(ui_state.is_offroad() and self._mads_toggle.action_item.get_state())
@@ -5,8 +5,9 @@ This file is part of sunnypilot and is licensed under the MIT License.
See the LICENSE.md file in the root directory for more details.
"""
from openpilot.selfdrive.ui.mici.layouts.settings import settings as OP
from openpilot.selfdrive.ui.mici.layouts.settings.settings import SettingsBigButton
from openpilot.selfdrive.ui.mici.layouts.settings.device import DeviceLayoutMici
from openpilot.selfdrive.ui.mici.widgets.button import BigButton, BigCircleButton
from openpilot.selfdrive.ui.mici.widgets.button import BigCircleButton
from openpilot.selfdrive.ui.mici.widgets.dialog import BigConfirmationDialog, BigDialog
from openpilot.selfdrive.ui.sunnypilot.mici.layouts.sunnylink import SunnylinkLayoutMici
from openpilot.selfdrive.ui.sunnypilot.mici.layouts.models import ModelsLayoutMici
@@ -32,11 +33,11 @@ class SettingsLayoutSP(OP.SettingsLayout):
self.icon_offroad_slider = gui_app.texture("icons_mici/settings/device/lkas.png", BIG_ICON_SIZE, BIG_ICON_SIZE)
sunnylink_panel = SunnylinkLayoutMici(back_callback=gui_app.pop_widget)
sunnylink_btn = BigButton("sunnylink", "", gui_app.texture("icons_mici/settings/developer/ssh.png", ICON_SIZE, ICON_SIZE))
sunnylink_btn = SettingsBigButton(tr("sunnylink"), "", gui_app.texture("icons_mici/settings/developer/ssh.png", 55, 55))
sunnylink_btn.set_click_callback(lambda: gui_app.push_widget(sunnylink_panel))
models_panel = ModelsLayoutMici(back_callback=gui_app.pop_widget)
models_btn = BigButton("models", "", gui_app.texture("../../sunnypilot/selfdrive/assets/offroad/icon_models.png", ICON_SIZE, ICON_SIZE))
models_btn = SettingsBigButton(tr("models"), "", gui_app.texture("../../sunnypilot/selfdrive/assets/offroad/icon_models.png", ICON_SIZE, ICON_SIZE))
models_btn.set_click_callback(lambda: gui_app.push_widget(models_panel))
# onroad: enable button sits at the front (left of toggles)
@@ -4,6 +4,8 @@ Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors.
This file is part of sunnypilot and is licensed under the MIT License.
See the LICENSE.md file in the root directory for more details.
"""
import pyray as rl
from collections.abc import Callable
from cereal import custom
@@ -13,11 +15,43 @@ from openpilot.selfdrive.ui.sunnypilot.mici.layouts.onboarding import SunnylinkC
from openpilot.selfdrive.ui.sunnypilot.mici.widgets.sunnylink_pairing_dialog import SunnylinkPairingDialog
from openpilot.selfdrive.ui.ui_state import ui_state
from openpilot.sunnypilot.sunnylink.api import UNREGISTERED_SUNNYLINK_DONGLE_ID
from openpilot.system.ui.lib.application import gui_app, MousePos
from openpilot.system.ui.lib.application import gui_app, MousePos, FontWeight
from openpilot.system.ui.lib.multilang import tr
from openpilot.system.ui.widgets import Widget
from openpilot.system.ui.widgets.label import UnifiedLabel
from openpilot.system.ui.widgets.scroller import NavScroller
from openpilot.system.version import sunnylink_consent_version, sunnylink_consent_declined
class SunnylinkInfo(Widget):
def __init__(self):
super().__init__()
self.set_rect(rl.Rectangle(0, 0, 360, 180))
header_color = rl.Color(255, 255, 255, int(255 * 0.9))
subheader_color = rl.Color(255, 255, 255, int(255 * 0.9 * 0.65))
max_width = int(self._rect.width - 20)
self.device_id_header = UnifiedLabel(tr("device id"), 48, max_width=max_width, text_color=header_color,
font_weight=FontWeight.DISPLAY, shimmer=True)
self.device_id_text = UnifiedLabel(UNREGISTERED_SUNNYLINK_DONGLE_ID, 32, max_width=max_width, text_color=subheader_color,
font_weight=FontWeight.ROMAN, scroll=True)
self.sponsor_header = UnifiedLabel(tr("sponsor tier"), 48, max_width=max_width, text_color=header_color,
font_weight=FontWeight.DISPLAY, shimmer=True)
self.sponsor_text = UnifiedLabel("N/A", 32, max_width=max_width, text_color=subheader_color, font_weight=FontWeight.ROMAN)
def _render(self, _):
self.device_id_header.set_position(self._rect.x + 20, self._rect.y - 10)
self.device_id_header.render()
self.device_id_text.set_position(self._rect.x + 20, self._rect.y + 68 - 25)
self.device_id_text.render()
self.sponsor_header.set_position(self._rect.x + 20, self._rect.y + 114 - 30)
self.sponsor_header.render()
self.sponsor_text.set_position(self._rect.x + 20, self._rect.y + 161 - 25)
self.sponsor_text.render()
class SunnylinkLayoutMici(NavScroller):
def __init__(self, back_callback: Callable):
@@ -27,6 +61,8 @@ class SunnylinkLayoutMici(NavScroller):
self._backup_in_progress = False
self._sunnylink_enabled = ui_state.params.get("SunnylinkEnabled")
self._sunnylink_info = SunnylinkInfo()
self._sunnylink_toggle = BigToggle(text=tr("enable sunnylink"),
initial_state=self._sunnylink_enabled,
toggle_callback=self._sunnylink_toggle_callback)
@@ -40,6 +76,7 @@ class SunnylinkLayoutMici(NavScroller):
toggle_callback=self._sunnylink_uploader_callback)
self._scroller.add_widgets([
self._sunnylink_info,
self._sunnylink_toggle,
self._sunnylink_sponsor_button,
self._sunnylink_pair_button,
@@ -59,6 +96,10 @@ class SunnylinkLayoutMici(NavScroller):
self._sunnylink_uploader_toggle.set_visible(self._sunnylink_enabled)
self.handle_backup_restore_progress()
self._sunnylink_info.device_id_text.set_text(ui_state.params.get("SunnylinkDongleId") or UNREGISTERED_SUNNYLINK_DONGLE_ID)
self._sunnylink_info.sponsor_text.set_text(ui_state.sunnylink_state.get_sponsor_tier().name.lower() or "N/A")
self._sunnylink_info.set_visible(self._sunnylink_enabled)
if ui_state.sunnylink_state.is_sponsor():
self._sunnylink_sponsor_button.set_text(tr("thanks"))
self._sunnylink_sponsor_button.set_value(ui_state.sunnylink_state.get_sponsor_tier().name.lower())
@@ -75,6 +116,11 @@ class SunnylinkLayoutMici(NavScroller):
def show_event(self):
super().show_event()
ui_state.update_params()
ui_state.sunnylink_state.set_settings_open(True)
def hide_event(self):
super().hide_event()
ui_state.sunnylink_state.set_settings_open(False)
@staticmethod
def _sunnylink_toggle_callback(state: bool):
@@ -194,9 +240,14 @@ class SunnylinkPairBigButton(BigButton):
def _handle_mouse_release(self, mouse_pos: MousePos):
super()._handle_mouse_release(mouse_pos)
network_type = ui_state.sm["deviceState"].networkType
dlg: BigDialog | SunnylinkPairingDialog | None = None
if UNREGISTERED_SUNNYLINK_DONGLE_ID == (ui_state.params.get("SunnylinkDongleId") or UNREGISTERED_SUNNYLINK_DONGLE_ID):
dlg = BigDialog(tr("sunnylink Dongle ID not found. Please reboot & try again."), "")
if network_type == 0:
dlg = BigDialog(tr("no internet"), tr("please connect to WiFi & try again"))
elif UNREGISTERED_SUNNYLINK_DONGLE_ID == (ui_state.params.get("SunnylinkDongleId") or UNREGISTERED_SUNNYLINK_DONGLE_ID):
dlg = BigDialog(tr("sunnylink dongle id not found"), tr("please reboot & try again"))
elif self.sponsor_pairing:
dlg = SunnylinkPairingDialog(sponsor_pairing=True)
elif not self.sponsor_pairing:
@@ -141,7 +141,8 @@ class DeveloperUiRenderer(Widget):
# Add torque-specific elements if using torque control
if sm['controlsState'].lateralControlState.which() == 'torqueState':
if sm.valid['liveTorqueParameters']:
override_active = ui_state.enforce_torque_control and ui_state.custom_torque_params and ui_state.torque_override_enabled
if sm.valid['liveTorqueParameters'] or override_active:
elements.extend([
self.friction_elem.update(sm, ui_state.is_metric),
self.lat_accel_factor_elem.update(sm, ui_state.is_metric),
@@ -8,8 +8,7 @@ import pyray as rl
from dataclasses import dataclass
from openpilot.common.constants import CV
from openpilot.selfdrive.ui.ui_state import ui_state
from openpilot.system.ui.lib.text_measure import measure_text_cached
@@ -248,12 +247,12 @@ class FrictionCoefficientElement:
self.unit = ""
def update(self, sm, is_metric: bool) -> UiElement:
ltp = sm['liveTorqueParameters']
friction_coef = ltp.frictionCoefficientFiltered
live_valid = ltp.liveValid
if ui_state.enforce_torque_control and ui_state.custom_torque_params and ui_state.torque_override_enabled:
return UiElement(f"{ui_state.torque_override_friction:.3f}", "FRIC.", self.unit, rl.WHITE)
value = f"{friction_coef:.3f}"
color = rl.Color(0, 255, 0, 255) if live_valid else rl.WHITE
ltp = sm['liveTorqueParameters']
value = f"{ltp.frictionCoefficientFiltered:.3f}"
color = rl.Color(0, 255, 0, 255) if ltp.liveValid else rl.WHITE
return UiElement(value, "FRIC.", self.unit, color)
@@ -262,12 +261,12 @@ class LatAccelFactorElement:
self.unit = ""
def update(self, sm, is_metric: bool) -> UiElement:
ltp = sm['liveTorqueParameters']
lat_accel_factor = ltp.latAccelFactorFiltered
live_valid = ltp.liveValid
if ui_state.enforce_torque_control and ui_state.custom_torque_params and ui_state.torque_override_enabled:
return UiElement(f"{ui_state.torque_override_lat_accel_factor:.3f}", "L.A.F.", self.unit, rl.WHITE)
value = f"{lat_accel_factor:.3f}"
color = rl.Color(0, 255, 0, 255) if live_valid else rl.WHITE
ltp = sm['liveTorqueParameters']
value = f"{ltp.latAccelFactorFiltered:.3f}"
color = rl.Color(0, 255, 0, 255) if ltp.liveValid else rl.WHITE
return UiElement(value, "L.A.F.", self.unit, color)
+60 -9
View File
@@ -6,7 +6,7 @@ See the LICENSE.md file in the root directory for more details.
"""
from enum import Enum
from cereal import messaging, log, custom
from cereal import messaging, log, car, custom
from openpilot.common.params import Params
from openpilot.selfdrive.ui.sunnypilot.layouts.settings.display import OnroadBrightness
from openpilot.sunnypilot.sunnylink.sunnylink_state import SunnylinkState
@@ -26,22 +26,20 @@ class OnroadTimerStatus(Enum):
class UIStateSP:
def __init__(self):
self.CP_SP: custom.CarParamsSP | None = None
self.params = Params()
self.CP_SP: custom.CarParamsSP | None = None
self.has_icbm: bool = False
self.is_sp_release: bool = self.params.get_bool("IsReleaseSpBranch")
self.sm_services_ext = [
"modelManagerSP", "selfdriveStateSP", "longitudinalPlanSP", "backupManagerSP",
"gpsLocation", "liveTorqueParameters", "carStateSP", "liveMapDataSP", "carParamsSP", "liveDelay"
]
self.sunnylink_state = SunnylinkState()
self.update_params()
self.onroad_brightness_timer: int = 0
self.custom_interactive_timeout: int = self.params.get("InteractivityTimeout", return_default=True)
self.reset_onroad_sleep_timer()
self.CP_SP: custom.CarParamsSP | None = None
self.has_icbm: bool = False
self.is_sp_release: bool = self.params.get_bool("IsReleaseSpBranch")
self.custom_interactive_timeout: int = 0
self._sp_initialized: bool = False
def update(self) -> None:
if self.sunnylink_enabled:
@@ -128,6 +126,8 @@ class UIStateSP:
if CP_SP_bytes is not None:
self.CP_SP = messaging.log_from_bytes(CP_SP_bytes, custom.CarParamsSP)
self.has_icbm = self.CP_SP.intelligentCruiseButtonManagementAvailable and self.params.get_bool("IntelligentCruiseButtonManagement")
self._enforce_constraints()
self.active_bundle = self.params.get("ModelManager_ActiveBundle")
self.blindspot = self.params.get_bool("BlindSpot")
self.chevron_metrics = self.params.get("ChevronInfo")
@@ -143,11 +143,63 @@ class UIStateSP:
self.standstill_timer = self.params.get_bool("StandstillTimer")
self.sunnylink_enabled = self.params.get_bool("SunnylinkEnabled")
self.torque_bar = self.params.get_bool("TorqueBar")
self.enforce_torque_control = self.params.get_bool("EnforceTorqueControl")
self.custom_torque_params = self.params.get_bool("CustomTorqueParams")
self.torque_override_enabled = self.params.get_bool("TorqueParamsOverrideEnabled")
self.torque_override_lat_accel_factor = float(self.params.get("TorqueParamsOverrideLatAccelFactor", return_default=True))
self.torque_override_friction = float(self.params.get("TorqueParamsOverrideFriction", return_default=True))
self.true_v_ego_ui = self.params.get_bool("TrueVEgoUI")
self.turn_signals = self.params.get_bool("ShowTurnSignals")
self.boot_offroad_mode = self.params.get("DeviceBootMode", return_default=True)
self.always_offroad = self.params.get_bool("OffroadMode")
if not self._sp_initialized:
self._sp_initialized = True
self.reset_onroad_sleep_timer()
def _enforce_constraints(self) -> None:
has_long = self.has_longitudinal_control
CP = self.CP
if CP is not None:
# Angle steering: no torque-based lateral controls
if CP.steerControlType == car.CarParams.SteerControlType.angle:
self.params.remove("EnforceTorqueControl")
self.params.remove("NeuralNetworkLateralControl")
# Alpha longitudinal: clear if not available
if not CP.alphaLongitudinalAvailable:
self.params.remove("AlphaLongitudinalEnabled")
# BSM not available: clear BSM-dependent settings
if not CP.enableBsm:
self.params.remove("AutoLaneChangeBsmDelay")
else:
# No CarParams: clear all car-dependent params as safety default
self.params.remove("EnforceTorqueControl")
self.params.remove("NeuralNetworkLateralControl")
self.params.remove("AlphaLongitudinalEnabled")
# No longitudinal control: no experimental mode or DEC
if not has_long:
self.params.remove("ExperimentalMode")
self.params.remove("DynamicExperimentalControl")
# ICBM: clear if not available or if full longitudinal control is active
if self.CP_SP is not None:
if not self.CP_SP.intelligentCruiseButtonManagementAvailable or has_long:
self.params.remove("IntelligentCruiseButtonManagement")
self.has_icbm = False
else:
self.params.remove("IntelligentCruiseButtonManagement")
self.has_icbm = False
# Cruise features requiring longitudinal or ICBM
if not (has_long or self.has_icbm):
self.params.remove("CustomAccIncrementsEnabled")
self.params.remove("SmartCruiseControlVision")
self.params.remove("SmartCruiseControlMap")
class DeviceSP:
@staticmethod
@@ -163,7 +215,6 @@ class DeviceSP:
if _ui_state.onroad_brightness_timer != 0:
if _ui_state.onroad_brightness == OnroadBrightness.AUTO_DARK:
return max(30.0, cur_brightness)
# For AUTO (Default) and Manual modes (while timer running), use standard brightness
return cur_brightness
# 0: Auto (Default), 1: Auto (Dark), 2: Screen Off
+1 -1
View File
@@ -74,7 +74,7 @@ class UIState(UIStateSP):
# Core state variables
self.is_metric: bool = self.params.get_bool("IsMetric")
self.is_release = self.params.get_bool("IsReleaseBranch")
self.is_release = False # self.params.get_bool("IsReleaseBranch")
self.always_on_dm: bool = self.params.get_bool("AlwaysOnDM")
self.started: bool = False
self.ignition: bool = False
+1 -1
View File
@@ -1 +1 @@
#define SUNNYPILOT_VERSION "2026.001.000"
#define SUNNYPILOT_VERSION "2026.001.005"
+1
View File
@@ -147,6 +147,7 @@ class ModularAssistiveDrivingSystem:
self.events.remove(EventName.speedTooLow)
self.events.remove(EventName.cruiseDisabled)
self.events.remove(EventName.manualRestart)
self.events.remove(EventName.espActive)
selfdrive_enable_events = self.events.has(EventName.pcmEnable) or self.events.has(EventName.buttonEnable)
set_speed_btns_enable = any(be.type in SET_SPEED_BUTTONS for be in CS.buttonEvents)
+5 -14
View File
@@ -33,29 +33,20 @@ def compile_v2_warp(cam_w, cam_h, buffer_length):
full_buffer = Tensor.zeros(img_buffer_shape, dtype='uint8').contiguous().realize()
big_full_buffer = Tensor.zeros(img_buffer_shape, dtype='uint8').contiguous().realize()
full_buffer_np = np.zeros(img_buffer_shape, dtype=np.uint8)
big_full_buffer_np = np.zeros(img_buffer_shape, dtype=np.uint8)
new_frame_np = np.random.randint(0, 256, yuv_size, dtype=np.uint8)
new_big_frame_np = np.random.randint(0, 256, yuv_size, dtype=np.uint8)
for i in range(10):
new_frame_np = (32 * np.random.randn(yuv_size).astype(np.float32) + 128).clip(0, 255).astype(np.uint8)
img_inputs = [full_buffer,
Tensor.from_blob(new_frame_np.ctypes.data, (yuv_size,), dtype='uint8').realize(),
Tensor(Tensor.randn(3, 3).mul(8).realize().numpy(), device='NPY')]
new_big_frame_np = (32 * np.random.randn(yuv_size).astype(np.float32) + 128).clip(0, 255).astype(np.uint8)
big_img_inputs = [big_full_buffer,
Tensor.from_blob(new_big_frame_np.ctypes.data, (yuv_size,), dtype='uint8').realize(),
Tensor(Tensor.randn(3, 3).mul(8).realize().numpy(), device='NPY')]
inputs = img_inputs + big_img_inputs
Device.default.synchronize()
inputs_np = [x.numpy() for x in inputs]
inputs_np[0] = full_buffer_np
inputs_np[3] = big_full_buffer_np
st = time.perf_counter()
out = update_img_jit(*inputs)
full_buffer = out[0].contiguous().realize().clone()
big_full_buffer = out[2].contiguous().realize().clone()
_ = update_img_jit(*inputs)
mt = time.perf_counter()
Device.default.synchronize()
et = time.perf_counter()
@@ -125,8 +116,8 @@ class Warp:
self.full_buffers['img'], road_blob, self.transforms['img'],
self.full_buffers['big_img'], wide_blob, self.transforms['big_img'],
)
self.full_buffers['img'], out_road = res[0].realize(), res[1].realize()
self.full_buffers['big_img'], out_wide = res[2].realize(), res[3].realize()
out_road = res[0].realize()
out_wide = res[1].realize()
return {road: out_road, wide: out_wide}
+1 -1
View File
@@ -1 +1 @@
5d4d21f1899de21137f69d74a4602c44cc5a6b04cf4e4aa9d0ec9206f8c30350
32f57bdc91f910df1f48ddae7c59aaf6e751f9df6756da481a210577dbce8bcf
@@ -38,6 +38,8 @@ class ControlsExt(ModelStateBase):
enforce_torque_control = self.params.get_bool("EnforceTorqueControl")
torque_versions = self.params.get("TorqueControlTune")
if not enforce_torque_control:
if self.CP.lateralTuning.which() == 'torque':
return LatControlTorqueV0(self.CP, self.CP_SP, CI, dt) # FIXME-SP: revert when upstream fixes tuning issues with v1
return lac
if torque_versions == 0.0: # v0
@@ -4,7 +4,6 @@ Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors.
This file is part of sunnypilot and is licensed under the MIT License.
See the LICENSE.md file in the root directory for more details.
"""
import numpy as np
from cereal import car
@@ -18,7 +17,6 @@ RELAXED_MIN_BUCKET_POINTS = np.array([1, 200, 300, 500, 500, 300, 200, 1])
ALLOWED_CARS = ['toyota', 'hyundai', 'rivian', 'honda']
class TorqueEstimatorExt:
def __init__(self, CP: car.CarParams):
self.CP = CP
@@ -28,6 +26,7 @@ class TorqueEstimatorExt:
self.enforce_torque_control_toggle = self._params.get_bool("EnforceTorqueControl") # only during init
self.use_params = self.CP.brand in ALLOWED_CARS and self.CP.lateralTuning.which() == 'torque'
self.use_live_torque_params = self._params.get_bool("LiveTorqueParamsToggle")
self.custom_torque_params = self._params.get_bool("CustomTorqueParams")
self.torque_override_enabled = self._params.get_bool("TorqueParamsOverrideEnabled")
self.min_bucket_points = RELAXED_MIN_BUCKET_POINTS
self.factor_sanity = 0.0
@@ -51,13 +50,14 @@ class TorqueEstimatorExt:
def _update_params(self):
if self.frame % int(PARAMS_UPDATE_PERIOD / DT_MDL) == 0:
self.use_live_torque_params = self._params.get_bool("LiveTorqueParamsToggle")
self.custom_torque_params = self._params.get_bool("CustomTorqueParams")
self.torque_override_enabled = self._params.get_bool("TorqueParamsOverrideEnabled")
def update_use_params(self):
self._update_params()
if self.enforce_torque_control_toggle:
if self.torque_override_enabled:
if self.custom_torque_params and self.torque_override_enabled:
self.use_params = False
else:
self.use_params = self.use_live_torque_params
-4
View File
@@ -30,10 +30,6 @@ class SunnylinkApi(BaseApi):
return super().api_get(endpoint, method, timeout, access_token, session, json, **kwargs)
def resume_queued(self, timeout=10, **kwargs):
sunnylinkId, commaId = self._resolve_dongle_ids()
return self.api_get(f"ws/{sunnylinkId}/resume_queued", "POST", timeout, access_token=self.get_token(), **kwargs)
def get_token(self, payload_extra=None, expiry_hours=1):
# Add your additional data here
additional_data = {}
+39 -62
View File
@@ -18,7 +18,7 @@ import time
from jsonrpc import dispatcher
from functools import partial
from openpilot.common.params import Params
from openpilot.common.params import Params, ParamKeyType
from openpilot.common.realtime import set_core_affinity
from openpilot.common.swaglog import cloudlog
from openpilot.system.hardware.hw import Paths
@@ -31,8 +31,10 @@ import cereal.messaging as messaging
from openpilot.sunnypilot.selfdrive.car.sync_car_list_param import update_car_list_param
from openpilot.sunnypilot.sunnylink.api import SunnylinkApi
from openpilot.sunnypilot.sunnylink.utils import sunnylink_need_register, sunnylink_ready, get_param_as_byte, save_param_from_base64_encoded_string
from openpilot.sunnypilot.sunnylink.capabilities import generate_capabilities, CAPABILITY_LABELS
from openpilot.sunnypilot.sunnylink.tools.generate_settings_schema import generate_schema
SUNNYLINK_ATHENA_HOST = os.getenv('SUNNYLINK_ATHENA_HOST', 'wss://ws.stg.api.sunnypilot.ai')
SUNNYLINK_ATHENA_HOST = os.getenv('SUNNYLINK_ATHENA_HOST', 'wss://athena.sunnylink.ai')
HANDLER_THREADS = int(os.getenv('HANDLER_THREADS', "4"))
LOCAL_PORT_WHITELIST = {8022}
SUNNYLINK_LOG_ATTR_NAME = "user.sunny.upload"
@@ -44,12 +46,15 @@ params = Params()
# Parameters that should never be remotely modified
BLOCKED_PARAMS = {
"AdbEnabled",
"CompletedSunnylinkConsentVersion",
"CompletedTrainingVersion",
"GithubUsername", # Could grant SSH access
"GithubSshKeys", # Direct SSH key injection
"HasAcceptedTerms",
"HasAcceptedTermsSP",
"OnroadCycleRequested", # Prevent remote cycle trigger
"ParamsVersion", # Device-managed version counter
}
@@ -64,7 +69,6 @@ def handle_long_poll(ws: WebSocket, exit_event: threading.Event | None) -> None:
threading.Thread(target=ws_recv, args=(ws, end_event), name='ws_recv'),
threading.Thread(target=ws_send, args=(ws, end_event), name='ws_send'),
threading.Thread(target=ws_ping, args=(ws, end_event), name='ws_ping'),
threading.Thread(target=ws_queue, args=(end_event,), name='ws_queue'),
threading.Thread(target=upload_handler, args=(end_event,), name='upload_handler'),
threading.Thread(target=sunny_log_handler, args=(end_event, comma_prime_cellular_end_event), name='log_handler'),
threading.Thread(target=stat_handler, args=(end_event, Paths.stats_sp_root(), True), name='stat_handler'),
@@ -147,37 +151,6 @@ def ws_ping(ws: WebSocket, end_event: threading.Event) -> None:
cloudlog.debug("sunnylinkd.ws_ping.end_event is set, exiting ws_ping thread")
def ws_queue(end_event: threading.Event) -> None:
sunnylink_dongle_id = params.get("SunnylinkDongleId")
sunnylink_api = SunnylinkApi(sunnylink_dongle_id)
resume_requested = False
tries = 0
while not end_event.is_set() and not resume_requested:
try:
if not resume_requested:
cloudlog.debug("sunnylinkd.ws_queue.resume_queued")
sunnylink_api.resume_queued(timeout=29)
resume_requested = True
tries = 0
except Exception as e:
if isinstance(e, (ConnectionError, TimeoutError)):
cloudlog.warning(f"sunnylinkd.ws_queue.resume_queued.{type(e).__name__}")
else:
cloudlog.exception("sunnylinkd.ws_queue.resume_queued.exception")
resume_requested = False
tries += 1
time.sleep(backoff(tries))
if end_event.is_set():
cloudlog.debug("end_event is set, exiting ws_queue thread")
elif resume_requested:
cloudlog.debug(f"Resume requested to server after {tries} tries")
else:
cloudlog.error(f"Reached end of ws_queue while end_event is not set and resume_requested is {resume_requested}")
def sunny_log_handler(end_event: threading.Event, comma_prime_cellular_end_event: threading.Event) -> None:
while not end_event.wait(0.1):
if not comma_prime_cellular_end_event.is_set():
@@ -231,34 +204,18 @@ def getParamsAllKeysV1() -> dict[str, str]:
@dispatcher.add_method
def getParamsMetadata() -> str:
"""Compressed equivalent of getParamsAllKeysV1 — same struct, gzipped + base64."""
"""Return settings_ui.json + live capabilities as gzip-compressed, base64-encoded string.
Reads settings_ui.json, injects live capabilities from CarParams, compresses,
and returns. Single RPC for the frontend to get the complete settings UI and
runtime capabilities.
"""
try:
with open(METADATA_PATH) as f:
metadata = json.load(f)
except Exception:
cloudlog.exception("sunnylinkd.getParamsMetadata.exception")
metadata = {}
try:
available_keys: list[str] = [k.decode('utf-8') for k in Params().all_keys()]
params_list: list[dict] = []
for key in available_keys:
value = get_param_as_byte(key, get_default=True)
param_entry: dict = {
"key": key,
"type": int(params.get_type(key).value),
"default_value": base64.b64encode(value).decode('utf-8') if value else None,
}
if key in metadata:
param_entry["_extra"] = metadata[key]
params_list.append(param_entry)
raw = json.dumps(params_list, separators=(',', ':')).encode('utf-8')
return base64.b64encode(gzip.compress(raw)).decode('utf-8')
schema = generate_schema()
schema["capabilities"] = generate_capabilities()
schema["capability_labels"] = CAPABILITY_LABELS
raw = json.dumps(schema, separators=(",", ":")).encode("utf-8")
return base64.b64encode(gzip.compress(raw)).decode("utf-8")
except Exception:
cloudlog.exception("sunnylinkd.getParamsMetadata.exception")
raise
@@ -270,12 +227,25 @@ def getParams(params_keys: list[str], compression: bool = False) -> str | dict[s
available_keys: list[str] = [k.decode('utf-8') for k in Params().all_keys()]
try:
zero_values: dict[int, bytes] = {
ParamKeyType.STRING.value: b"",
ParamKeyType.BOOL.value: b"0",
ParamKeyType.INT.value: b"0",
ParamKeyType.FLOAT.value: b"0.0",
ParamKeyType.TIME.value: b"",
ParamKeyType.JSON.value: b"{}",
ParamKeyType.BYTES.value: b"",
}
param_keys_validated = [key for key in params_keys if key in available_keys]
params_dict: dict[str, list[dict[str, str | bool | int]]] = {"params": []}
for key in param_keys_validated:
value = get_param_as_byte(key)
if value is None:
continue
value = get_param_as_byte(key, get_default=True)
if value is None:
param_type = params.get_type(key)
value = zero_values.get(param_type.value, b"")
params_dict["params"].append({
"key": key,
@@ -306,6 +276,13 @@ def saveParams(params_to_update: dict[str, str], compression: bool = False) -> N
except Exception as e:
cloudlog.error(f"sunnylinkd.saveParams.exception {e}")
# Increment version counter for frontend change detection
try:
current = int(params.get("ParamsVersion") or "0")
params.put("ParamsVersion", str(current + 1))
except Exception:
pass
def startLocalProxy(global_end_event: threading.Event, remote_ws_uri: str, local_port: int) -> dict[str, int]:
sunnylink_dongle_id = params.get("SunnylinkDongleId")
+186
View File
@@ -0,0 +1,186 @@
"""
Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors.
This file is part of sunnypilot and is licensed under the MIT License.
See the LICENSE.md file in the root directory for more details.
"""
import json
from cereal import car, custom, messaging
from opendbc.car.hyundai.values import CAR as HYUNDAI_CAR, UNSUPPORTED_LONGITUDINAL_CAR
from opendbc.car.subaru.values import CAR as SUBARU_CAR, SubaruFlags
from opendbc.sunnypilot.car.tesla.values import TeslaFlagsSP
from openpilot.common.params import Params
from openpilot.common.swaglog import cloudlog
from openpilot.system.hardware import HARDWARE
# Wire-protocol version for the capabilities payload. Bump on breaking changes
# only; additive fields are backward-compatible and do not require a bump.
PROTOCOL_VERSION = 1
# All capability fields that rules may reference.
# Non-boolean fields must have defaults in CAPABILITY_DEFAULTS.
CAPABILITY_FIELDS = (
"protocol_version",
"has_longitudinal_control",
"has_icbm",
"icbm_available",
"torque_allowed",
"brand",
"pcm_cruise",
"alpha_long_available",
"steer_control_type",
"enable_bsm",
"is_release",
"is_sp_release",
"is_development",
"tesla_has_vehicle_bus",
"has_stop_and_go",
"stock_longitudinal",
"device_type",
"subaru_has_sng",
"hyundai_alpha_long_available",
)
CAPABILITY_LABELS: dict[str, str] = {
"protocol_version": "Capabilities protocol version",
"has_longitudinal_control": "sunnypilot longitudinal control",
"has_icbm": "ICBM enabled",
"icbm_available": "ICBM available",
"torque_allowed": "torque steering (not available for angle steering vehicles)",
"brand": "Vehicle brand",
"pcm_cruise": "PCM cruise",
"alpha_long_available": "Alpha Longitudinal available",
"steer_control_type": "Steer control type",
"enable_bsm": "BSM available",
"is_release": "Release branch",
"is_sp_release": "SP release branch",
"is_development": "Development branch",
"tesla_has_vehicle_bus": "Tesla vehicle bus",
"has_stop_and_go": "Stop and Go",
"stock_longitudinal": "stock longitudinal",
"device_type": "Device type",
"subaru_has_sng": "Subaru Stop-and-Go available",
"hyundai_alpha_long_available": "Hyundai Alpha Longitudinal available",
}
# Explicit defaults for non-boolean capability fields
CAPABILITY_DEFAULTS: dict[str, bool | str | int] = {
"brand": "",
"steer_control_type": "",
"device_type": "",
"protocol_version": PROTOCOL_VERSION,
}
def _bundle_field(bundle: dict | None, key: str) -> str:
return bundle.get(key, "") if isinstance(bundle, dict) else ""
def _resolve_brand_capabilities(caps: dict, bundle_platform: str, CP) -> None:
"""Set brand-specific capabilities from bundle platform or CarParams fallback.
Bundle (manual car selection) is a pre-fingerprint approximation.
CarParams (auto-fingerprint) is the authoritative post-fingerprint source.
Mirrors the per-brand update_settings() logic in device UI layouts.
"""
brand = caps["brand"]
if brand == "hyundai":
if bundle_platform:
try:
unsupported = set().union(*UNSUPPORTED_LONGITUDINAL_CAR.values())
caps["hyundai_alpha_long_available"] = HYUNDAI_CAR[bundle_platform] not in unsupported
except KeyError:
cloudlog.exception(f"capabilities: unknown hyundai platform {bundle_platform!r}")
elif CP is not None:
caps["hyundai_alpha_long_available"] = bool(CP.alphaLongitudinalAvailable)
elif brand == "subaru":
if bundle_platform:
try:
flags = SUBARU_CAR[bundle_platform].config.flags
caps["subaru_has_sng"] = not bool(flags & (SubaruFlags.GLOBAL_GEN2 | SubaruFlags.HYBRID))
caps["has_stop_and_go"] = caps["subaru_has_sng"]
except KeyError:
cloudlog.exception(f"capabilities: unknown subaru platform {bundle_platform!r}")
elif CP is not None:
caps["subaru_has_sng"] = not bool(CP.flags & (SubaruFlags.GLOBAL_GEN2 | SubaruFlags.HYBRID))
caps["has_stop_and_go"] = caps["subaru_has_sng"]
def generate_capabilities(params: Params | None = None) -> dict:
"""Generate a SettingsCapabilities dict from CarParams + boolean params.
When CarPlatformBundle is present, brand and platform come from the bundle
(mirrors Raylib). CarParams* deserialization is the fallback before the bundle
is written (early after first pairing).
"""
params = params or Params()
caps: dict = {field: CAPABILITY_DEFAULTS.get(field, False) for field in CAPABILITY_FIELDS}
# Wire-protocol version is always set explicitly.
caps["protocol_version"] = PROTOCOL_VERSION
# Hardware + boolean params (no CarParams dependency)
caps["device_type"] = HARDWARE.get_device_type()
caps["is_release"] = False # params.get_bool("IsReleaseBranch")
caps["is_sp_release"] = params.get_bool("IsReleaseSpBranch")
caps["is_development"] = params.get_bool("IsDevelopmentBranch")
caps["stock_longitudinal"] = params.get_bool("ToyotaEnforceStockLongitudinal")
bundle = params.get("CarPlatformBundle")
bundle_brand = _bundle_field(bundle, "brand")
bundle_platform = _bundle_field(bundle, "platform")
# Bundle-first brand resolution; CP is fallback only.
if bundle_brand:
caps["brand"] = bundle_brand
# CarParams-derived capabilities
CP = None
CP_bytes = params.get("CarParamsPersistent")
if CP_bytes is not None:
try:
CP = messaging.log_from_bytes(CP_bytes, car.CarParams)
caps["alpha_long_available"] = bool(CP.alphaLongitudinalAvailable)
if CP.alphaLongitudinalAvailable:
caps["has_longitudinal_control"] = params.get_bool("AlphaLongitudinalEnabled")
else:
caps["has_longitudinal_control"] = bool(CP.openpilotLongitudinalControl)
# CP.steerControlType is the physical control mode (angle / torque).
# CP.lateralTuning.which() returns the tuning class (pid / torque / indi)
# which is a separate concept and is not interchangeable.
caps["steer_control_type"] = str(CP.steerControlType)
caps["torque_allowed"] = CP.steerControlType != car.CarParams.SteerControlType.angle
if not caps["brand"] and CP.brand:
caps["brand"] = str(CP.brand)
caps["pcm_cruise"] = bool(CP.pcmCruise)
caps["enable_bsm"] = bool(CP.enableBsm)
# Generic SnG fallback. Brand-specific opaque flags below override.
caps["has_stop_and_go"] = bool(CP.openpilotLongitudinalControl)
except Exception:
CP = None
cloudlog.exception("capabilities: failed to deserialize CarParamsPersistent")
# CarParamsSP-derived capabilities
CP_SP_bytes = params.get("CarParamsSPPersistent")
if CP_SP_bytes is not None:
try:
CP_SP = messaging.log_from_bytes(CP_SP_bytes, custom.CarParamsSP)
caps["icbm_available"] = bool(CP_SP.intelligentCruiseButtonManagementAvailable)
caps["has_icbm"] = bool(CP_SP.intelligentCruiseButtonManagementAvailable) and params.get_bool("IntelligentCruiseButtonManagement")
caps["tesla_has_vehicle_bus"] = bool(CP_SP.flags & TeslaFlagsSP.HAS_VEHICLE_BUS)
except Exception:
cloudlog.exception("capabilities: failed to deserialize CarParamsSPPersistent")
_resolve_brand_capabilities(caps, bundle_platform, CP)
return caps
def generate_capabilities_json(params: Params | None = None) -> str:
"""Generate SettingsCapabilities as a JSON string."""
return json.dumps(generate_capabilities(params), separators=(",", ":"))
+588
View File
@@ -0,0 +1,588 @@
# sunnylink Settings UI Guide
> One YAML file per page. Edit, run the compiler, commit. The sunnylink frontend updates automatically.
For detailed architecture, capability fields, parity analysis, and dialog mappings, see [REFERENCE.md](REFERENCE.md).
## What you edit (and what's generated)
| File | What | When to edit |
|------|------|-------------|
| `settings_ui_src/pages/<page>.yaml` | One YAML per page (panel). Contains panel metadata + sections + items + sub_panels inline. | Adding/changing/removing a setting. |
| `settings_ui_src/pages/vehicle.yaml` | Per-brand settings page (`kind: vehicle`). Each brand is a section. | Adding/changing a vehicle-specific setting. |
| `settings_ui_src/_macros.yaml` | Named rule fragments referenced via `{$ref: "#/macros/<name>"}`. | Adding a reusable rule (e.g. a new platform gate). |
| **`settings_ui.json`** | **Generated from src tree by `compile_settings_ui.py`. Do not edit by hand.** | Never. Compiler emits it; frontend reads it. |
Pages today: `steering, cruise, display, visuals, toggles, device, software, developer, models, vehicle` (10).
Run `python sunnypilot/sunnylink/tools/compile_settings_ui.py` after edits. Add `--check` in CI to fail on out-of-sync `settings_ui.json`.
Display metadata (titles, descriptions, options, min/max/step/unit) is inline on each item. There is no separate metadata file.
## Page file shape
A page YAML contains the whole panel: metadata at the top, then `sections`. Each section has its own `items` and (optionally) `sub_panels`. Sub-panels are nested inside the section they belong to. Items appear in the order written in the file.
```yaml
# yaml-language-server: $schema=../_schemas/page.schema.json
id: steering
label: Steering
icon: steering_wheel
order: 1
remote_configurable: true
description: Lateral control, lane changes, and steering behavior
sections:
- id: mads
title: Modular Assistive Driving System (MADS)
items:
- key: Mads
widget: toggle
title: Enable Modular Assistive Driving System (MADS)
description: |
Enable the beloved MADS feature. Disable toggle to revert back
to stock sunnypilot engagement/disengagement.
enablement:
- {$ref: "#/macros/offroad"}
sub_panels:
- id: mads_settings
label: MADS Settings
trigger_key: Mads
trigger_condition: {type: param, key: Mads, equals: true}
items:
- key: MadsMainCruiseAllowed
widget: toggle
title: Toggle with Main Cruise
description: |
Note: For vehicles without LFA/LKAS button, disabling this will
prevent lateral control engagement.
enablement:
- {$ref: "#/macros/offroad"}
- {$ref: "#/macros/mads_full_platforms"}
```
The vehicle page has the same shape but declares `kind: vehicle`; each section's `id` becomes a brand key under `vehicle_settings` in the compiled JSON.
## Macros (named rule fragments)
`_macros.yaml` declares reusable rule lists. Reference them from any rules array via `{$ref: "#/macros/<name>"}`.
```yaml
macros:
offroad: [{type: offroad_only}]
longitudinal: [{type: capability, field: has_longitudinal_control, equals: true}]
mads_full_platforms:
- type: not
condition:
type: any
conditions:
- {type: capability, field: brand, equals: rivian}
- type: all
conditions:
- {type: capability, field: brand, equals: tesla}
- type: not
condition: {type: capability, field: tesla_has_vehicle_bus, equals: true}
```
In an item:
```yaml
enablement:
- {$ref: "#/macros/offroad"}
- {$ref: "#/macros/mads_full_platforms"}
```
The compiler splices a list-context `$ref` into its parent list. Macros may reference other macros up to depth 3; cycles are an error.
## Compiler workflow
```
1. common/params_keys.h — add/remove the C++ param key
2. params_metadata.json — automated via update_params_metadata.py
3. settings_ui_src/pages/<page>.yaml — add/edit/remove the item in the right section
4. python sunnypilot/sunnylink/tools/compile_settings_ui.py
5. python sunnypilot/sunnylink/tools/validate_settings_ui.py (or: --check on the compiler)
6. uv run python -m pytest sunnypilot/sunnylink/tests/ # run regression + compiler tests
7. commit
```
CI runs `compile_settings_ui.py --check` to fail on hand-edited `settings_ui.json`.
## Compiled output reference (schema contract)
The tables below describe the **compiled** `settings_ui.json` schema — what the frontend consumes at runtime. JSON snippets show the wire shape; in the src tree you author YAML that compiles to the same shape. Use these as a contract reference for valid fields, their meanings, and rule types.
## Quick reference: widget types
| Widget | Use for | Fields needed |
|--------|---------|---------------|
| `toggle` | On/off boolean | `title` |
| `multiple_button` | 2-4 discrete options | `title` + `options` array |
| `option` | Numeric range or dropdown | `title` + `min/max/step` or `options` |
| `info` | Read-only display | `title` |
## Quick reference: item fields
| Field | Required | Description |
|-------|----------|-------------|
| `key` | Yes | Param key name (must exist in `params_keys.h`) |
| `widget` | Yes | `toggle`, `option`, `multiple_button`, `button`, `info` |
| `title` | Yes | Display name shown to the user |
| `description` | No | Inline explanatory text below the title. May be empty when only `details` is used. |
| `details` | No | Extended help text shown in a modal when the user taps an "i" button on the row. Independent of `description`: either, both, or neither may be present. |
| `options` | For selectors | Array of `{"value": 0, "label": "Off"}` objects (see per-option enablement below) |
| `min`, `max`, `step` | For sliders | Numeric range constraints |
| `unit` | No | Unit label. Static: `"seconds"`. Dynamic: `{"metric": "km/h", "imperial": "mph"}` (resolved by IsMetric) |
| `visibility` | No | Rules for show/hide. Settings are never hidden, always dimmed with UNAVAILABLE badge when rules fail |
| `enablement` | No | Rules for enabled/disabled (all must pass). Dimmed with badge when rules fail |
| `blocked` | No | `true` for device-only settings that cannot be modified remotely. Frontend shows as read-only |
| `title_param_suffix` | No | Dynamic title suffix. Example: `{"param": "IsMetric", "values": {"0": "mph", "1": "km/h"}}` |
| `sub_items` | No | Nested child items |
| `needs_onroad_cycle` | No | `true` if changing this param triggers a system restart. Frontend shows a "Restart" badge. See [REFERENCE.md - Remote Onroad Cycle](REFERENCE.md#remote-onroad-cycle) |
## Quick reference: rule types
| Rule | Example | Use for |
|------|---------|---------|
| `offroad_only` | `{"type": "offroad_only"}` | Grey out while driving |
| `not_engaged` | `{"type": "not_engaged"}` | Grey out only while engaged (started + selfdrive/MADS active) |
| `capability` | `{"type": "capability", "field": "has_longitudinal_control", "equals": true}` | Car-dependent visibility |
| `param` | `{"type": "param", "key": "Mads", "equals": true}` | Show/enable based on another setting |
| `param_compare` | `{"type": "param_compare", "key": "SpeedLimitMode", "op": ">", "value": 0}` | Numeric comparison |
| `not` | `{"type": "not", "condition": {...}}` | Negate a rule |
| `any` | `{"type": "any", "conditions": [...]}` | OR logic |
| `all` | `{"type": "all", "conditions": [...]}` | AND logic (for nesting inside `any`/`not`) |
| `$ref` | `{"$ref": "#/macros/offroad"}` | Reference a named rule fragment in `_macros.yaml` |
**Visibility design**: Settings are always visible. When visibility rules fail, the setting is dimmed with an UNAVAILABLE badge, so users know it exists but is not applicable.
**Enablement rules**: Grayed out (disabled) when rules fail. Frontend shows a contextual badge explaining why.
**Capability fields** (referenced in rules): `has_longitudinal_control`, `has_icbm`, `icbm_available`, `torque_allowed`, `brand`, `pcm_cruise`, `alpha_long_available`, `steer_control_type`, `enable_bsm`, `is_release`, `is_sp_release`, `is_development`, `tesla_has_vehicle_bus`, `has_stop_and_go`, `stock_longitudinal`
---
## How to
### Pick a writability rule (offroad / not_engaged / param-based)
| Use this | When | Why |
|---|---|---|
| `offroad_only` | Param can only be safely changed when the car is parked. Most user-facing toggles. | Strictest. Frontend shows "device is driving" badge and disables the row. |
| `not_engaged` | Param can be changed while the car is started but only when sunnypilot/MADS is **not** actively driving. | Less strict than offroad. Matches Raylib `engaged = started AND (selfdriveState.enabled OR mads.enabled)`. Use for items the device must apply mid-drive (e.g. test maneuvers, longitudinal stock-vs-OP toggle). |
| `param`-based | Behavior depends on another setting's value (parent toggle, mode selector, etc.). | Composes with `not`/`any`/`all` for arbitrary logic. |
| `capability`-based | Behavior depends on the connected car or device (brand, longitudinal, hardware). | Resolved on the device from `CarParams` / hardware. See [`capabilities.py`](../capabilities.py) for the full field list. |
| (no rule) | Param is always writable, no gating. | Rare. Prefer at least `offroad_only` unless the param is genuinely safe to flip mid-drive. |
Default for new toggles: `enablement: [{$ref: "#/macros/offroad"}]`. Drop down to `not_engaged` only if you've confirmed mid-drive write is safe in the controls/UI code path.
### Use `details` for safety notes / extended help
Inline `description` shows under the title. For longer caveats, safety notes, or "learn more" content, use `details` — the frontend renders an info button that opens a modal. Either field may be present alone or both together.
```yaml
- key: AutoLaneChangeTimer
widget: option
title: Auto Lane Change by Blinker
description: |-
Set a timer to delay the auto lane change operation when the blinker is used.
No nudge on the steering wheel is required to auto lane change if a timer is set.
Default is Nudge.
details: |-
Please use caution when using this feature. Only use the blinker when traffic
and road conditions permit.
options: [...]
```
For an item that is intentionally minimal inline (no inline body, only the modal):
```yaml
- key: SomeAdvancedToggle
widget: toggle
title: Some Advanced Feature
details: |-
Long-form rationale, caveats, links, etc. — kept entirely behind the info button.
```
### Add a toggle
1. Register in `common/params_keys.h`:
```cpp
{"MyToggle", {PERSISTENT | BACKUP, BOOL}},
```
2. Open `settings_ui_src/pages/<page>.yaml`. Add the item to the right section:
```yaml
- key: MyToggle
widget: toggle
title: My Feature
description: What this feature does.
enablement:
- {$ref: "#/macros/offroad"}
```
If changing the param requires an onroad cycle to take effect, add `needs_onroad_cycle: true`.
3. Compile + validate + test:
```
python sunnypilot/sunnylink/tools/compile_settings_ui.py
python sunnypilot/sunnylink/tools/validate_settings_ui.py
uv run python -m pytest sunnypilot/sunnylink/tests/
```
### Add a multi-button option
```yaml
- key: MySelector
widget: multiple_button
title: Mode
options:
- {value: 0, label: Off}
- {value: 1, label: On}
- {value: 2, label: Auto}
```
### Add a slider or range
```yaml
- key: MyRange
widget: option
title: Follow Distance
description: Time gap to lead vehicle.
min: 0.5
max: 3.0
step: 0.1
unit: seconds
```
### Add a slider with metric/imperial units
```yaml
- key: MinSpeed
widget: option
title: Minimum Speed
min: 0
max: 100
step: 5
unit: {metric: km/h, imperial: mph}
```
Frontend resolves the unit string based on the device's `IsMetric` param. Static units (e.g. `seconds`, `m/s²`) stay plain strings.
### Add a dynamic title suffix
```yaml
- key: FollowDistance
widget: option
title: Follow Distance
title_param_suffix:
param: IsMetric
values: {'0': mph, '1': km/h}
min: 0.5
max: 3.0
step: 0.1
```
Renders as "Follow Distance: mph" / "Follow Distance: km/h".
### Add a device-only read-only setting
```yaml
- key: OnroadCyclePendingRemote
widget: info
title: Pending Remote Cycle
blocked: true
```
Frontend treats `blocked: true` items as read-only.
### Add a dropdown option
```yaml
- key: MyDropdown
widget: option
title: Recording Quality
options:
- {value: 0, label: Low (720p)}
- {value: 1, label: Medium (1080p)}
- {value: 2, label: High (4K)}
```
### Per-option enablement rules
```yaml
- key: MadsSteeringMode
widget: multiple_button
title: Steering Mode on Brake Pedal
options:
- value: 0
label: Remain Active
enablement:
- {$ref: "#/macros/mads_full_platforms"}
- value: 1
label: Pause
enablement:
- {$ref: "#/macros/mads_full_platforms"}
- value: 2
label: Disengage
enablement:
- {$ref: "#/macros/offroad"}
```
When an option's enablement fails, that option is grayed out but still visible.
### Show only when another setting is on
```yaml
- key: ChildSetting
widget: toggle
title: Child Feature
visibility:
- {type: param, key: ParentToggle, equals: true}
```
(With the "dim instead of hide" design, this setting is dimmed, not hidden, when the rule fails.)
### Show only for specific brands
```yaml
- key: LongFeature
widget: toggle
title: Longitudinal Feature
visibility:
- {$ref: "#/macros/longitudinal"}
```
### Combine multiple conditions
The `enablement` array is implicit-AND: every entry must pass. Use `any` for OR, `all` for nested AND, `not` for negation. Wrap repeated combinations in a macro so future you doesn't re-derive the logic.
**AND across two params** (writable only when both Mads is on AND ICBM is enabled):
```yaml
enablement:
- {type: param, key: Mads, equals: true}
- {type: param, key: IntelligentCruiseButtonManagement, equals: true}
```
**OR across two params** (writable when either is on):
```yaml
enablement:
- type: any
conditions:
- {type: param, key: ExperimentalMode, equals: true}
- {type: param, key: DynamicExperimentalControl, equals: true}
```
**Mixed: capability AND param** (only on longitudinal cars when ShowAdvancedControls is on):
```yaml
enablement:
- {$ref: "#/macros/longitudinal"}
- {$ref: "#/macros/advanced_only"}
```
**Three-way: offroad AND torque-allowed AND not-NNLC** (real example: `EnforceTorqueControl`):
```yaml
enablement:
- {$ref: "#/macros/offroad"}
- {type: capability, field: torque_allowed, equals: true}
- {type: param, key: NeuralNetworkLateralControl, equals: false}
```
**Negation across multiple platforms** (everything except Rivian + Tesla-no-bus):
```yaml
enablement:
- {$ref: "#/macros/offroad"}
- {$ref: "#/macros/mads_full_platforms"} # macro encapsulates the not(any(rivian, all(tesla, not(bus)))) logic
```
If the same multi-condition block appears in 2+ items, **promote it to a macro** in `_macros.yaml`. Re-run `python sunnypilot/sunnylink/tools/apply_macros.py` to substitute existing inlined matches automatically.
### Mutual exclusion
```yaml
- key: FeatureAlpha
widget: toggle
title: Feature Alpha
enablement:
- {type: param, key: FeatureBeta, equals: false}
- key: FeatureBeta
widget: toggle
title: Feature Beta
enablement:
- {type: param, key: FeatureAlpha, equals: false}
```
### Add a section
In the page YAML, add an entry to the `sections` list:
```yaml
sections:
- id: my_section
title: My Section
description: Optional subtitle
enablement:
- {$ref: "#/macros/longitudinal"}
items:
- {key: ..., widget: toggle, title: ...}
```
Sections support `visibility`, `enablement`, and `attestation_required`. When section-level rules fail, all items within are dimmed.
### Add a sub-panel
Sub-panels nest inside the section they belong to:
```yaml
sections:
- id: parent_section
title: Parent
items: [...]
sub_panels:
- id: my_sub
label: Advanced Settings
trigger_key: ParentParam
trigger_condition: {type: param, key: ParentParam, equals: true}
items:
- {key: ..., widget: toggle, title: ...}
```
### Add vehicle-brand settings
Edit `pages/vehicle.yaml`. Each section is a brand:
```yaml
id: vehicle
kind: vehicle
sections:
- id: rivian
title: Rivian Settings
description: ''
items:
- key: RivianFeature
widget: toggle
title: Rivian One Pedal
enablement:
- {$ref: "#/macros/offroad"}
```
`kind: vehicle` tells the compiler to emit this page as `vehicle_settings.<brand>` in the wire JSON.
### Add a feature with toggles, sub-panel, and macro
Example: "Smart Wipers" with a master toggle, intensity selector, and sub-panel for advanced tuning, gated to torque-steering Hyundais on offroad.
1. **Param keys** — register all 4 in `common/params_keys.h`.
2. **Decide on a macro** — if "torque Hyundai" gating is reused, add to `_macros.yaml`:
```yaml
torque_hyundai:
- {$ref: "#/macros/offroad"}
- {type: capability, field: brand, equals: hyundai}
- {type: capability, field: torque_allowed, equals: true}
```
3. **Edit the relevant page**`pages/visuals.yaml` (or wherever the feature lives). Add a new section + sub_panel:
```yaml
sections:
- id: smart_wipers
title: Smart Wipers
description: Camera-driven wiper control (Hyundai/Kia, torque only)
items:
- key: SmartWipersEnabled
widget: toggle
title: Enable Smart Wipers
enablement:
- {$ref: "#/macros/torque_hyundai"}
- key: SmartWipersIntensity
widget: multiple_button
title: Sensitivity
options:
- {value: 0, label: Low}
- {value: 1, label: Medium}
- {value: 2, label: High}
visibility:
- {type: param, key: SmartWipersEnabled, equals: true}
enablement:
- {$ref: "#/macros/torque_hyundai"}
sub_panels:
- id: smart_wipers_tuning
label: Smart Wipers Tuning
trigger_key: SmartWipersEnabled
trigger_condition: {type: param, key: SmartWipersEnabled, equals: true}
items:
- key: SmartWipersHysteresis
widget: option
title: Hysteresis (frames)
min: 1
max: 30
step: 1
enablement:
- {$ref: "#/macros/offroad"}
- {$ref: "#/macros/advanced_only"}
```
4. **Compile / validate / test**:
```
python sunnypilot/sunnylink/tools/compile_settings_ui.py
python sunnypilot/sunnylink/tools/validate_settings_ui.py
uv run python -m pytest sunnypilot/sunnylink/tests/
```
`apply_macros.py` is automatic for newly-added items only if you wrote the rule list inline; for greenfield items, you'd write `$ref` directly.
### Change a toggle's behavior
1. Find the item in `pages/<page>.yaml`.
2. Edit `visibility`/`enablement`/`options[].enablement` directly. Use macros where possible.
3. **Add a regression test** in `sunnypilot/sunnylink/tests/test_settings_changes.py` that asserts the new gate exists. Use existing tests (e.g. `TestMadsBrandGates`, `TestNotEngagedReplacement`) as templates: lookup item by key, assert `_references_capability_field(rules, "...")` or `_flatten_rule_types(rules)` contains/excludes a type. This freezes the new behavior so a future edit won't silently revert it.
4. Compile + run the full suite. Per-bug test should pass; structural tests should remain green.
### Change a widget type or options
Editing `widget:` from `toggle` to `multiple_button` is a frontend behavior change. Whenever you change widget shape:
- The param's underlying type (bool / int / string) must match what the new widget writes. `toggle` writes bool; `multiple_button`/`option` write int/string. Update `params_keys.h` if the type changes.
- Add an `options:` list when switching to `multiple_button` or `option`.
- Old values stored on devices may not be valid for the new widget. Consider a migration in `sunnypilot/system/updated/` if users have stale values.
### Deprecate or remove a setting
1. Remove the item from `pages/<page>.yaml`.
2. Remove the param key from `common/params_keys.h` **only after** confirming nothing in `selfdrive/`, `sunnypilot/`, or any controls code reads it.
3. If the param has been on user devices, drop it via a migration (see `sunnypilot/system/updated/`) so stale values don't linger.
4. Compile + validate + test. The validator's "no duplicate keys" + structural checks will fail if anything still references the removed key.
### Move a setting to another page
Cut the item block from one page YAML, paste into the target page's section. Compile + validate. The "no duplicate keys" check catches forgotten copies.
### Change display text
Edit `title:` or `description:` in the page YAML and recompile to regenerate `settings_ui.json`.
### Reorder sections, sub-panels, and items
Reorder them within their parent list in the YAML. The compiler preserves authored order — no `order:` field required at the section/sub_panel/item level (panel-level `order:` controls which page comes first in the side nav).
---
### Capability labels and tooltips
The schema response includes `capability_labels`, which map capability field names to descriptions. The frontend uses these to show contextual tooltips when a capability rule prevents a setting from being used.
The device defines these labels in `capabilities.py:CAPABILITY_LABELS`. Examples:
- `has_longitudinal_control` → "sunnypilot longitudinal control"
- `torque_allowed` → "torque steering (not available for angle steering vehicles)"
- `brand` → "Vehicle brand"
### Centralized param enforcement
The device-side UI enforces capability constraints in `selfdrive/ui/sunnypilot/ui_state.py:_enforce_constraints()`, which removes incompatible params based on car capabilities. This is the single source of truth for such constraints.
Settings layouts should not duplicate these params.remove() calls. Instead, rely on schema rules and centralized enforcement to prevent duplicate logic and ensure consistency.
Example constraints in `_enforce_constraints()`:
- Angle steering cars: remove `EnforceTorqueControl` and `NeuralNetworkLateralControl`
- No CarParams: remove all car-dependent params
- No longitudinal: remove `ExperimentalMode`
- No ICBM: remove `IntelligentCruiseButtonManagement`
@@ -1071,6 +1071,10 @@
"title": "Panda Som Reset Triggered",
"description": ""
},
"ParamsVersion": {
"title": "Params Version",
"description": ""
},
"PlanplusControl": {
"title": "Plan Plus Controls",
"description": "Adjust planplus model recentering strength. The higher this number the more aggressively the model will recover to lanecenter, too high and it will ping-pong",
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,516 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://sunnypilot.com/schemas/settings_ui.schema.json",
"title": "sunnypilot Settings UI Schema",
"description": "Defines the structure of the sunnypilot settings UI panels, items, rules, and vehicle-specific settings.",
"type": "object",
"required": ["schema_version", "panels", "vehicle_settings"],
"additionalProperties": false,
"properties": {
"$schema": {
"type": "string",
"description": "JSON Schema reference for editor support."
},
"schema_version": {
"type": "string",
"description": "Version of the settings UI schema format.",
"examples": ["1.0"]
},
"panels": {
"type": "array",
"description": "Top-level settings panels displayed in the UI.",
"items": {
"$ref": "#/$defs/Panel"
}
},
"vehicle_settings": {
"type": "object",
"description": "Brand-keyed vehicle-specific settings. Each key is a car brand (e.g. 'hyundai', 'toyota').",
"additionalProperties": {
"$ref": "#/$defs/VehicleBrandSettings"
}
}
},
"$defs": {
"Panel": {
"type": "object",
"description": "A top-level settings panel (tab) in the UI.",
"required": ["id", "label", "icon", "order"],
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for this panel."
},
"label": {
"type": "string",
"description": "Display label shown in the UI."
},
"icon": {
"type": "string",
"description": "Icon identifier for this panel."
},
"order": {
"type": "integer",
"description": "Sort order for panel display.",
"minimum": 0
},
"description": {
"type": "string",
"description": "Optional description shown below the panel label."
},
"remote_configurable": {
"type": "boolean",
"description": "Whether this panel's settings can be changed remotely via sunnylink.",
"default": false
},
"sections": {
"type": "array",
"description": "Grouped sections within this panel.",
"items": {
"$ref": "#/$defs/PanelSection"
}
},
"items": {
"type": "array",
"description": "Settings items directly in this panel (no section grouping).",
"items": {
"$ref": "#/$defs/SchemaItem"
}
},
"sub_panels": {
"type": "array",
"description": "Nested sub-panels triggered by a setting.",
"items": {
"$ref": "#/$defs/SubPanel"
}
}
}
},
"PanelSection": {
"type": "object",
"description": "A grouped section within a panel.",
"required": ["id", "title"],
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for this section."
},
"title": {
"type": "string",
"description": "Display title for this section."
},
"description": {
"type": "string",
"description": "Optional description shown below the section title."
},
"order": {
"type": "integer",
"description": "Sort order within the parent panel.",
"minimum": 0
},
"visibility": {
"type": "array",
"description": "Rules that determine whether this section is visible. All rules must pass.",
"items": {
"$ref": "#/$defs/Rule"
}
},
"enablement": {
"type": "array",
"description": "Rules that determine whether items in this section are enabled. All rules must pass.",
"items": {
"$ref": "#/$defs/Rule"
}
},
"attestation_required": {
"type": "boolean",
"description": "When true, the UI must show an attestation modal before any write to items in this section.",
"default": false
},
"items": {
"type": "array",
"description": "Settings items within this section.",
"items": {
"$ref": "#/$defs/SchemaItem"
}
},
"sub_panels": {
"type": "array",
"description": "Nested sub-panels within this section.",
"items": {
"$ref": "#/$defs/SubPanel"
}
}
}
},
"VehicleBrandSettings": {
"type": "object",
"description": "Brand-specific settings group inside vehicle_settings.",
"required": ["items"],
"additionalProperties": false,
"properties": {
"title": {
"type": "string",
"description": "Display title for this brand's settings group."
},
"description": {
"type": "string",
"description": "Optional description shown below the brand title."
},
"items": {
"type": "array",
"description": "Settings items for this brand.",
"items": {
"$ref": "#/$defs/SchemaItem"
}
}
}
},
"SchemaItem": {
"type": "object",
"description": "A single settings item (toggle, option selector, button group, etc.).",
"required": ["key", "widget"],
"additionalProperties": false,
"properties": {
"key": {
"type": "string",
"description": "The param key this item reads/writes."
},
"widget": {
"type": "string",
"description": "The UI widget type to render.",
"enum": ["toggle", "option", "multiple_button", "button", "info"]
},
"title": {
"type": "string",
"description": "Override display title (defaults to metadata lookup by key)."
},
"description": {
"type": "string",
"description": "Override description text. Rendered inline below the title. May be empty when only `details` is used."
},
"details": {
"type": "string",
"description": "Extended help text shown in a popover/modal when the user taps an info ('i') button on the row. Independent of `description`: either, both, or neither may be present."
},
"options": {
"type": "array",
"description": "Available options for 'option' or 'multiple_button' widgets.",
"items": {
"$ref": "#/$defs/SchemaOption"
}
},
"min": {
"type": "number",
"description": "Minimum value for numeric option widgets."
},
"max": {
"type": "number",
"description": "Maximum value for numeric option widgets."
},
"step": {
"type": "number",
"description": "Step increment for numeric option widgets."
},
"unit": {
"oneOf": [
{
"type": "string",
"description": "Static unit label (e.g. 'seconds', 'm/s²')."
},
{
"type": "object",
"description": "Dynamic unit that changes based on IsMetric param.",
"required": ["metric", "imperial"],
"additionalProperties": false,
"properties": {
"metric": {
"type": "string",
"description": "Unit label when IsMetric is true (e.g. 'km/h')."
},
"imperial": {
"type": "string",
"description": "Unit label when IsMetric is false (e.g. 'mph')."
}
}
}
],
"description": "Unit label for numeric values. Use a string for static units or an object with metric/imperial variants for units that depend on the IsMetric param."
},
"value_map": {
"type": "object",
"description": "Maps stored values to display labels.",
"additionalProperties": {
"type": "string"
}
},
"visibility": {
"type": "array",
"description": "Rules that determine whether this item is visible. All rules must pass.",
"items": {
"$ref": "#/$defs/Rule"
}
},
"enablement": {
"type": "array",
"description": "Rules that determine whether this item is enabled/interactive. All rules must pass.",
"items": {
"$ref": "#/$defs/Rule"
}
},
"sub_items": {
"type": "array",
"description": "Child items nested under this item (e.g. options revealed by a toggle).",
"items": {
"$ref": "#/$defs/SchemaItem"
}
},
"action": {
"type": "string",
"description": "Action identifier for button widgets."
},
"title_param_suffix": {
"type": "object",
"description": "Renders an extra suffix in the item title chosen by the value of another param.",
"required": ["param", "values"],
"additionalProperties": false,
"properties": {
"param": {
"type": "string",
"description": "Param key whose value selects the suffix label."
},
"values": {
"type": "object",
"description": "Map from stringified param value to suffix label.",
"additionalProperties": {
"type": "string"
}
}
}
},
"needs_onroad_cycle": {
"type": "boolean",
"description": "When true, the device must cycle onroad/offroad for the new value to take effect.",
"default": false
},
"blocked": {
"type": "boolean",
"description": "When true, this item is treated as DEVICE_ONLY and the dashboard must not write it remotely.",
"default": false
},
"requires_attestation": {
"type": "boolean",
"description": "When true, writes to this item require an explicit per-write confirmation modal.",
"default": false
}
}
},
"SubPanel": {
"type": "object",
"description": "A nested panel that opens when triggered by a parent item.",
"required": ["id", "label", "trigger_key"],
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for this sub-panel."
},
"label": {
"type": "string",
"description": "Display label for the sub-panel header."
},
"trigger_key": {
"type": "string",
"description": "The param key that triggers opening this sub-panel."
},
"trigger_condition": {
"$ref": "#/$defs/Rule",
"description": "Optional rule that must evaluate to true for the sub-panel trigger to be active."
},
"items": {
"type": "array",
"description": "Settings items within this sub-panel.",
"items": {
"$ref": "#/$defs/SchemaItem"
}
}
}
},
"SchemaOption": {
"type": "object",
"description": "A selectable option for option/multiple_button widgets.",
"required": ["value", "label"],
"additionalProperties": false,
"properties": {
"value": {
"oneOf": [
{ "type": "number" },
{ "type": "string" }
],
"description": "The stored value when this option is selected."
},
"label": {
"type": "string",
"description": "The display label for this option."
},
"enablement": {
"type": "array",
"description": "Rules that determine whether this option is selectable. All rules must pass.",
"items": {
"$ref": "#/$defs/Rule"
}
}
}
},
"Rule": {
"description": "A visibility or enablement rule. Discriminated union on the 'type' field.",
"oneOf": [
{ "$ref": "#/$defs/RuleOffroadOnly" },
{ "$ref": "#/$defs/RuleNotEngaged" },
{ "$ref": "#/$defs/RuleCapability" },
{ "$ref": "#/$defs/RuleParam" },
{ "$ref": "#/$defs/RuleParamCompare" },
{ "$ref": "#/$defs/RuleNot" },
{ "$ref": "#/$defs/RuleAny" },
{ "$ref": "#/$defs/RuleAll" }
]
},
"RuleOffroadOnly": {
"type": "object",
"description": "Rule that passes only when the device is offroad.",
"required": ["type"],
"additionalProperties": false,
"properties": {
"type": {
"const": "offroad_only"
}
}
},
"RuleNotEngaged": {
"type": "object",
"description": "Rule that passes when the vehicle is not engaged (matches Raylib `engaged = started AND (selfdriveState.enabled OR selfdriveStateSP.mads.enabled)`).",
"required": ["type"],
"additionalProperties": false,
"properties": {
"type": {
"const": "not_engaged"
}
}
},
"RuleCapability": {
"type": "object",
"description": "Rule that checks a vehicle capability field against an expected value.",
"required": ["type", "field", "equals"],
"additionalProperties": false,
"properties": {
"type": {
"const": "capability"
},
"field": {
"type": "string",
"description": "The capability field name to check."
},
"equals": {
"description": "The expected value to match against."
}
}
},
"RuleParam": {
"type": "object",
"description": "Rule that checks a param value against an expected value.",
"required": ["type", "key", "equals"],
"additionalProperties": false,
"properties": {
"type": {
"const": "param"
},
"key": {
"type": "string",
"description": "The param key to read."
},
"equals": {
"description": "The expected value to match against."
}
}
},
"RuleParamCompare": {
"type": "object",
"description": "Rule that compares a numeric param value using a comparison operator.",
"required": ["type", "key", "op", "value"],
"additionalProperties": false,
"properties": {
"type": {
"const": "param_compare"
},
"key": {
"type": "string",
"description": "The param key to read."
},
"op": {
"type": "string",
"description": "Comparison operator.",
"enum": [">", "<", ">=", "<="]
},
"value": {
"type": "number",
"description": "The numeric value to compare against."
}
}
},
"RuleNot": {
"type": "object",
"description": "Rule that negates a single child condition.",
"required": ["type", "condition"],
"additionalProperties": false,
"properties": {
"type": {
"const": "not"
},
"condition": {
"$ref": "#/$defs/Rule",
"description": "The rule to negate."
}
}
},
"RuleAny": {
"type": "object",
"description": "Rule that passes if ANY of the child conditions pass (logical OR).",
"required": ["type", "conditions"],
"additionalProperties": false,
"properties": {
"type": {
"const": "any"
},
"conditions": {
"type": "array",
"description": "Child rules; at least one must pass.",
"items": {
"$ref": "#/$defs/Rule"
},
"minItems": 1
}
}
},
"RuleAll": {
"type": "object",
"description": "Rule that passes only if ALL child conditions pass (logical AND).",
"required": ["type", "conditions"],
"additionalProperties": false,
"properties": {
"type": {
"const": "all"
},
"conditions": {
"type": "array",
"description": "Child rules; all must pass.",
"items": {
"$ref": "#/$defs/Rule"
},
"minItems": 1
}
}
}
}
}
@@ -0,0 +1,65 @@
# Named rule fragments. Reference from items/sections via {$ref: "#/macros/<name>"}.
# Macros may $ref other macros (max depth 3 — see compile_settings_ui.py). No template logic.
#
# Adding a macro: define here once, then reference everywhere. The compiler
# resolves $refs into the canonical settings_ui.json output the frontend reads.
macros:
# Most-used: only writable when the device is offroad.
offroad:
- {type: offroad_only}
# Writable while not engaged (started, but selfdrive/MADS not active).
not_engaged:
- {type: not_engaged}
# sunnypilot longitudinal control is active.
longitudinal:
- {type: capability, field: has_longitudinal_control, equals: true}
# Longitudinal + ICBM both available.
longitudinal_and_icbm:
- {type: capability, field: has_longitudinal_control, equals: true}
- {type: capability, field: has_icbm, equals: true}
# Item only meaningful when "Show Advanced Controls" is enabled by the user.
advanced_only:
- {type: param, key: ShowAdvancedControls, equals: true}
# Hide on MICI hardware (no analog HUD support yet).
hide_on_mici:
- type: not
condition: {type: capability, field: device_type, equals: mici}
# Mirrors selfdrive/ui/sunnypilot/layouts/.../mads_settings.py:_mads_limited_settings()
# Rivian + Tesla-without-vehicle-bus get the limited MADS UI (3-toggle subset).
# On those platforms these toggles are disabled — full MADS settings are
# only writable on platforms NOT in the limited-set.
mads_full_platforms:
- type: not
condition:
type: any
conditions:
- {type: capability, field: brand, equals: rivian}
- type: all
conditions:
- {type: capability, field: brand, equals: tesla}
- type: not
condition: {type: capability, field: tesla_has_vehicle_bus, equals: true}
# Inverse of mads_full_platforms: present only on the limited platforms.
# Useful for "show this only on rivian/tesla-no-bus" toggles.
mads_limited_platforms:
- type: any
conditions:
- {type: capability, field: brand, equals: rivian}
- type: all
conditions:
- {type: capability, field: brand, equals: tesla}
- type: not
condition: {type: capability, field: tesla_has_vehicle_bus, equals: true}
# Hide on sunnypilot release branches (is_release is hardcoded False everywhere; is_sp_release is the active gate).
release_branches_hide:
- type: not
condition: {type: capability, field: is_sp_release, equals: true}
@@ -0,0 +1,23 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://sunnypilot.com/schemas/sdui/macros.schema.json",
"title": "Settings UI macros (named rule fragments)",
"type": "object",
"additionalProperties": false,
"required": ["macros"],
"properties": {
"macros": {
"type": "object",
"description": "Named rule fragments. Each value is either a list of rules (typical) or a single rule object. Reference from items/layout via {$ref: '#/macros/<name>'}.",
"patternProperties": {
"^[A-Za-z_][A-Za-z0-9_]*$": {
"oneOf": [
{"type": "array", "items": {"$ref": "rule.schema.json"}},
{"$ref": "rule.schema.json"}
]
}
},
"additionalProperties": false
}
}
}
@@ -0,0 +1,113 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://sunnypilot.com/schemas/sdui/page.schema.json",
"title": "Settings UI page (panel) YAML",
"description": "Validates pages/<id>.yaml. Each page describes one settings panel (or the vehicle namespace via kind: vehicle).",
"type": "object",
"required": ["id"],
"additionalProperties": false,
"properties": {
"id": {"type": "string"},
"label": {"type": "string"},
"icon": {"type": "string"},
"order": {"type": "integer"},
"remote_configurable": {"type": "boolean"},
"description": {"type": "string"},
"kind": {
"type": "string",
"enum": ["panel", "vehicle"],
"description": "panel (default) or vehicle (compiles to settings_ui.json#vehicle_settings)."
},
"sections": {
"type": "array",
"items": {"$ref": "#/$defs/Section"}
},
"items": {
"type": "array",
"items": {"$ref": "#/$defs/Item"}
},
"sub_panels": {
"type": "array",
"items": {"$ref": "#/$defs/SubPanel"}
}
},
"$defs": {
"Section": {
"type": "object",
"required": ["id", "title"],
"additionalProperties": false,
"properties": {
"id": {"type": "string"},
"title": {"type": "string"},
"description": {"type": "string"},
"order": {"type": "integer"},
"attestation_required": {"type": "boolean"},
"visibility": {"type": "array", "items": {"$ref": "rule.schema.json"}},
"enablement": {"type": "array", "items": {"$ref": "rule.schema.json"}},
"items": {"type": "array", "items": {"$ref": "#/$defs/Item"}},
"sub_panels": {"type": "array", "items": {"$ref": "#/$defs/SubPanel"}}
}
},
"SubPanel": {
"type": "object",
"required": ["id", "label"],
"additionalProperties": false,
"properties": {
"id": {"type": "string"},
"label": {"type": "string"},
"trigger_key": {"type": ["string", "null"]},
"trigger_condition": {"$ref": "rule.schema.json"},
"items": {"type": "array", "items": {"$ref": "#/$defs/Item"}}
}
},
"Item": {
"type": "object",
"required": ["key", "widget"],
"additionalProperties": false,
"properties": {
"key": {"type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_]*$"},
"widget": {"type": "string", "enum": ["toggle", "option", "multiple_button", "button", "info"]},
"title": {"type": "string"},
"description": {"type": "string", "description": "Inline body text under the title. May be omitted when only details is used."},
"details": {"type": "string", "description": "Extended help shown in a modal when the user taps the info (i) button. Independent of description; either, both, or neither may be present."},
"title_param_suffix": {"type": "object"},
"min": {"type": "number"},
"max": {"type": "number"},
"step": {"type": "number"},
"unit": {
"oneOf": [
{"type": "string"},
{
"type": "object",
"additionalProperties": false,
"required": ["metric", "imperial"],
"properties": {
"metric": {"type": "string"},
"imperial": {"type": "string"}
}
}
]
},
"needs_onroad_cycle": {"type": "boolean"},
"requires_attestation": {"type": "boolean"},
"blocked": {"type": "boolean"},
"options": {
"type": "array",
"items": {
"type": "object",
"required": ["value", "label"],
"additionalProperties": false,
"properties": {
"value": {},
"label": {"type": "string"},
"enablement": {"type": "array", "items": {"$ref": "rule.schema.json"}}
}
}
},
"visibility": {"type": "array", "items": {"$ref": "rule.schema.json"}},
"enablement": {"type": "array", "items": {"$ref": "rule.schema.json"}},
"sub_items": {"type": "array", "items": {"$ref": "#/$defs/Item"}}
}
}
}
}
@@ -0,0 +1,101 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://sunnypilot.com/schemas/sdui/rule.schema.json",
"title": "Rule",
"description": "Visibility/enablement rule. Discriminated union on 'type'. Macro reference is also accepted via {$ref: '#/macros/<name>'}.",
"oneOf": [
{"$ref": "#/$defs/MacroRef"},
{"$ref": "#/$defs/RuleOffroadOnly"},
{"$ref": "#/$defs/RuleNotEngaged"},
{"$ref": "#/$defs/RuleCapability"},
{"$ref": "#/$defs/RuleParam"},
{"$ref": "#/$defs/RuleParamCompare"},
{"$ref": "#/$defs/RuleNot"},
{"$ref": "#/$defs/RuleAny"},
{"$ref": "#/$defs/RuleAll"}
],
"$defs": {
"MacroRef": {
"type": "object",
"required": ["$ref"],
"additionalProperties": false,
"properties": {
"$ref": {
"type": "string",
"pattern": "^#/macros/[A-Za-z_][A-Za-z0-9_]*$",
"description": "Reference to a macro defined in _macros.yaml under #/macros/<name>."
}
}
},
"RuleOffroadOnly": {
"type": "object",
"required": ["type"],
"additionalProperties": false,
"properties": {"type": {"const": "offroad_only"}}
},
"RuleNotEngaged": {
"type": "object",
"required": ["type"],
"additionalProperties": false,
"properties": {"type": {"const": "not_engaged"}}
},
"RuleCapability": {
"type": "object",
"required": ["type", "field", "equals"],
"additionalProperties": false,
"properties": {
"type": {"const": "capability"},
"field": {"type": "string"},
"equals": {}
}
},
"RuleParam": {
"type": "object",
"required": ["type", "key", "equals"],
"additionalProperties": false,
"properties": {
"type": {"const": "param"},
"key": {"type": "string"},
"equals": {}
}
},
"RuleParamCompare": {
"type": "object",
"required": ["type", "key", "op", "value"],
"additionalProperties": false,
"properties": {
"type": {"const": "param_compare"},
"key": {"type": "string"},
"op": {"type": "string", "enum": [">", "<", ">=", "<="]},
"value": {"type": "number"}
}
},
"RuleNot": {
"type": "object",
"required": ["type", "condition"],
"additionalProperties": false,
"properties": {
"type": {"const": "not"},
"condition": {"$ref": "#"}
}
},
"RuleAny": {
"type": "object",
"required": ["type", "conditions"],
"additionalProperties": false,
"properties": {
"type": {"const": "any"},
"conditions": {"type": "array", "items": {"$ref": "#"}, "minItems": 1}
}
},
"RuleAll": {
"type": "object",
"required": ["type", "conditions"],
"additionalProperties": false,
"properties": {
"type": {"const": "all"},
"conditions": {"type": "array", "items": {"$ref": "#"}, "minItems": 1}
}
}
}
}
@@ -0,0 +1,269 @@
# Page: cruise
# Edit this file. Run compile_settings_ui.py to emit settings_ui.json.
id: cruise
label: Cruise
icon: cruise_control
order: 2
remote_configurable: true
description: Longitudinal control, speed limits, and cruise behavior
sections:
- id: core_cruise_features
title: ''
description: ''
items:
- key: ExperimentalMode
widget: toggle
title: Experimental Mode
enablement:
- $ref: '#/macros/longitudinal'
- key: DynamicExperimentalControl
widget: toggle
title: Dynamic Experimental Control
description: Let the model decide when to use sunnypilot ACC or sunnypilot End to End Longitudinal.
visibility:
- $ref: '#/macros/longitudinal'
enablement:
- $ref: '#/macros/longitudinal'
- key: DisengageOnAccelerator
widget: toggle
title: Disengage Cruise on Accelerator Pedal
description: When enabled, pressing the accelerator pedal will disengage longitudinal control.
- key: LongitudinalPersonality
widget: multiple_button
title: Driving Personality
description: Standard is recommended. In aggressive mode, sunnypilot will follow lead cars closer and be more aggressive
with the gas and brake. In relaxed mode sunnypilot will stay further away from lead cars. On supported cars, you can
cycle through these personalities with your steering wheel distance button.
options:
- value: 0
label: Aggressive
- value: 1
label: Standard
- value: 2
label: Relaxed
enablement:
- $ref: '#/macros/longitudinal'
- key: IntelligentCruiseButtonManagement
widget: toggle
title: Intelligent Cruise Button Management (ICBM) (Alpha)
visibility:
- type: capability
field: icbm_available
equals: true
enablement:
- $ref: '#/macros/offroad'
- type: not
condition:
type: capability
field: has_longitudinal_control
equals: true
- id: custom_acc_increments
title: Custom ACC Speed Intervals
description: ''
enablement:
- $ref: '#/macros/offroad'
- type: any
conditions:
- type: all
conditions:
- type: capability
field: has_longitudinal_control
equals: true
- type: not
condition:
type: capability
field: pcm_cruise
equals: true
- type: capability
field: has_icbm
equals: true
items:
- key: CustomAccIncrementsEnabled
widget: toggle
title: Enable Custom ACC Speed Intervals
enablement:
- $ref: '#/macros/offroad'
- type: any
conditions:
- type: all
conditions:
- type: capability
field: has_longitudinal_control
equals: true
- type: not
condition:
type: capability
field: pcm_cruise
equals: true
- type: capability
field: has_icbm
equals: true
sub_panels:
- id: custom_acc_intervals
label: Custom ACC Speed Intervals Settings
trigger_key: CustomAccIncrementsEnabled
trigger_condition:
type: param
key: CustomAccIncrementsEnabled
equals: true
items:
- key: CustomAccShortPressIncrement
widget: option
title: Short Press Increment
min: 1
max: 10
step: 1
enablement:
- type: param
key: CustomAccIncrementsEnabled
equals: true
- key: CustomAccLongPressIncrement
widget: option
title: Long Press Increment
min: 1
max: 10
step: 1
enablement:
- type: param
key: CustomAccIncrementsEnabled
equals: true
- id: speed_limits
title: Speed Limits
description: Speed limit detection and offset behavior
items: []
sub_panels:
- id: speed_limit_settings
label: Speed Limit Settings
trigger_key: SpeedLimitMode
items:
- key: SpeedLimitMode
widget: multiple_button
title: Speed Limit Assist Mode
options:
- value: 0
label: 'Off'
- value: 1
label: Information
- value: 2
label: Warning
- value: 3
label: Assist
enablement:
- type: any
conditions:
- type: capability
field: has_longitudinal_control
equals: true
- type: capability
field: has_icbm
equals: true
- type: not
condition:
type: capability
field: brand
equals: rivian
- type: not
condition:
type: all
conditions:
- type: capability
field: brand
equals: tesla
- type: capability
field: is_sp_release
equals: true
- key: SpeedLimitPolicy
widget: multiple_button
title: Speed Limit Source
options:
- value: 0
label: Car State Only
- value: 1
label: Map Data Only
- value: 2
label: Car State Priority
- value: 3
label: Map Data Priority
- value: 4
label: Combined
- key: SpeedLimitOffsetType
widget: multiple_button
title: Speed Limit Offset Type
options:
- value: 0
label: 'Off'
- value: 1
label: Fixed
- value: 2
label: Percentage
- key: SpeedLimitValueOffset
widget: option
title: Speed Limit Offset Value
min: -30
max: 30
step: 1
unit:
metric: km/h
imperial: mph
visibility:
- type: param_compare
key: SpeedLimitOffsetType
op: '>'
value: 0
- id: smart_cruise
title: Smart Cruise Control
description: ''
enablement:
- type: any
conditions:
- type: capability
field: has_longitudinal_control
equals: true
- type: capability
field: has_icbm
equals: true
items:
- key: SmartCruiseControlVision
widget: toggle
title: Vision
description: Use vision path predictions to estimate the appropriate speed to drive through turns ahead.
visibility:
- type: any
conditions:
- type: capability
field: has_longitudinal_control
equals: true
- type: capability
field: has_icbm
equals: true
enablement:
- type: any
conditions:
- type: capability
field: has_longitudinal_control
equals: true
- type: capability
field: has_icbm
equals: true
- key: SmartCruiseControlMap
widget: toggle
title: Map
description: Use map data to estimate the appropriate speed to drive through turns ahead.
visibility:
- type: any
conditions:
- type: capability
field: has_longitudinal_control
equals: true
- type: capability
field: has_icbm
equals: true
enablement:
- type: any
conditions:
- type: capability
field: has_longitudinal_control
equals: true
- type: capability
field: has_icbm
equals: true
@@ -0,0 +1,137 @@
# Page: developer
# Edit this file. Run compile_settings_ui.py to emit settings_ui.json.
id: developer
label: Developer
icon: developer
order: 9
remote_configurable: true
description: Debug tools, remote access, and advanced services
sections:
- id: connectivity
title: Connectivity
description: Remote access and debugging interfaces
items:
- key: AdbEnabled
widget: toggle
blocked: true
title: Enable ADB
description: ADB (Android Debug Bridge) allows connecting to your device over USB or over the network. See https://docs.comma.ai/how-to/connect-to-comma
for more info.
enablement:
- $ref: '#/macros/offroad'
- key: SshEnabled
widget: toggle
blocked: true
title: Enable SSH
- key: JoystickDebugMode
widget: toggle
title: Joystick Debug Mode
enablement:
- $ref: '#/macros/offroad'
- key: AlphaLongitudinalEnabled
widget: toggle
needs_onroad_cycle: true
title: sunnypilot Longitudinal Control (Alpha)
description: 'WARNING: sunnypilot longitudinal control is in alpha for this car and will disable Automatic Emergency Braking
(AEB). On this car, sunnypilot defaults to the car''s built-in ACC instead of sunnypilot''s longitudinal control. Enable
this to switch to sunnypilot longitudinal control. Enabling Experimental mode is recommended when enabling sunnypilot
longitudinal control alpha. Changing this setting will restart sunnypilot if the car is powered on.'
visibility:
- type: all
conditions:
- type: capability
field: alpha_long_available
equals: true
- type: not
condition:
type: capability
field: has_icbm
equals: true
enablement:
- $ref: '#/macros/not_engaged'
- key: ShowDebugInfo
widget: toggle
title: UI Debug Mode
- id: test_maneuvers
title: Test Maneuvers
description: 'DANGER: enabling these maneuvers replaces normal driving behavior with deterministic test sequences. Each
toggle requires explicit confirmation per write. Use only in a closed environment.'
visibility:
- type: any
conditions:
- type: capability
field: is_development
equals: true
- type: capability
field: is_sp_release
equals: true
enablement:
- type: any
conditions:
- type: capability
field: is_development
equals: true
- type: param
key: ShowAdvancedControls
equals: true
attestation_required: true
items:
- key: LateralManeuverMode
widget: toggle
title: '[TEST] Lateral Maneuver Mode'
description: Replaces normal lateral control with a deterministic test sequence. NOT for road use.
enablement:
- $ref: '#/macros/not_engaged'
- type: capability
field: torque_allowed
equals: true
- key: LongitudinalManeuverMode
widget: toggle
title: '[TEST] Longitudinal Maneuver Mode'
description: Replaces normal longitudinal control with a deterministic test sequence. NOT for road use.
enablement:
- $ref: '#/macros/not_engaged'
- $ref: '#/macros/longitudinal'
- id: advanced_services
title: Advanced Settings
description: ''
items:
- key: ShowAdvancedControls
widget: toggle
title: Show Advanced Controls
description: Toggle visibility of advanced sunnypilot controls. This only changes the visibility of the toggles; it does
not change the actual enabled/disabled state.
- key: EnableGithubRunner
widget: toggle
title: GitHub Runner Service
description: Enables or disables the GitHub runner service.
visibility:
- $ref: '#/macros/release_branches_hide'
enablement:
- $ref: '#/macros/advanced_only'
- key: EnableCopyparty
widget: toggle
title: copyparty Service
description: copyparty is a very capable file server, you can use it to download your routes, view your logs and even
make some edits on some files from your browser. Requires you to connect to your comma locally via its IP address.
enablement:
- $ref: '#/macros/advanced_only'
- key: QuickBootToggle
widget: toggle
title: Quickboot Mode
visibility:
- type: not
condition:
type: any
conditions:
- type: capability
field: is_sp_release
equals: true
- type: capability
field: is_development
equals: true
enablement:
- type: param
key: DisableUpdates
equals: true
- $ref: '#/macros/advanced_only'
@@ -0,0 +1,67 @@
# Page: device
# Edit this file. Run compile_settings_ui.py to emit settings_ui.json.
id: device
label: Device
icon: device
order: 6
remote_configurable: true
description: Device behavior, units, and recording settings
sections:
- id: general
title: General
description: Power, boot, and unit preferences
items:
- key: OffroadMode
widget: toggle
title: Force Offroad Mode
- key: DeviceBootMode
widget: option
title: Wake Up Behavior
description: 'Controls state of the device after boot/sleep. Default: Device will boot/wake-up normally and will be ready
to engage. Offroad: Device will be in Always Offroad mode after boot/wake-up.'
options:
- value: 0
label: Standard
- value: 1
label: Always Offroad
- key: QuietMode
widget: toggle
title: Quiet Mode
- key: OnroadUploads
widget: toggle
title: Onroad Uploads
- key: MaxTimeOffroad
widget: option
title: Max Time Offroad
description: Device will automatically shutdown after set time once the engine is turned off. 30h is the default.
options:
- value: 0
label: Always On
- value: 5
label: 5m
- value: 10
label: 10m
- value: 15
label: 15m
- value: 30
label: 30m
- value: 60
label: 1h
- value: 120
label: 2h
- value: 180
label: 3h
- value: 300
label: 5h
- value: 600
label: 10h
- value: 1440
label: 24h
- value: 1800
label: 30h (Default)
- id: language
title: Language
items:
- key: LanguageSetting
widget: info
title: Language
@@ -0,0 +1,130 @@
# Page: display
# Edit this file. Run compile_settings_ui.py to emit settings_ui.json.
id: display
label: Display
icon: display
order: 3
remote_configurable: true
description: Screen brightness, timeout, and interactivity settings
sections:
- id: brightness_timeout
title: Brightness & Timeout
description: Screen dimming and sleep behavior while driving
items:
- key: OnroadScreenOffBrightness
widget: multiple_button
title: Onroad Brightness
options:
- value: 0
label: Auto (Default)
- value: 1
label: Auto (Dark)
- value: 2
label: Screen Off
- value: 3
label: 5 %
- value: 4
label: 10 %
- value: 5
label: 15 %
- value: 6
label: 20 %
- value: 7
label: 25 %
- value: 8
label: 30 %
- value: 9
label: 35 %
- value: 10
label: 40 %
- value: 11
label: 45 %
- value: 12
label: 50 %
- value: 13
label: 55 %
- value: 14
label: 60 %
- value: 15
label: 65 %
- value: 16
label: 70 %
- value: 17
label: 75 %
- value: 18
label: 80 %
- value: 19
label: 85 %
- value: 20
label: 90 %
- value: 21
label: 95 %
- value: 22
label: 100 %
- key: OnroadScreenOffTimer
widget: multiple_button
title: Onroad Brightness Delay
options:
- value: 0
label: Always On
- value: 3
label: 3s
- value: 5
label: 5s
- value: 10
label: 10s
- value: 15
label: 15s
- value: 30
label: 30s
- value: 60
label: 1m
- value: 180
label: 3m
- value: 300
label: 5m
- value: 600
label: 10m
enablement:
- type: not
condition:
type: any
conditions:
- type: param
key: OnroadScreenOffBrightness
equals: 0
- type: param
key: OnroadScreenOffBrightness
equals: 1
- key: InteractivityTimeout
widget: multiple_button
title: Interactivity Timeout
description: Apply a custom timeout for settings UI. This is the time after which settings UI closes automatically if
user is not interacting with the screen.
options:
- value: 0
label: Default
- value: 10
label: 10 s
- value: 20
label: 20 s
- value: 30
label: 30 s
- value: 40
label: 40 s
- value: 50
label: 50 s
- value: 60
label: 1 m
- value: 70
label: 1 m
- value: 80
label: 1 m
- value: 90
label: 1 m
- value: 100
label: 1 m
- value: 110
label: 1 m
- value: 120
label: 2 m
@@ -0,0 +1,89 @@
# Page: models
# Edit this file. Run compile_settings_ui.py to emit settings_ui.json.
id: models
label: Models
icon: models
order: 10
remote_configurable: false
description: Driving model behavior and camera calibration
sections:
- id: model_behavior
title: Model Behavior
description: Lane desire and lead-vehicle awareness tuning
items:
- key: LaneTurnDesire
widget: toggle
title: Use Lane Turn Desires
description: If you are driving at 20 mph (32 km/h) or below and have your blinker on, the car will plan a turn in that
direction at the nearest drivable path. This prevents situations (like at red lights) where the car might plan the wrong
turn direction.
- key: LaneTurnValue
widget: option
title: Adjust Lane Turn Speed
description: Set the maximum speed for lane turn desires.
min: 0
max: 20
step: 1
unit:
metric: km/h
imperial: mph
enablement:
- type: param
key: LaneTurnDesire
equals: true
- $ref: '#/macros/advanced_only'
- key: LagdToggle
widget: toggle
title: Live Learning Steer Delay
description: Allow device to learn and adapt car's steering response time
- key: LagdToggleDelay
widget: option
title: Adjust Software Delay
description: Adjust the software delay when Live Learning Steer Delay is toggled off. The default software delay value
is 0.2
min: 0.05
max: 0.5
step: 0.01
enablement:
- type: not
condition:
type: param
key: LagdToggle
equals: true
- $ref: '#/macros/advanced_only'
- id: lateral_control
title: Lateral Control
description: Neural network lateral control for supported models
items:
- key: NeuralNetworkLateralControl
widget: toggle
title: Neural Network Lateral Control (NNLC)
description: Use a neural network for lateral control instead of the default torque controller.
visibility:
- type: not
condition:
type: capability
field: steer_control_type
equals: angle
enablement:
- $ref: '#/macros/offroad'
- type: capability
field: torque_allowed
equals: true
- type: param
key: EnforceTorqueControl
equals: false
- id: camera
title: Camera
description: Camera position and calibration
items:
- key: CameraOffset
widget: option
title: Adjust Camera Offset
description: Virtually shift camera's perspective to move model's center to Left(+ values) or Right (- values)
min: -0.35
max: 0.35
step: 0.01
unit: meters
enablement:
- $ref: '#/macros/advanced_only'
@@ -0,0 +1,20 @@
# Page: software
# Edit this file. Run compile_settings_ui.py to emit settings_ui.json.
id: software
label: Software
icon: software
order: 7
remote_configurable: true
description: Software update preferences
sections:
- id: updates
title: Updates
description: Control automatic software updates
items:
- key: DisableUpdates
widget: toggle
title: Disable Updates
description: When enabled, automatic software updates will be off. This requires a reboot to take effect.
enablement:
- $ref: '#/macros/offroad'
- $ref: '#/macros/advanced_only'
@@ -0,0 +1,257 @@
# Page: steering
# Edit this file. Run compile_settings_ui.py to emit settings_ui.json.
id: steering
label: Steering
icon: steering_wheel
order: 1
remote_configurable: true
description: Lateral control, lane changes, and steering behavior
sections:
- id: mads
title: Modular Assistive Driving System (MADS)
description: ''
items:
- key: Mads
widget: toggle
title: Enable Modular Assistive Driving System (MADS)
description: Enable MADS. Disable toggle to revert back to stock sunnypilot engagement/disengagement.
enablement:
- $ref: '#/macros/offroad'
sub_panels:
- id: mads_settings
label: MADS Settings
trigger_key: Mads
trigger_condition:
type: param
key: Mads
equals: true
items:
- key: MadsMainCruiseAllowed
widget: toggle
title: Toggle with Main Cruise
description: 'Note: For vehicles without LFA/LKAS button, disabling this will prevent lateral control engagement.'
enablement:
- $ref: '#/macros/offroad'
- $ref: '#/macros/mads_full_platforms'
- key: MadsUnifiedEngagementMode
widget: toggle
title: Unified Engagement Mode (UEM)
description: 'Engage lateral and longitudinal control with cruise control engagement. Note: Once lateral control is
engaged via UEM, it will remain engaged until it is manually disabled via the MADS button or car shut off.'
enablement:
- $ref: '#/macros/offroad'
- $ref: '#/macros/mads_full_platforms'
- key: MadsSteeringMode
widget: multiple_button
title: Steering Mode on Brake Pedal
description: Choose how Automatic Lane Centering (ALC) behaves after the brake pedal is manually pressed in sunnypilot.
options:
- value: 0
label: Remain Active
enablement:
- $ref: '#/macros/mads_full_platforms'
- value: 1
label: Pause
enablement:
- $ref: '#/macros/mads_full_platforms'
- value: 2
label: Disengage
enablement:
- $ref: '#/macros/offroad'
- id: blinker
title: Blinker Control
description: Lateral pause behavior during turn signals
items:
- key: BlinkerPauseLateralControl
widget: toggle
title: Pause Lateral Control with Blinker
description: Pause lateral control with blinker when traveling below the desired speed selected.
sub_items:
- key: BlinkerMinLateralControlSpeed
widget: option
title: Minimum Speed to Pause Lateral Control
min: 0
max: 255
step: 5
unit:
metric: km/h
imperial: mph
enablement:
- type: param
key: BlinkerPauseLateralControl
equals: true
- key: BlinkerLateralReengageDelay
widget: option
title: Post-Blinker Delay
description: Delay before lateral control resumes after the turn signal ends.
min: 0
max: 10
step: 1
unit: second
enablement:
- type: param
key: BlinkerPauseLateralControl
equals: true
- id: torque
title: Torque Control
description: Steering torque tuning and lateral control method
enablement:
- type: capability
field: torque_allowed
equals: true
items:
- key: EnforceTorqueControl
widget: toggle
title: Enforce Torque Lateral Control
description: Enable this to enforce sunnypilot to steer with Torque lateral control.
visibility:
- type: not
condition:
type: capability
field: steer_control_type
equals: angle
enablement:
- $ref: '#/macros/offroad'
- type: capability
field: torque_allowed
equals: true
- type: param
key: NeuralNetworkLateralControl
equals: false
sub_panels:
- id: torque_settings
label: Torque Settings
trigger_key: EnforceTorqueControl
trigger_condition:
type: param
key: EnforceTorqueControl
equals: true
items:
- key: LiveTorqueParamsToggle
widget: toggle
title: Self-Tune
description: Enables self-tune for Torque lateral control for platforms that do not use Torque lateral control by default.
enablement:
- $ref: '#/macros/offroad'
- key: LiveTorqueParamsRelaxedToggle
widget: toggle
title: Less Restrict Settings for Self-Tune (Beta)
description: Less strict settings when using Self-Tune. This allows torqued to be more forgiving when learning values.
enablement:
- $ref: '#/macros/offroad'
- type: param
key: LiveTorqueParamsToggle
equals: true
- key: CustomTorqueParams
widget: toggle
title: Enable Custom Tuning
description: Enables custom tuning for Torque lateral control. Modifying Lateral Acceleration Factor and Friction below
will override the offline values indicated in the YAML files within "opendbc/car/torque_data". The values will also
be used live when "Manual Real-Time Tuning" toggle is enabled.
enablement:
- $ref: '#/macros/offroad'
- key: TorqueParamsOverrideEnabled
widget: toggle
title: Manual Real-Time Tuning
description: Enforces the torque lateral controller to use the fixed values instead of the learned values from Self-Tune.
Enabling this toggle overrides Self-Tune values.
enablement:
- $ref: '#/macros/offroad'
- type: param
key: CustomTorqueParams
equals: true
- key: TorqueParamsOverrideLatAccelFactor
widget: option
title: Lateral Acceleration Factor
title_param_suffix:
param: TorqueParamsOverrideEnabled
values:
'true': (Real-Time & Offline)
'false': (Offline Only)
min: 0.1
max: 5.0
step: 0.1
unit: m/s²
enablement:
- type: param
key: CustomTorqueParams
equals: true
- type: any
conditions:
- type: param
key: TorqueParamsOverrideEnabled
equals: true
- type: offroad_only
- key: TorqueParamsOverrideFriction
widget: option
title: Friction
title_param_suffix:
param: TorqueParamsOverrideEnabled
values:
'true': (Real-Time & Offline)
'false': (Offline Only)
min: 0.0
max: 1.0
step: 0.01
enablement:
- type: param
key: CustomTorqueParams
equals: true
- type: any
conditions:
- type: param
key: TorqueParamsOverrideEnabled
equals: true
- type: offroad_only
- key: TorqueControlTune
widget: multiple_button
title: Torque Control Tune Version
description: Select the version of Torque Control Tune to use.
options:
- value: ''
label: Default
- value: 1.0
label: v1.0
- value: 0.0
label: v0.0
enablement:
- $ref: '#/macros/offroad'
- id: lane_change
title: Lane Change
description: Automatic lane change timing and behavior
items:
- key: AutoLaneChangeTimer
widget: option
title: Auto Lane Change by Blinker
description: |-
Set a timer to delay the auto lane change operation when the blinker is used. No nudge on the steering wheel is required to auto lane change if a timer is set. Default is Nudge.
details: |-
Please use caution when using this feature. Only use the blinker when traffic and road conditions permit.
options:
- value: -1
label: 'Off'
- value: 0
label: Nudge
- value: 1
label: Nudgeless
- value: 2
label: 0.5 second
- value: 3
label: 1 second
- value: 4
label: 2 seconds
- value: 5
label: 3 seconds
- key: AutoLaneChangeBsmDelay
widget: toggle
title: 'Auto Lane Change: Delay with Blind Spot'
description: Toggle to enable a delay timer for lane changes when blind spot monitoring (BSM) detects a vehicle in your blind
spot.
enablement:
- type: capability
field: enable_bsm
equals: true
- type: param_compare
key: AutoLaneChangeTimer
op: '>'
value: 0
@@ -0,0 +1,49 @@
# Page: toggles
# Edit this file. Run compile_settings_ui.py to emit settings_ui.json.
id: toggles
label: Toggles
icon: toggles
order: 5
remote_configurable: true
description: Core openpilot feature toggles
sections:
- id: core_toggles
title: ''
description: ''
items:
- key: OpenpilotEnabledToggle
widget: toggle
needs_onroad_cycle: true
title: Enable sunnypilot
description: Use the sunnypilot system for adaptive cruise control and lane keep driver assistance. Your attention is
required at all times to use this feature.
enablement:
- $ref: '#/macros/offroad'
- key: IsLdwEnabled
widget: toggle
title: Enable Lane Departure Warnings
description: Receive alerts to steer back into the lane when your vehicle drifts over a detected lane line without a turn
signal activated while driving over 31 mph (50 km/h).
- key: AlwaysOnDM
widget: toggle
title: Always-On Driver Monitoring
description: Enable driver monitoring even when sunnypilot is not engaged.
- key: IsMetric
widget: toggle
title: Use Metric System
description: Display speed in km/h instead of mph.
- id: recording
title: Recording
description: Camera and audio recording during drives
items:
- key: RecordFront
widget: toggle
needs_onroad_cycle: true
title: Record and Upload Driver Camera
description: Upload data from the driver facing camera and help improve the driver monitoring algorithm.
- key: RecordAudio
widget: toggle
needs_onroad_cycle: true
title: Record and Upload Microphone Audio
description: Record and store microphone audio while driving. The audio will be included in the dashcam video in comma
connect.
@@ -0,0 +1,81 @@
# Page: vehicle (per-brand settings)
# Compiles to settings_ui.json#vehicle_settings (brand = section id).
id: vehicle
label: Vehicle
icon: vehicle
order: 99
kind: vehicle
sections:
- id: hyundai
title: Hyundai / Kia / Genesis Settings
description: ''
items:
- key: HyundaiLongitudinalTuning
widget: multiple_button
title: Custom Longitudinal Tuning
options:
- value: 0
label: 'Off'
- value: 1
label: Dynamic
- value: 2
label: Predictive
visibility:
- type: capability
field: hyundai_alpha_long_available
equals: true
enablement:
- $ref: '#/macros/offroad'
- $ref: '#/macros/longitudinal'
- id: subaru
title: Subaru Settings
description: ''
items:
- key: SubaruStopAndGo
widget: toggle
title: Stop and Go (Beta)
enablement:
- $ref: '#/macros/offroad'
- type: capability
field: has_stop_and_go
equals: true
- key: SubaruStopAndGoManualParkingBrake
widget: toggle
title: Stop and Go for Manual Parking Brake (Beta)
enablement:
- $ref: '#/macros/offroad'
- type: capability
field: has_stop_and_go
equals: true
- id: tesla
title: Tesla Settings
description: ''
items:
- key: TeslaCoopSteering
widget: toggle
title: Cooperative Steering (Beta)
enablement:
- $ref: '#/macros/offroad'
- id: toyota
title: Toyota / Lexus Settings
description: ''
items:
- key: ToyotaEnforceStockLongitudinal
widget: toggle
needs_onroad_cycle: true
title: Enforce Factory Longitudinal Control
description: sunnypilot will not take over control of gas and brakes. Factory Toyota longitudinal control will be used.
enablement:
- $ref: '#/macros/not_engaged'
- key: ToyotaStopAndGoHack
widget: toggle
needs_onroad_cycle: true
title: Stop and Go Hack (Alpha)
description: sunnypilot will allow some Toyota/Lexus cars to auto resume during stop and go traffic. This feature is only
applicable to certain models that are able to use longitudinal control. This is an alpha feature. Use at your own risk.
enablement:
- $ref: '#/macros/not_engaged'
- $ref: '#/macros/longitudinal'
- type: param
key: ToyotaEnforceStockLongitudinal
equals: false
@@ -0,0 +1,111 @@
# Page: visuals
# Edit this file. Run compile_settings_ui.py to emit settings_ui.json.
id: visuals
label: Visuals
icon: visuals
order: 4
remote_configurable: true
description: HUD overlays, alerts, and on-screen display elements
sections:
- id: hud_elements
title: HUD Elements
description: Overlays shown on the driving screen
items:
- key: BlindSpot
widget: toggle
title: Show Blind Spot Warnings
description: Enabling this will display warnings when a vehicle is detected in your blind spot as long as your car has
BSM supported.
- key: TorqueBar
widget: toggle
title: Steering Arc
description: Display steering arc on the driving screen when lateral control is enabled.
- key: ShowTurnSignals
widget: toggle
title: Display Turn Signals
description: When enabled, visual turn indicators are drawn on the HUD.
- key: RoadNameToggle
widget: toggle
title: Display Road Name
description: Displays the name of the road the car is traveling on. The OpenStreetMap database of the location must be
downloaded to fetch the road name.
visibility:
- $ref: '#/macros/hide_on_mici'
- key: StandstillTimer
widget: toggle
title: Standstill Timer
description: Show a timer on the HUD when the car is at a standstill.
visibility:
- $ref: '#/macros/hide_on_mici'
- key: RocketFuel
widget: toggle
title: Real-time Acceleration Bar
description: Show an indicator on the left side of the screen to display real-time vehicle acceleration and deceleration.
This displays what the car is currently doing, not what the planner is requesting.
visibility:
- $ref: '#/macros/hide_on_mici'
- key: ChevronInfo
widget: option
title: Display Metrics Below Chevron
options:
- value: 0
label: 'Off'
- value: 1
label: Distance
- value: 2
label: Speed
- value: 3
label: Time
- value: 4
label: All
visibility:
- $ref: '#/macros/hide_on_mici'
enablement:
- $ref: '#/macros/longitudinal'
- id: developer_ui
title: Developer UI Info
description: Speedometer and debug display options
visibility:
- $ref: '#/macros/hide_on_mici'
items:
- key: DevUIInfo
widget: option
title: Developer UI
description: Display real-time parameters and metrics from various sources.
options:
- value: 0
label: 'Off'
- value: 1
label: Bottom
- value: 2
label: Right
- value: 3
label: Right & Bottom
- key: TrueVEgoUI
widget: toggle
title: 'Speedometer: Always Display True Speed'
description: For applicable vehicles, always display the true vehicle current speed from wheel speed sensors.
- key: HideVEgoUI
widget: toggle
title: 'Speedometer: Hide from Onroad Screen'
description: When enabled, the speedometer on the onroad screen is not displayed.
- id: alerts_extras
title: Alerts & Extras
description: Traffic light alerts and visual flair
items:
- key: GreenLightAlert
widget: toggle
title: Green Traffic Light Alert (Beta)
description: 'A chime and on-screen alert will play when the traffic light you are waiting for turns green and you have
no vehicle in front of you. On-screen visual alert is only available on comma 3X. Note: This chime is only designed
as a notification. It is the driver''s responsibility to observe their environment and make decisions accordingly.'
- key: LeadDepartAlert
widget: toggle
title: Lead Departure Alert (Beta)
description: 'A chime and on-screen alert will play when you are stopped, and the vehicle in front of you start moving.
On-screen visual alert is only available on comma 3X. Note: This chime is only designed as a notification. It is the
driver''s responsibility to observe their environment and make decisions accordingly.'
- key: RainbowMode
widget: toggle
title: Tesla Rainbow Mode
description: Display a rainbow effect on the path the model wants to take. It does not affect driving in any way.
@@ -0,0 +1,92 @@
"""
Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors.
This file is part of sunnypilot and is licensed under the MIT License.
See the LICENSE.md file in the root directory for more details.
Sentinel tests for the capabilities payload contract. PROTOCOL_VERSION is the
wire-protocol version observable by the dashboard; bumping it is a breaking
change and must be intentional. KNOWN_PROTOCOL_VERSIONS pins the set we
explicitly support when the constant is bumped, this list must be edited in
the same commit so the bump shows up in code review.
"""
from __future__ import annotations
import pytest
from openpilot.sunnypilot.sunnylink.capabilities import (
CAPABILITY_DEFAULTS,
CAPABILITY_FIELDS,
CAPABILITY_LABELS,
PROTOCOL_VERSION,
generate_capabilities,
)
KNOWN_PROTOCOL_VERSIONS = (1,)
LATEST_KNOWN = max(KNOWN_PROTOCOL_VERSIONS)
@pytest.fixture(scope="module")
def caps():
return generate_capabilities()
class TestProtocolVersion:
def test_protocol_version_in_capability_fields(self):
assert "protocol_version" in CAPABILITY_FIELDS
def test_protocol_version_has_label(self):
assert "protocol_version" in CAPABILITY_LABELS
def test_protocol_version_default_is_set(self):
assert CAPABILITY_DEFAULTS.get("protocol_version") == PROTOCOL_VERSION
def test_protocol_version_emitted(self, caps):
assert "protocol_version" in caps
assert isinstance(caps["protocol_version"], int)
assert caps["protocol_version"] >= 1
def test_protocol_version_matches_constant(self, caps):
assert caps["protocol_version"] == PROTOCOL_VERSION
def test_protocol_version_is_known(self):
"""Sentinel against accidental bumps. Edit KNOWN_PROTOCOL_VERSIONS if intentional."""
assert PROTOCOL_VERSION in KNOWN_PROTOCOL_VERSIONS, (
f"PROTOCOL_VERSION={PROTOCOL_VERSION} is not in KNOWN_PROTOCOL_VERSIONS={KNOWN_PROTOCOL_VERSIONS}. " +
"If this bump is intentional, add it to KNOWN_PROTOCOL_VERSIONS."
)
def test_protocol_version_matches_latest_known(self):
assert PROTOCOL_VERSION == LATEST_KNOWN, (
"Test invariant: PROTOCOL_VERSION must equal max(KNOWN_PROTOCOL_VERSIONS)."
)
class TestOpaquePerBrandFlags:
def test_subaru_has_sng_field_present(self):
assert "subaru_has_sng" in CAPABILITY_FIELDS
def test_hyundai_alpha_long_available_field_present(self):
assert "hyundai_alpha_long_available" in CAPABILITY_FIELDS
def test_subaru_has_sng_default_false(self, caps):
assert caps["subaru_has_sng"] is False
def test_hyundai_alpha_long_available_default_false(self, caps):
assert caps["hyundai_alpha_long_available"] is False
class TestCapabilitiesShape:
def test_all_fields_present(self, caps):
for field in CAPABILITY_FIELDS:
assert field in caps, f"capabilities missing {field}"
def test_all_fields_have_labels(self):
for field in CAPABILITY_FIELDS:
assert field in CAPABILITY_LABELS, f"CAPABILITY_LABELS missing {field}"
def test_string_defaults_are_strings(self, caps):
assert isinstance(caps["brand"], str)
assert isinstance(caps["steer_control_type"], str)
assert isinstance(caps["device_type"], str)
@@ -0,0 +1,194 @@
"""
Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors.
This file is part of sunnypilot and is licensed under the MIT License.
See the LICENSE.md file in the root directory for more details.
Tests for the settings_ui_src/ -> settings_ui.json compiler. Covers:
- Roundtrip: compiled output matches the checked-in settings_ui.json
- $ref macro resolution semantics (list-splice, scalar-substitute, depth, cycles)
- Per-page tree integrity (every page has id; vehicle page emits to vehicle_settings)
Does not cover device-side generator (test_settings_schema.py) or per-bug
regression (test_settings_changes.py); those continue to validate the
compiled output once the compiler has produced it.
"""
from __future__ import annotations
import difflib
import json
import os
import pytest
import yaml
from openpilot.sunnypilot.sunnylink.tools.compile_settings_ui import (
CompileError,
DEFAULT_OUT,
DEFAULT_SRC,
_resolve_refs,
compile_schema,
)
@pytest.fixture(scope="module")
def compiled() -> dict:
return compile_schema(DEFAULT_SRC)
@pytest.fixture(scope="module")
def committed() -> dict:
with open(DEFAULT_OUT) as f:
return json.load(f)
class TestRoundtrip:
def test_compiled_matches_committed(self, compiled, committed):
"""Compiled output must match the checked-in JSON."""
if compiled == committed:
return
diff = "\n".join(difflib.unified_diff(
json.dumps(committed, indent=2).splitlines(),
json.dumps(compiled, indent=2).splitlines(),
fromfile="settings_ui.json (committed)",
tofile="settings_ui.json (freshly compiled)",
lineterm="",
))
pytest.fail(f"settings_ui.json schema mismatch — run compile_settings_ui.py\n\n{diff}")
def test_committed_file_is_canonical(self):
"""Compiled output must byte-match the checked-in file (including trailing newline).
Drift means someone edited settings_ui.json by hand instead of editing settings_ui_src/."""
schema = compile_schema(DEFAULT_SRC)
rendered = json.dumps(schema, indent=2) + "\n"
with open(DEFAULT_OUT) as f:
current = f.read()
if current == rendered:
return
diff = "\n".join(difflib.unified_diff(
current.splitlines(),
rendered.splitlines(),
fromfile="settings_ui.json (on disk)",
tofile="settings_ui.json (freshly compiled)",
lineterm="",
))
pytest.fail(f"settings_ui.json out of sync — run compile_settings_ui.py\n\n{diff}")
class TestRefResolution:
def test_list_context_splices(self):
macros = {"a": [{"type": "offroad_only"}], "b": [{"type": "not_engaged"}]}
out = _resolve_refs([{"$ref": "#/macros/a"}, {"$ref": "#/macros/b"}], macros)
assert out == [{"type": "offroad_only"}, {"type": "not_engaged"}]
def test_scalar_context_substitutes(self):
macros = {"x": {"type": "capability", "field": "brand", "equals": "tesla"}}
out = _resolve_refs({"condition": {"$ref": "#/macros/x"}}, macros)
assert out == {"condition": {"type": "capability", "field": "brand", "equals": "tesla"}}
def test_chained_ref_resolves(self):
macros = {
"leaf": [{"type": "offroad_only"}],
"middle": [{"$ref": "#/macros/leaf"}],
}
out = _resolve_refs([{"$ref": "#/macros/middle"}], macros)
assert out == [{"type": "offroad_only"}]
def test_unknown_macro_raises(self):
with pytest.raises(CompileError, match="unknown macro"):
_resolve_refs([{"$ref": "#/macros/missing"}], {})
def test_cycle_raises(self):
macros = {"a": [{"$ref": "#/macros/b"}], "b": [{"$ref": "#/macros/a"}]}
with pytest.raises(CompileError, match="cycle"):
_resolve_refs([{"$ref": "#/macros/a"}], macros)
def test_depth_limit(self):
# Depth 4 chain should fail (limit is 3).
macros = {
"l1": [{"$ref": "#/macros/l2"}],
"l2": [{"$ref": "#/macros/l3"}],
"l3": [{"$ref": "#/macros/l4"}],
"l4": [{"type": "offroad_only"}],
}
with pytest.raises(CompileError, match="depth"):
_resolve_refs([{"$ref": "#/macros/l1"}], macros)
def test_invalid_ref_scheme(self):
with pytest.raises(CompileError, match="unsupported"):
_resolve_refs([{"$ref": "https://example.com/x"}], {})
def test_scalar_macro_in_list_context_raises(self):
macros = {"x": {"type": "offroad_only"}} # macro is a single rule (dict), not a list
with pytest.raises(CompileError, match="must resolve to a list"):
_resolve_refs([{"$ref": "#/macros/x"}], macros)
class TestCompiledShape:
def test_panels_present(self, compiled):
assert isinstance(compiled["panels"], list)
assert len(compiled["panels"]) == 9
panel_ids = {p["id"] for p in compiled["panels"]}
assert {"steering", "cruise", "display", "visuals", "toggles",
"device", "software", "developer", "models"} <= panel_ids
def test_vehicle_settings_consistent_shape(self, compiled):
"""Each brand in vehicle_settings must have {title, description, items}."""
for brand, data in compiled["vehicle_settings"].items():
assert isinstance(data, dict), f"{brand}: expected object, got {type(data).__name__}"
assert "title" in data, f"{brand}: missing title"
assert "description" in data, f"{brand}: missing description"
assert "items" in data, f"{brand}: missing items"
def test_no_dangling_refs_after_compile(self, compiled):
"""All $ref objects must be resolved during compilation."""
def walk(node):
if isinstance(node, dict):
if "$ref" in node:
pytest.fail(f"unresolved $ref: {node}")
for v in node.values():
walk(v)
elif isinstance(node, list):
for x in node:
walk(x)
walk(compiled)
class TestSourceTreeIntegrity:
def test_macros_yaml_well_formed(self):
with open(os.path.join(DEFAULT_SRC, "_macros.yaml")) as f:
doc = yaml.safe_load(f)
assert "macros" in doc
for name, body in doc["macros"].items():
assert name.replace("_", "").isalnum(), f"macro name '{name}' must be alphanumeric_"
assert body, f"macro '{name}' empty"
def test_pages_dir_well_formed(self):
pages_dir = os.path.join(DEFAULT_SRC, "pages")
assert os.path.isdir(pages_dir), "pages/ directory missing"
page_files = sorted(fn for fn in os.listdir(pages_dir) if fn.endswith(".yaml"))
# 9 panels + 1 vehicle = 10
assert len(page_files) == 10, f"expected 10 pages, found {len(page_files)}: {page_files}"
def test_every_page_has_id(self):
pages_dir = os.path.join(DEFAULT_SRC, "pages")
for fn in sorted(os.listdir(pages_dir)):
if not fn.endswith(".yaml"):
continue
path = os.path.join(pages_dir, fn)
with open(path) as f:
doc = yaml.safe_load(f)
assert isinstance(doc, dict), f"{path}: top-level must be a mapping"
assert "id" in doc, f"{path}: page missing 'id'"
# File basename should match page id (modulo .yaml extension).
expected_id = os.path.splitext(fn)[0]
assert doc["id"] == expected_id, (
f"{path}: page id '{doc['id']}' must match filename '{expected_id}'"
)
def test_vehicle_page_kind(self):
"""vehicle.yaml must declare kind: vehicle so it routes to vehicle_settings."""
path = os.path.join(DEFAULT_SRC, "pages", "vehicle.yaml")
with open(path) as f:
doc = yaml.safe_load(f)
assert doc.get("kind") == "vehicle", "vehicle.yaml must declare kind: vehicle"
@@ -0,0 +1,219 @@
"""
Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors.
This file is part of sunnypilot and is licensed under the MIT License.
See the LICENSE.md file in the root directory for more details.
Per-bug regression tests for the Raylib-vs-schema parity audit. Each test
isolates one of the gating bugs that the design-overhaul branch fixes so a
future regression is loud and obvious. These tests are intentionally narrow
and additive they do not replace the broader test_settings_schema.py.
"""
from __future__ import annotations
import json
import os
from typing import Any
import pytest
from openpilot.sunnypilot.sunnylink.tools.generate_settings_schema import (
DEFINITION_PATH,
TORQUE_VERSIONS_PATH,
_build_torque_options,
_load_torque_versions,
generate_schema,
)
SCHEMA_VALIDATOR_PATH = os.path.join(os.path.dirname(DEFINITION_PATH), "settings_ui.schema.json")
def _walk_items(schema: dict[str, Any]):
"""Yield every item dict from the schema."""
def _yield(item: dict[str, Any]):
yield item
for sub in item.get("sub_items", []):
yield from _yield(sub)
for panel in schema.get("panels", []):
for section in panel.get("sections", []):
for item in section.get("items", []):
yield from _yield(item)
for sp in section.get("sub_panels", []):
for item in sp.get("items", []):
yield from _yield(item)
for item in panel.get("items", []):
yield from _yield(item)
for sp in panel.get("sub_panels", []):
for item in sp.get("items", []):
yield from _yield(item)
for brand in schema.get("vehicle_settings", {}).values():
items = brand.get("items", []) if isinstance(brand, dict) else brand
for item in items:
yield from _yield(item)
def _find_item(schema: dict[str, Any], key: str) -> dict[str, Any] | None:
for item in _walk_items(schema):
if item.get("key") == key:
return item
return None
def _find_section(schema: dict[str, Any], panel_id: str, section_id: str) -> dict[str, Any] | None:
for panel in schema.get("panels", []):
if panel.get("id") != panel_id:
continue
for section in panel.get("sections", []):
if section.get("id") == section_id:
return section
return None
def _flatten_rule_types(rules: list[dict[str, Any]] | None) -> set[str]:
out: set[str] = set()
def _walk(rule: dict[str, Any]) -> None:
out.add(rule.get("type", ""))
if rule.get("type") == "not" and "condition" in rule:
_walk(rule["condition"])
elif rule.get("type") in ("any", "all"):
for c in rule.get("conditions", []):
_walk(c)
for rule in rules or []:
_walk(rule)
return out
def _references_capability_field(rules: list[dict[str, Any]] | None, field: str) -> bool:
found = False
def _walk(rule: dict[str, Any]) -> None:
nonlocal found
if rule.get("type") == "capability" and rule.get("field") == field:
found = True
elif rule.get("type") == "not" and "condition" in rule:
_walk(rule["condition"])
elif rule.get("type") in ("any", "all"):
for c in rule.get("conditions", []):
_walk(c)
for rule in rules or []:
_walk(rule)
return found
@pytest.fixture(scope="module")
def schema():
return generate_schema()
class TestMadsBrandGates:
def test_mads_main_cruise_has_brand_gate(self, schema):
"""MadsMainCruiseAllowed must gate on brand and tesla_has_vehicle_bus."""
item = _find_item(schema, "MadsMainCruiseAllowed")
assert item is not None
assert _references_capability_field(item.get("enablement"), "brand")
assert _references_capability_field(item.get("enablement"), "tesla_has_vehicle_bus")
def test_mads_unified_engagement_has_brand_gate(self, schema):
"""MadsUnifiedEngagementMode must mirror MadsMainCruiseAllowed brand-gate."""
item = _find_item(schema, "MadsUnifiedEngagementMode")
assert item is not None
assert _references_capability_field(item.get("enablement"), "brand")
assert _references_capability_field(item.get("enablement"), "tesla_has_vehicle_bus")
class TestTestManeuversSection:
def test_lateral_maneuver_mode_in_test_maneuvers(self, schema):
section = _find_section(schema, "developer", "test_maneuvers")
assert section is not None, "developer.test_maneuvers section missing"
keys = {item["key"] for item in section.get("items", [])}
assert "LateralManeuverMode" in keys
assert "LongitudinalManeuverMode" in keys
def test_test_maneuvers_section_requires_attestation(self, schema):
section = _find_section(schema, "developer", "test_maneuvers")
assert section is not None
assert section.get("attestation_required") is True
def test_test_maneuvers_section_visibility_gate(self, schema):
section = _find_section(schema, "developer", "test_maneuvers")
assert section is not None
visibility = section.get("visibility")
assert visibility, "test_maneuvers must have visibility gate"
vis_refs = json.dumps(visibility)
assert "is_development" in vis_refs
assert "is_sp_release" in vis_refs
enablement = section.get("enablement") or []
enable_refs = json.dumps(enablement)
assert "ShowAdvancedControls" in enable_refs, \
"test_maneuvers must gate ShowAdvancedControls via enablement"
class TestValidator:
def test_validator_accepts_real_json(self):
"""settings_ui.json validates against settings_ui.schema.json."""
jsonschema = pytest.importorskip("jsonschema")
with open(DEFINITION_PATH) as f:
data = json.load(f)
with open(SCHEMA_VALIDATOR_PATH) as f:
validator = json.load(f)
jsonschema.validate(instance=data, schema=validator)
class TestTorqueOptionGeneration:
def test_torque_versions_match_generated_options(self, schema):
versions = _load_torque_versions()
assert versions, "latcontrol_torque_versions.json must have at least one version"
expected = _build_torque_options(versions)
item = _find_item(schema, "TorqueControlTune")
assert item is not None, "TorqueControlTune item must be present"
assert item.get("options") == expected
def test_torque_versions_path_resolves(self):
assert os.path.exists(TORQUE_VERSIONS_PATH), (
f"latcontrol_torque_versions.json not found at {TORQUE_VERSIONS_PATH}"
)
class TestReleaseBranchGates:
@pytest.mark.parametrize("key", [
"EnableGithubRunner",
"QuickBootToggle",
])
def test_sp_dev_items_gate_on_is_sp_release(self, schema, key):
"""sunnypilot dev items must hide on sunnypilot release branches (is_sp_release gate)."""
item = _find_item(schema, key)
assert item is not None, f"{key} not found in schema"
rules = (item.get("visibility") or []) + (item.get("enablement") or [])
assert _references_capability_field(rules, "is_sp_release"), f"{key} missing is_sp_release gate"
class TestSpuriousOffroadGatesDropped:
def test_disengage_on_accelerator_has_no_offroad_only(self, schema):
item = _find_item(schema, "DisengageOnAccelerator")
assert item is not None
assert "offroad_only" not in _flatten_rule_types(item.get("enablement"))
def test_dynamic_experimental_has_no_offroad_only(self, schema):
item = _find_item(schema, "DynamicExperimentalControl")
assert item is not None
assert "offroad_only" not in _flatten_rule_types(item.get("enablement"))
class TestNotEngagedReplacement:
@pytest.mark.parametrize("key", [
"AlphaLongitudinalEnabled",
"ToyotaEnforceStockLongitudinal",
"ToyotaStopAndGoHack",
])
def test_offroad_only_replaced_with_not_engaged(self, schema, key):
"""These items should use not_engaged, not offroad_only."""
item = _find_item(schema, key)
assert item is not None, f"{key} not found"
rule_types = _flatten_rule_types(item.get("enablement"))
assert "offroad_only" not in rule_types, f"{key} still uses offroad_only"
assert "not_engaged" in rule_types, f"{key} missing not_engaged"
@@ -0,0 +1,353 @@
"""
Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors.
This file is part of sunnypilot and is licensed under the MIT License.
See the LICENSE.md file in the root directory for more details.
"""
import json
import pytest
from openpilot.common.params import Params
from openpilot.sunnypilot.sunnylink.tools.generate_settings_schema import (
SCHEMA_VERSION,
generate_schema,
generate_schema_json,
collect_all_keys,
collect_capability_refs,
)
from openpilot.sunnypilot.sunnylink.capabilities import CAPABILITY_FIELDS
VALID_WIDGET_TYPES = {"toggle", "option", "multiple_button", "button", "info"}
VALID_RULE_TYPES = {"offroad_only", "not_engaged", "capability", "param", "param_compare", "not", "any", "all"}
VALID_COMPARE_OPS = {">", "<", ">=", "<="}
MAX_ALLOWED_MISSING_TITLES = 0 # All items must have titles (metadata is inline in settings_ui.json)
def _iter_panel_items(panel: dict):
"""Yield top-level items from a panel (non-recursive)."""
for item in panel.get("items", []):
yield item
for sp in panel.get("sub_panels", []):
for item in sp.get("items", []):
yield item
for section in panel.get("sections", []):
for item in section.get("items", []):
yield item
for sp in section.get("sub_panels", []):
for item in sp.get("items", []):
yield item
def _iter_all_sub_panels(panel: dict):
"""Yield all sub_panels from a panel and its sections."""
yield from panel.get("sub_panels", [])
for section in panel.get("sections", []):
yield from section.get("sub_panels", [])
def _brand_items(brand_data) -> list[dict]:
"""Extract items from vehicle_settings[brand] (handles dict or list)."""
if isinstance(brand_data, dict):
return brand_data.get("items", [])
if isinstance(brand_data, list):
return brand_data
return []
@pytest.fixture(scope="module")
def schema():
return generate_schema()
@pytest.fixture(scope="module")
def all_param_keys():
"""All keys registered in the device param store."""
return {k.decode("utf-8") for k in Params().all_keys()}
class TestSchemaStructure:
def test_schema_is_valid_json(self):
"""Schema serializes to valid JSON."""
raw = generate_schema_json()
parsed = json.loads(raw)
assert isinstance(parsed, dict)
def test_has_required_top_level_fields(self, schema):
assert "schema_version" in schema
assert schema["schema_version"] == SCHEMA_VERSION
assert "generated_at" in schema
assert "panels" in schema
assert "vehicle_settings" in schema
assert "capability_fields" in schema
def test_panels_are_list(self, schema):
assert isinstance(schema["panels"], list)
assert len(schema["panels"]) > 0
def test_all_panels_have_required_fields(self, schema):
for panel in schema["panels"]:
assert "id" in panel, f"Panel missing 'id': {panel}"
assert "label" in panel, f"Panel {panel.get('id')} missing 'label'"
assert "order" in panel, f"Panel {panel.get('id')} missing 'order'"
has_sections = "sections" in panel
has_items = "items" in panel
assert has_sections or has_items, \
f"Panel {panel['id']} must have 'sections' or 'items'"
if has_sections:
assert isinstance(panel["sections"], list)
for sec in panel["sections"]:
assert "id" in sec, f"Section in panel {panel['id']} missing 'id'"
assert "items" in sec, f"Section {panel['id']}.{sec.get('id')} missing 'items'"
assert isinstance(sec["items"], list)
if has_items:
assert isinstance(panel["items"], list)
def test_all_items_have_key_and_widget(self, schema):
for panel in schema["panels"]:
for item in _iter_panel_items(panel):
assert "key" in item, f"Item in panel {panel['id']} missing 'key'"
assert "widget" in item, f"Item {item.get('key')} missing 'widget'"
assert item["widget"] in VALID_WIDGET_TYPES, \
f"Item {item['key']} has invalid widget type: {item['widget']}"
def test_sub_panel_items_have_key_and_widget(self, schema):
for panel in schema["panels"]:
for sp in _iter_all_sub_panels(panel):
assert "id" in sp
assert "items" in sp
for item in sp["items"]:
assert "key" in item
assert "widget" in item
assert item["widget"] in VALID_WIDGET_TYPES
def test_vehicle_settings_structure(self, schema):
vs = schema["vehicle_settings"]
assert isinstance(vs, dict)
for brand, data in vs.items():
assert isinstance(brand, str)
assert isinstance(data, dict), \
f"vehicle_settings[{brand}] must be a dict {{title, items, ...}}"
assert "items" in data, f"vehicle_settings[{brand}] missing 'items'"
assert isinstance(data["items"], list)
for item in data["items"]:
assert "key" in item, f"Vehicle item for {brand} missing 'key'"
assert "widget" in item, f"Vehicle item {item.get('key')} missing 'widget'"
def test_no_duplicate_keys_across_panels(self, schema):
"""Param keys should appear in at most one panel."""
seen: dict[str, str] = {} # key -> panel_id
for panel in schema["panels"]:
for item in _iter_panel_items(panel):
key = item["key"]
if key in seen:
pytest.fail(f"Key '{key}' appears in both panel '{seen[key]}' and '{panel['id']}'")
seen[key] = panel["id"]
for sub in item.get("sub_items", []):
sub_key = sub["key"]
if sub_key in seen:
pytest.fail(f"Sub-item key '{sub_key}' appears in both '{seen[sub_key]}' and '{panel['id']}'")
seen[sub_key] = panel["id"]
class TestSchemaCoverage:
def test_all_schema_keys_exist_in_params(self, schema, all_param_keys):
"""Schema keys must exist in Params().all_keys()."""
schema_keys = collect_all_keys(schema)
missing = schema_keys - all_param_keys
assert not missing, f"Schema references keys not in Params: {missing}"
def test_all_capability_fields_are_declared(self, schema):
"""Capability fields used in rules must be declared."""
declared = set(schema["capability_fields"])
referenced = collect_capability_refs(schema)
undeclared = referenced - declared
assert not undeclared, f"Rules reference undeclared capability fields: {undeclared}"
def test_capability_fields_match_constant(self, schema):
"""Schema capability_fields must match CAPABILITY_FIELDS constant."""
assert set(schema["capability_fields"]) == set(CAPABILITY_FIELDS)
class TestRuleWellFormedness:
def _validate_rule(self, rule: dict, context: str = ""):
"""Recursively validate a single rule dict."""
assert "type" in rule, f"Rule missing 'type' in {context}"
rtype = rule["type"]
assert rtype in VALID_RULE_TYPES, f"Invalid rule type '{rtype}' in {context}"
if rtype == "capability":
assert "field" in rule, f"Capability rule missing 'field' in {context}"
assert "equals" in rule, f"Capability rule missing 'equals' in {context}"
elif rtype == "param":
assert "key" in rule, f"Param rule missing 'key' in {context}"
assert "equals" in rule, f"Param rule missing 'equals' in {context}"
elif rtype == "param_compare":
assert "key" in rule, f"Param compare rule missing 'key' in {context}"
assert "op" in rule, f"Param compare rule missing 'op' in {context}"
assert rule["op"] in VALID_COMPARE_OPS, f"Invalid op '{rule['op']}' in {context}"
assert "value" in rule, f"Param compare rule missing 'value' in {context}"
elif rtype == "not":
assert "condition" in rule, f"Not rule missing 'condition' in {context}"
self._validate_rule(rule["condition"], context=f"{context} > not")
elif rtype in ("any", "all"):
assert "conditions" in rule, f"{rtype} rule missing 'conditions' in {context}"
assert isinstance(rule["conditions"], list)
for c in rule["conditions"]:
self._validate_rule(c, context=f"{context} > {rtype}")
def _validate_items(self, items: list[dict], context: str):
for item in items:
key = item.get("key", "unknown")
for rules_field in ("visibility", "enablement"):
rules = item.get(rules_field)
if rules:
assert isinstance(rules, list), f"{key}.{rules_field} must be a list"
for rule in rules:
self._validate_rule(rule, context=f"{context}.{key}.{rules_field}")
for sub in item.get("sub_items", []):
self._validate_items([sub], context=f"{context}.{key}")
def _validate_section_rules(self, section: dict, context: str):
for rules_field in ("visibility", "enablement"):
rules = section.get(rules_field) or []
for rule in rules:
self._validate_rule(rule, context=f"{context}.{rules_field}")
def test_all_panel_rules_well_formed(self, schema):
for panel in schema["panels"]:
self._validate_items(list(_iter_panel_items(panel)), context=f"panel:{panel['id']}")
for sp in _iter_all_sub_panels(panel):
self._validate_items(sp["items"], context=f"subpanel:{sp['id']}")
for section in panel.get("sections", []):
self._validate_section_rules(section, context=f"section:{panel['id']}.{section['id']}")
def test_all_vehicle_rules_well_formed(self, schema):
for brand, data in schema["vehicle_settings"].items():
self._validate_items(_brand_items(data), context=f"vehicle:{brand}")
def test_no_self_referencing_visibility(self, schema):
"""An item's visibility/enablement rules should not depend on its own key."""
def _check_self_ref(item: dict, rules_field: str):
key = item.get("key")
for rule in item.get(rules_field, []):
if rule.get("type") == "param" and rule.get("key") == key:
pytest.fail(f"Item {key} has self-referencing {rules_field} rule")
for panel in schema["panels"]:
for item in _iter_panel_items(panel):
_check_self_ref(item, "visibility")
_check_self_ref(item, "enablement")
for brand_data in schema.get("vehicle_settings", {}).values():
for item in _brand_items(brand_data):
_check_self_ref(item, "visibility")
_check_self_ref(item, "enablement")
class TestKnownPanels:
def test_expected_panels_exist(self, schema):
panel_ids = {p["id"] for p in schema["panels"]}
expected = {"steering", "cruise", "display", "visuals", "device", "software", "developer"}
assert expected.issubset(panel_ids), f"Missing panels: {expected - panel_ids}"
def test_mads_sub_panel_exists(self, schema):
steering = next(p for p in schema["panels"] if p["id"] == "steering")
sub_ids = {sp["id"] for sp in _iter_all_sub_panels(steering)}
assert "mads_settings" in sub_ids
def test_mutual_exclusion_torque_nnlc(self, schema):
"""EnforceTorqueControl and NNLC must reference each other in enablement."""
torque = nnlc = None
for panel in schema["panels"]:
for item in _iter_panel_items(panel):
if item["key"] == "EnforceTorqueControl":
torque = item
elif item["key"] == "NeuralNetworkLateralControl":
nnlc = item
assert torque is not None, "EnforceTorqueControl item missing"
assert nnlc is not None, "NeuralNetworkLateralControl item missing"
torque_enable_keys = {r.get("key") for r in torque.get("enablement", []) if r.get("type") == "param"}
assert "NeuralNetworkLateralControl" in torque_enable_keys
nnlc_enable_keys = {r.get("key") for r in nnlc.get("enablement", []) if r.get("type") == "param"}
assert "EnforceTorqueControl" in nnlc_enable_keys
class TestKnownVehicleSettings:
def test_hyundai_has_longitudinal_tuning(self, schema):
keys = {i["key"] for i in _brand_items(schema["vehicle_settings"].get("hyundai"))}
assert "HyundaiLongitudinalTuning" in keys
def test_toyota_has_enforce_stock_and_stop_go(self, schema):
keys = {i["key"] for i in _brand_items(schema["vehicle_settings"].get("toyota"))}
assert "ToyotaEnforceStockLongitudinal" in keys
assert "ToyotaStopAndGoHack" in keys
def test_tesla_has_coop_steering(self, schema):
keys = {i["key"] for i in _brand_items(schema["vehicle_settings"].get("tesla"))}
assert "TeslaCoopSteering" in keys
def test_subaru_has_stop_and_go(self, schema):
keys = {i["key"] for i in _brand_items(schema["vehicle_settings"].get("subaru"))}
assert "SubaruStopAndGo" in keys
assert "SubaruStopAndGoManualParkingBrake" in keys
class TestItemCompleteness:
def _collect_all_items(self, schema):
"""Collect all items and sub_items from panels and vehicle_settings."""
items = []
for panel in schema["panels"]:
for item in _iter_panel_items(panel):
items.append(item)
for sub in item.get("sub_items", []):
items.append(sub)
for brand_data in schema.get("vehicle_settings", {}).values():
for item in _brand_items(brand_data):
items.append(item)
for sub in item.get("sub_items", []):
items.append(sub)
return items
def test_all_items_have_titles(self, schema):
"""All items must have titles."""
missing = [i["key"] for i in self._collect_all_items(schema) if "title" not in i]
if len(missing) > MAX_ALLOWED_MISSING_TITLES:
pytest.fail(f"Items without titles ({len(missing)}): {missing[:10]}")
def test_no_default_titles(self, schema):
"""Item titles must differ from keys."""
defaults = [i["key"] for i in self._collect_all_items(schema) if i.get("title") == i["key"]]
assert not defaults, f"Items with default titles (title == key): {defaults}"
def test_options_structure(self, schema):
"""Options must be a list of {value, label} dicts."""
for item in self._collect_all_items(schema):
opts = item.get("options")
if opts is None:
continue
assert isinstance(opts, list), f"{item['key']}: options must be a list"
for opt in opts:
assert isinstance(opt, dict), f"{item['key']}: each option must be a dict"
assert "value" in opt, f"{item['key']}: option missing 'value': {opt}"
assert "label" in opt, f"{item['key']}: option missing 'label': {opt}"
def test_numeric_constraints(self, schema):
"""If any of min/max/step is present, all three must be, and min < max."""
for item in self._collect_all_items(schema):
has_min = "min" in item
has_max = "max" in item
has_step = "step" in item
if has_min or has_max or has_step:
assert has_min and has_max and has_step, \
f"{item['key']}: must have all of min/max/step or none"
assert item["min"] < item["max"], \
f"{item['key']}: min ({item['min']}) must be < max ({item['max']})"
def test_known_param_has_options(self, schema):
"""LongitudinalPersonality should have 3 options."""
cruise = next(p for p in schema["panels"] if p["id"] == "cruise")
lp = next((i for i in _iter_panel_items(cruise) if i["key"] == "LongitudinalPersonality"), None)
assert lp is not None
assert "options" in lp
assert len(lp["options"]) == 3
+211
View File
@@ -0,0 +1,211 @@
#!/usr/bin/env python3
"""
Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors.
This file is part of sunnypilot and is licensed under the MIT License.
See the LICENSE.md file in the root directory for more details.
Scans all per-page YAML files in settings_ui_src/pages/ and replaces inlined
rule blocks that exactly match a macro definition in _macros.yaml with $ref
references.
Match policy:
- Whole-list match (exact): replace the entire list with [{$ref}].
- Single-rule match: any individual rule whose canonical form equals macro[0]
(when macro is exactly one rule) is replaced with {$ref}.
Re-run is idempotent (already-substituted $refs are skipped).
Usage:
python apply_macros.py [--src DIR] [--dry-run]
"""
from __future__ import annotations
import argparse
import json
import os
import sys
import yaml
DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DEFAULT_SRC = os.path.join(DIR, "settings_ui_src")
class _BlockDumper(yaml.SafeDumper):
pass
def _represent_dict(dumper, data):
return dumper.represent_mapping("tag:yaml.org,2002:map", data.items(), flow_style=False)
def _represent_list(dumper, data):
flow = all(not isinstance(x, (dict, list)) for x in data) and len(data) <= 8
return dumper.represent_sequence("tag:yaml.org,2002:seq", data, flow_style=flow)
_BlockDumper.add_representer(dict, _represent_dict)
_BlockDumper.add_representer(list, _represent_list)
def _dump_yaml(data) -> str:
return yaml.dump(data, Dumper=_BlockDumper, sort_keys=False, allow_unicode=True, width=120)
def _canon(node) -> str:
return json.dumps(node, sort_keys=True, separators=(",", ":"))
def _is_ref(node) -> bool:
return isinstance(node, dict) and len(node) == 1 and "$ref" in node
def _make_ref(name: str) -> dict:
return {"$ref": f"#/macros/{name}"}
def _substitute_rules(rules: list, whole_list: dict, single_rule: dict) -> list:
if not isinstance(rules, list) or not rules:
return rules
full_canon = _canon(rules)
if full_canon in whole_list:
return [_make_ref(whole_list[full_canon])]
out = []
for r in rules:
if _is_ref(r):
out.append(r)
continue
rc = _canon(r)
if rc in single_rule:
out.append(_make_ref(single_rule[rc]))
else:
out.append(r)
return out
def _walk_item(item: dict, whole_list: dict, single_rule: dict) -> bool:
changed = False
for ctx in ("visibility", "enablement"):
if ctx in item:
new = _substitute_rules(item[ctx], whole_list, single_rule)
if new != item[ctx]:
item[ctx] = new
changed = True
if "options" in item:
for opt in item["options"]:
if not isinstance(opt, dict):
continue
for ctx in ("visibility", "enablement"):
if ctx in opt:
new = _substitute_rules(opt[ctx], whole_list, single_rule)
if new != opt[ctx]:
opt[ctx] = new
changed = True
if "sub_items" in item:
for sub in item["sub_items"]:
if _walk_item(sub, whole_list, single_rule):
changed = True
return changed
def _walk_page(page: dict, whole_list: dict, single_rule: dict) -> bool:
changed = False
for sec in page.get("sections", []) or []:
for ctx in ("visibility", "enablement"):
if ctx in sec:
new = _substitute_rules(sec[ctx], whole_list, single_rule)
if new != sec[ctx]:
sec[ctx] = new
changed = True
for it in sec.get("items", []) or []:
if _walk_item(it, whole_list, single_rule):
changed = True
for sp in sec.get("sub_panels", []) or []:
for it in sp.get("items", []) or []:
if _walk_item(it, whole_list, single_rule):
changed = True
for it in page.get("items", []) or []:
if _walk_item(it, whole_list, single_rule):
changed = True
for sp in page.get("sub_panels", []) or []:
for it in sp.get("items", []) or []:
if _walk_item(it, whole_list, single_rule):
changed = True
return changed
def _build_macro_indices(macros: dict) -> tuple[dict, dict]:
whole_list = {}
single_rule = {}
for name, body in macros.items():
if isinstance(body, list):
whole_list[_canon(body)] = name
if len(body) == 1 and isinstance(body[0], dict):
single_rule[_canon(body[0])] = name
elif isinstance(body, dict):
single_rule[_canon(body)] = name
return whole_list, single_rule
def _read_yaml_with_header(path: str) -> tuple[list[str], dict]:
with open(path) as f:
text = f.read()
header_lines = []
for line in text.splitlines(keepends=True):
if line.startswith("#"):
header_lines.append(line)
elif line.strip() == "":
header_lines.append(line)
else:
break
doc = yaml.safe_load(text) or {}
return header_lines, doc
def _write_yaml_with_header(path: str, header: list[str], doc: dict) -> None:
with open(path, "w") as f:
if header:
# Keep at most one trailing blank line in header
while len(header) > 1 and header[-1].strip() == "" and header[-2].strip() == "":
header.pop()
for line in header:
f.write(line)
f.write(_dump_yaml(doc))
def apply(src_dir: str, dry_run: bool) -> int:
with open(os.path.join(src_dir, "_macros.yaml")) as f:
macros_doc = yaml.safe_load(f) or {}
macros = (macros_doc.get("macros") or {}) if isinstance(macros_doc, dict) else {}
whole_list, single_rule = _build_macro_indices(macros)
changed_files = 0
pages_dir = os.path.join(src_dir, "pages")
if os.path.isdir(pages_dir):
for fn in sorted(os.listdir(pages_dir)):
if not fn.endswith((".yaml", ".yml")) or fn.startswith("_"):
continue
path = os.path.join(pages_dir, fn)
header, doc = _read_yaml_with_header(path)
if _walk_page(doc, whole_list, single_rule):
changed_files += 1
if not dry_run:
_write_yaml_with_header(path, header, doc)
else:
print(f"would-rewrite: {path}")
print(f"{'Would rewrite' if dry_run else 'Rewrote'} {changed_files} files")
return 0
def _main() -> int:
parser = argparse.ArgumentParser(description="Substitute inlined rule blocks with $ref macros across pages/.")
parser.add_argument("--src", default=DEFAULT_SRC)
parser.add_argument("--dry-run", action="store_true")
args = parser.parse_args()
return apply(args.src, args.dry_run)
if __name__ == "__main__":
sys.exit(_main())
+300
View File
@@ -0,0 +1,300 @@
#!/usr/bin/env python3
"""
Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors.
This file is part of sunnypilot and is licensed under the MIT License.
See the LICENSE.md file in the root directory for more details.
Reads settings_ui_src/ (the dev-friendly authoring tree) and emits the
canonical settings_ui.json that the device generator + frontend consume.
Source layout:
_macros.yaml # named rule fragments
pages/<page_id>.yaml # one file per panel/page
pages/vehicle.yaml # special: emits vehicle_settings
Each page.yaml contains the full panel: metadata + sections + items + sub_panels
inline. Sub-panels are nested inside the section they belong to. Items appear
in the order written in the file.
Macro references use JSON-Schema-style $ref pointers:
enablement:
- {$ref: "#/macros/offroad"}
- {$ref: "#/macros/mads_full_platforms"}
Macros may reference other macros (max depth 3). Cycles raise an error.
Usage:
python compile_settings_ui.py [--src DIR] [--out PATH] [--check]
"""
from __future__ import annotations
import argparse
import copy
import json
import os
import sys
import yaml
DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DEFAULT_SRC = os.path.join(DIR, "settings_ui_src")
DEFAULT_OUT = os.path.join(DIR, "settings_ui.json")
SCHEMA_VERSION = "1.0"
MAX_MACRO_DEPTH = 3
class CompileError(Exception):
pass
def _load_yaml(path: str):
with open(path) as f:
return yaml.safe_load(f) or {}
def _is_ref(node) -> bool:
return isinstance(node, dict) and len(node) == 1 and "$ref" in node
def _ref_name(node: dict) -> str:
ref = node["$ref"]
if not isinstance(ref, str) or not ref.startswith("#/macros/"):
raise CompileError(f"unsupported $ref: {ref!r} (must start with '#/macros/')")
return ref[len("#/macros/"):]
def _resolve_refs(node, macros: dict, visiting: tuple[str, ...] = ()):
"""Resolve $ref nodes against macros. Recursive; depth-limited; cycle-safe.
- $ref in list-context: macro's list spliced into parent list.
- $ref in scalar-context (object value): macro's value substitutes.
- Non-list macro values may not be referenced from list contexts.
"""
if _is_ref(node):
name = _ref_name(node)
if name in visiting:
raise CompileError(f"$ref cycle: {' -> '.join(visiting + (name,))}")
if len(visiting) >= MAX_MACRO_DEPTH:
raise CompileError(f"$ref nesting exceeds depth {MAX_MACRO_DEPTH}: {' -> '.join(visiting + (name,))}")
if name not in macros:
raise CompileError(f"unknown macro: {name}")
return _resolve_refs(copy.deepcopy(macros[name]), macros, visiting + (name,))
if isinstance(node, dict):
return {k: _resolve_refs(v, macros, visiting) for k, v in node.items()}
if isinstance(node, list):
out = []
for item in node:
if _is_ref(item):
resolved = _resolve_refs(item, macros, visiting)
if not isinstance(resolved, list):
raise CompileError(
f"macro '{_ref_name(item)}' must resolve to a list when used in a list context"
)
out.extend(resolved)
else:
out.append(_resolve_refs(item, macros, visiting))
return out
return node
# Output JSON key order. Mirrors the conventions in the original hand-written
# settings_ui.json so structural diffs after extraction are minimal.
_ITEM_KEY_ORDER = [
"key",
"widget",
"needs_onroad_cycle",
"requires_attestation",
"blocked",
"title",
"description",
"details",
"title_param_suffix",
"min",
"max",
"step",
"unit",
"options",
"visibility",
"enablement",
"sub_items",
]
def _canon_item(item: dict, macros: dict) -> dict:
resolved = dict(item)
for ctx in ("visibility", "enablement"):
if ctx in resolved:
resolved[ctx] = _resolve_refs(resolved[ctx], macros)
if "options" in resolved:
new_opts = []
for opt in resolved["options"]:
if isinstance(opt, dict):
opt = dict(opt)
for ctx in ("visibility", "enablement"):
if ctx in opt:
opt[ctx] = _resolve_refs(opt[ctx], macros)
new_opts.append(opt)
resolved["options"] = new_opts
if "sub_items" in resolved:
resolved["sub_items"] = [_canon_item(s, macros) for s in resolved["sub_items"]]
out: dict = {}
for k in _ITEM_KEY_ORDER:
if k in resolved:
out[k] = resolved[k]
for k, v in resolved.items():
if k not in out:
out[k] = v
return out
def _canon_section(section: dict, macros: dict) -> dict:
out: dict = {"id": section["id"], "title": section["title"]}
if "description" in section:
out["description"] = section["description"]
for k in ("visibility", "enablement"):
if k in section:
out[k] = _resolve_refs(section[k], macros)
if "attestation_required" in section:
out["attestation_required"] = section["attestation_required"]
out["items"] = [_canon_item(i, macros) for i in section.get("items", [])]
if "sub_panels" in section and section["sub_panels"]:
out["sub_panels"] = [_canon_sub_panel(sp, macros) for sp in section["sub_panels"]]
for k, v in section.items():
if k not in out and k != "order":
out[k] = v
return out
def _canon_sub_panel(sp: dict, macros: dict) -> dict:
out: dict = {"id": sp["id"], "label": sp["label"], "trigger_key": sp["trigger_key"]}
if "trigger_condition" in sp:
out["trigger_condition"] = _resolve_refs(sp["trigger_condition"], macros)
out["items"] = [_canon_item(i, macros) for i in sp.get("items", [])]
for k, v in sp.items():
if k not in out:
out[k] = v
return out
def _canon_panel(page: dict, macros: dict) -> dict:
out: dict = {
"id": page["id"],
"label": page["label"],
"icon": page["icon"],
"order": page["order"],
}
if "remote_configurable" in page:
out["remote_configurable"] = page["remote_configurable"]
if "description" in page:
out["description"] = page["description"]
if "sections" in page and page["sections"]:
out["sections"] = [_canon_section(s, macros) for s in page["sections"]]
if "items" in page and page["items"]:
out["items"] = [_canon_item(i, macros) for i in page["items"]]
if "sub_panels" in page and page["sub_panels"]:
out["sub_panels"] = [_canon_sub_panel(sp, macros) for sp in page["sub_panels"]]
return out
def _canon_vehicle(page: dict, macros: dict) -> dict:
"""Convert page-shape vehicle.yaml to wire-format vehicle_settings dict."""
out: dict = {}
for sec in page.get("sections", []):
brand = sec["id"]
brand_out: dict = {"title": sec.get("title", "")}
if "description" in sec:
brand_out["description"] = sec["description"]
brand_out["items"] = [_canon_item(i, macros) for i in sec.get("items", [])]
out[brand] = brand_out
return out
def _load_pages(src: str) -> list[dict]:
pages_dir = os.path.join(src, "pages")
if not os.path.isdir(pages_dir):
return []
pages = []
for fn in sorted(os.listdir(pages_dir)):
if not fn.endswith((".yaml", ".yml")):
continue
if fn.startswith("_"):
continue
path = os.path.join(pages_dir, fn)
page = _load_yaml(path)
if not isinstance(page, dict):
raise CompileError(f"{path}: page YAML must be an object")
if "id" not in page:
raise CompileError(f"{path}: page missing 'id'")
page["__source"] = path
pages.append(page)
return pages
def compile_schema(src: str) -> dict:
macros_doc = _load_yaml(os.path.join(src, "_macros.yaml"))
macros = (macros_doc.get("macros") or {}) if isinstance(macros_doc, dict) else {}
pages = _load_pages(src)
panels_out = []
vehicle_out: dict = {}
# Order panels by `order` field (falling back to file position).
panel_pages = [p for p in pages if p.get("kind") != "vehicle"]
panel_pages.sort(key=lambda p: (p.get("order", 999), p["id"]))
for page in panel_pages:
panels_out.append(_canon_panel(page, macros))
for page in pages:
if page.get("kind") == "vehicle":
vehicle_out = _canon_vehicle(page, macros)
return {
"$schema": "./settings_ui.schema.json",
"schema_version": SCHEMA_VERSION,
"panels": panels_out,
"vehicle_settings": vehicle_out,
}
def _main() -> int:
parser = argparse.ArgumentParser(description="Compile settings_ui_src/ -> settings_ui.json")
parser.add_argument("--src", default=DEFAULT_SRC)
parser.add_argument("--out", default=DEFAULT_OUT)
parser.add_argument("--check", action="store_true",
help="Compile and diff against existing settings_ui.json; exit non-zero on diff.")
args = parser.parse_args()
schema = compile_schema(args.src)
rendered = json.dumps(schema, indent=2) + "\n"
if args.check:
if not os.path.exists(args.out):
print(f"--check: {args.out} does not exist", file=sys.stderr)
return 1
with open(args.out) as f:
current = f.read()
if current.strip() == rendered.strip():
print(f"--check: {args.out} matches compiled output")
return 0
print(f"--check: {args.out} differs from compiled output", file=sys.stderr)
cur_obj = json.loads(current)
if cur_obj == schema:
print("(structurally equal; only formatting differs)", file=sys.stderr)
return 1
with open(args.out, "w") as f:
f.write(rendered)
print(f"Wrote {args.out}")
return 0
if __name__ == "__main__":
sys.exit(_main())

Some files were not shown because too many files have changed in this diff Show More