Compare commits

...

288 Commits

Author SHA1 Message Date
DevTekVE 5d754169a6 Updating ESCC guide to use relay box 2024-07-29 12:31:45 +02:00
DevTekVE 0bbe217642 images didn't push 2024-03-21 19:13:03 +01:00
DevTekVE a36dc616ac Very very very first iteration, with very first ever made board 2024-03-21 19:11:31 +01:00
Jason Wen 5b5938dc3a Update CHANGELOGS.md 2024-03-07 15:51:43 -05:00
mike8643 c39c54a0d8 otisserv: set_destination and locations endpoints for non-prime users (#243)
ios shortcut support
2024-03-07 13:57:41 -05:00
Jason Wen 71ac15bf4e Update README.md 2024-02-28 12:41:10 -05:00
Jason Wen 8750b25a0f Bump to 0.9.7.0 2024-02-28 11:34:29 -05:00
Jason Wen 5d6f22d062 Sync: commaai/openpilot:master into sunnypilot/sunnypilot:master (#293) 2024-02-27 21:10:58 -05:00
Jason Wen 4397a687bc Bump submodules 2024-02-27 21:09:47 -05:00
Jason Wen 4d8c13ba42 Merge branch 'upstream/openpilot/master' into sync-20240224
# Conflicts:
#	cereal
#	common/params.cc
#	selfdrive/car/chrysler/interface.py
2024-02-27 21:01:40 -05:00
Jason Wen cdd93855f2 Update CHANGELOGS.md 2024-02-27 10:30:59 -05:00
Jason Wen 4124c4593f Merge remote-tracking branch 'commaai/openpilot/master' into sync-20240224
# Conflicts:
#	cereal
#	opendbc
#	panda
2024-02-26 16:39:04 -05:00
Jason Wen 9aca2536aa Merge branch 'upstream/openpilot/master' into sync-20240224
# Conflicts:
#	selfdrive/car/subaru/values.py
2024-02-24 20:46:45 -05:00
Jason Wen 0b0ddd8d9e Update CHANGELOGS.md 2024-02-24 20:41:38 -05:00
Jason Wen 73ff33005d Merge branch 'upstream/openpilot/master' into sync-20240224
# Conflicts:
#	panda
#	selfdrive/car/subaru/values.py
2024-02-24 09:51:14 -05:00
Jason Wen b049836943 Update CHANGELOGS.md 2024-02-24 09:48:18 -05:00
Jason Wen b8773a10d4 Sync: commaai/openpilot:master into sunnypilot/sunnypilot:master (#290) 2024-02-24 09:21:16 -05:00
Jason Wen 8945fffab0 Merge branch 'upstream/openpilot/master' into sync-20240220
# Conflicts:
#	cereal
#	common/version.h
#	selfdrive/controls/controlsd.py
#	selfdrive/thermald/power_monitoring.py
2024-02-24 09:14:42 -05:00
Jason Wen bbbca41296 Merge branch 'upstream/openpilot/master' into sync-20240220
# Conflicts:
#	cereal
#	opendbc
#	panda
#	selfdrive/car/honda/carstate.py
2024-02-20 11:05:51 -05:00
Jason Wen 4ab41dd619 Update CHANGELOGS.md 2024-02-20 11:02:03 -05:00
Jason Wen 5e5b67a33f README: New Discord URL (#286) 2024-02-17 21:18:05 -05:00
Jason Wen 89c8382417 Sync: commaai/openpilot:master into sunnypilot/sunnypilot:master (#283) 2024-02-16 08:41:32 -05:00
Jason Wen 658f0f6249 bump submodules 2024-02-16 08:40:54 -05:00
Jason Wen fd11bc1d7d Merge branch 'upstream/openpilot/master' into sync-20240216
# Conflicts:
#	cereal
#	opendbc
#	panda
#	selfdrive/car/hyundai/interface.py
#	selfdrive/controls/controlsd.py
#	selfdrive/monitoring/dmonitoringd.py
2024-02-16 08:27:39 -05:00
Jason Wen fa9a11c4d6 Sync: commaai/openpilot:master into sunnypilot/sunnypilot:master (#277) 2024-02-08 11:55:30 -05:00
Jason Wen 35a47f6bf3 bump submodules 2024-02-08 11:53:44 -05:00
Jason Wen b657f0f01e bump cereal 2024-02-08 10:56:36 -05:00
Jason Wen daae551ea8 Merge remote-tracking branch 'commaai/openpilot/master' into sync-20240201 2024-02-05 11:41:19 -05:00
Jason Wen 66df10faaf MSPA: Lat plan deprecation prerequisites (#276)
* MSPA: Lat plan deprecation prerequisites

* bump cereal
2024-02-02 01:14:13 -05:00
Jason Wen dd49490dae mapd: Remove more legacy implementation (#275)
* mapd: Remove more legacy implementation

* bump cereal
2024-02-02 00:08:53 -05:00
Jason Wen fbabd5700f MSPA: lateralPlanSP legacy support (#274)
* MSPA: `lateralPlanSP` legacy support

* bump cereal
2024-02-01 23:02:03 -05:00
Jason Wen 8f0b4c49cc gpxd: Remove support (#273) 2024-02-01 21:03:17 -05:00
Jason Wen 72dba20a60 Enhanced Speed Control: Remove legacy implementation (#271)
Remove outdated Enhanced Speed Control
2024-02-01 20:59:27 -05:00
Jason Wen c09b651bd7 Update CARS.md 2023-12-26 12:14:34 -05:00
Jason Wen ce4235f8ec Update CHANGELOGS.md 2023-12-24 13:29:37 -05:00
Jason Wen a6cf11ef39 lower to 0.9.5.3 2023-12-24 13:16:35 -05:00
Jason Wen d92246638a bump to 0.9.6.1 2023-12-07 16:22:30 -05:00
Jason Wen 20e6c58611 Update CHANGELOGS.md 2023-12-06 23:23:08 -05:00
Jason Wen 3ad2b60eb8 Update CHANGELOGS.md 2023-12-05 00:18:42 -05:00
Jason Wen e93e51d000 Update HOW-TOS.md 2023-11-26 18:01:55 -05:00
Jason Wen 758f58c5e9 bump to 0.9.5.2 2023-11-18 08:54:19 -05:00
Jason Wen 55979b27a0 Update CHANGELOGS.md 2023-11-17 22:47:43 -05:00
Jason Wen b157b4d1b0 Update CHANGELOGS.md 2023-11-17 22:43:10 -05:00
Jason Wen a534e974e6 Update CHANGELOGS.md 2023-11-14 01:54:32 -05:00
Jason Wen 602bd1090f FCR: sync with upstream supported car platforms 2023-11-12 17:02:08 -05:00
Jason Wen cb28eb44f0 bump cereal 2023-11-12 15:14:59 -05:00
Jason Wen 4a9bd576e5 Sync: commaai/openpilot:master into sunnyhaibin/sunnypilot:master 2023-11-12 00:56:10 -05:00
Jason Wen 9d47fa2fb3 bump panda 2023-11-12 00:55:47 -05:00
Jason Wen 09a4536b8a Merge branch 'upstream/openpilot/master' into sync-20231112
# Conflicts:
#	panda
#	selfdrive/car/subaru/interface.py
2023-11-12 00:49:42 -05:00
Jason Wen 24aa478376 Sync: commaai/openpilot:master into sunnyhaibin/sunnypilot:master 2023-11-08 16:30:11 -05:00
Jason Wen 1a87a204d3 bump submodules 2023-11-08 16:19:11 -05:00
Jason Wen a667364b59 Merge remote-tracking branch 'commaai/openpilot/master' into sync-20231108
# Conflicts:
#	cereal
#	panda
2023-11-08 15:58:35 -05:00
Jason Wen 4cfdd2b119 Hyundai: Car Port for Kona 2019 Non-SCC (#234)
* Hyundai: Car Port for Kona Non-SCC 2019

* add car name
2023-10-25 22:10:11 -04:00
Jason Wen 3ea399f9a6 FCR: sync with upstream supported car platforms 2023-10-25 15:28:04 -04:00
Jason Wen b0dd2a3ddb Sync: commaai/openpilot:master into sunnyhaibin/sunnypilot:master 2023-10-25 15:21:44 -04:00
Jason Wen 08a271b678 Merge remote-tracking branch 'commaai/openpilot/master' into sync-20231025
# Conflicts:
#	README.md
#	selfdrive/car/hyundai/interface.py
2023-10-25 15:18:53 -04:00
Jason Wen 57e135cdf9 Fix upstream conflicts (#232) 2023-10-24 00:22:58 -04:00
Jason Wen 8b01831aa8 FCR: sync with upstream supported car platforms 2023-10-23 11:14:54 -04:00
Jason Wen 512f8b053f Sync: commaai/openpilot:master into sunnyhaibin/sunnypilot:master 2023-10-20 16:56:59 -04:00
Jason Wen 1ee8df2d28 Merge remote-tracking branch 'commaai/openpilot/master' into sync-20231020
# Conflicts:
#	selfdrive/car/chrysler/interface.py
2023-10-20 16:53:09 -04:00
Jason Wen 396fab62a8 Sync: commaai/openpilot:master into sunnyhaibin/sunnypilot:master 2023-10-18 01:20:41 -04:00
Jason Wen 4de4821dfc bump panda 2023-10-18 01:18:44 -04:00
Jason Wen 04e21399f1 Merge remote-tracking branch 'commaai/openpilot/master' into sync-20231018
# Conflicts:
#	panda
2023-10-18 01:08:29 -04:00
Jason Wen fafdf82409 Subaru: Fix brake light signal for Pre-Global platforms (#225) 2023-10-16 11:44:37 -04:00
Jason Wen 0cafd36f15 Sync: commaai/openpilot:master into sunnyhaibin/sunnypilot:master 2023-10-16 11:37:26 -04:00
Jason Wen adc9b2f3bb bump submodules 2023-10-16 11:32:08 -04:00
Jason Wen 0e8a762fdd brakeLights -> brakeLightsDEPRECATED 2023-10-16 11:18:24 -04:00
Jason Wen cfeba34d5d Merge branch 'upstream/openpilot/master-20231016-sync' into master-20231016
# Conflicts:
#	cereal
#	panda
#	selfdrive/car/hyundai/interface.py
#	selfdrive/car/hyundai/values.py
#	selfdrive/car/subaru/values.py
#	selfdrive/controls/controlsd.py
#	selfdrive/controls/plannerd.py
#	selfdrive/monitoring/dmonitoringd.py
2023-10-16 11:03:27 -04:00
Jason Wen 925bc21912 Update CHANGELOGS.md 2023-10-01 11:32:22 -04:00
Jason Wen 61d39a5558 MSPA: Unused service (#218) 2023-10-01 02:10:49 -04:00
Jason Wen c8debe77db MSPA (#217)
* Cereal: Use custom reserved structs

* fix dmonitoring

* sync with upstream

* bump cereal

* bump cereal

* fix

* bump cereal

* fix

* unused

* check sm valid
2023-10-01 02:05:05 -04:00
Jason Wen 44b0b11ff1 HKG: add Kia Seltos 2023-24 Non-SCC platform (#215)
* HKG: add Kia Seltos 2024 Non-SCC platform

* 2023 MY also works

* Update CHANGELOGS.md

* add fw

* fix

* fix list
2023-09-29 08:56:50 -04:00
Jason Wen fb9a990184 FCR: sync with upstream supported car platforms 2023-09-24 00:09:50 -04:00
Jason Wen da58d5114b Fleet Manager: paths cleanup (#216) 2023-09-23 10:33:33 -04:00
Jason Wen 3b776937fa Sync params 2023-09-23 01:31:57 -04:00
Jason Wen eb2a58185d Merge branch 'upstream/openpilot/master'
# Conflicts:
#	.pre-commit-config.yaml
#	README.md
#	cereal
#	opendbc
#	panda
#	selfdrive/car/torque_data/override.yaml
2023-09-22 23:49:13 -04:00
DevTekVE 32e514f421 mapd: Bump scipy to 1.11.1 (#209)
Update scipy version in custom_dep.py

This commit updates the version of scipy in custom_dep.py from 1.7.1 to 1.11.1. This change is done to allow installing from non prebilt branches as the former scipy requested is incompatible with python 3.11.

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2023-09-19 17:06:51 -04:00
Jason Wen 1f1d09d91b FCR: sync with upstream supported car platforms 2023-09-18 16:13:58 -04:00
Jason Wen 29f32bc331 Fix upstream conflicts 2023-09-10 22:05:10 -04:00
Jason Wen ebfe40b76a Merge remote-tracking branch 'commaai/openpilot/master'
# Conflicts:
#	.github/workflows/selfdrive_tests.yaml
#	.pre-commit-config.yaml
#	cereal
#	opendbc
#	panda
2023-09-06 23:58:35 -04:00
Jason Wen e0cc25c3e2 Migrate otisserv to pub (#205)
Migrate otisserv to pub
2023-09-06 01:06:02 -04:00
Jason Wen 7dbbc001eb Upstream merge fixes 2023-09-06 01:05:01 -04:00
Jason Wen 27c485c621 bump to 0.9.5.1 2023-09-05 12:18:24 -04:00
Jason Wen 94e34f2539 bump panda 2023-09-05 12:17:10 -04:00
Jason Wen 7f8f9e2613 sunnypilot: fix duplicate ordinal 2023-09-05 11:55:45 -04:00
Jason Wen 9bc73b85ff Merge remote-tracking branch 'commaai/openpilot/master'
# Conflicts:
#	.github/workflows/selfdrive_tests.yaml
#	.pre-commit-config.yaml
#	README.md
#	cereal
#	common/version.h
#	opendbc
#	panda
#	selfdrive/car/chrysler/carcontroller.py
#	selfdrive/car/chrysler/carstate.py
#	selfdrive/car/chrysler/interface.py
#	selfdrive/car/gm/carstate.py
#	selfdrive/car/honda/carstate.py
#	selfdrive/car/hyundai/carcontroller.py
#	selfdrive/car/hyundai/carstate.py
#	selfdrive/car/hyundai/hyundaican.py
#	selfdrive/car/hyundai/interface.py
#	selfdrive/car/hyundai/radar_interface.py
#	selfdrive/car/hyundai/values.py
#	selfdrive/car/interfaces.py
#	selfdrive/car/subaru/carcontroller.py
#	selfdrive/car/subaru/carstate.py
#	selfdrive/car/subaru/interface.py
#	selfdrive/car/subaru/subarucan.py
#	selfdrive/car/torque_data/override.yaml
#	selfdrive/car/toyota/carcontroller.py
#	selfdrive/car/toyota/carstate.py
#	selfdrive/car/toyota/interface.py
#	selfdrive/car/toyota/toyotacan.py
#	selfdrive/car/volkswagen/carstate.py
#	selfdrive/controls/lib/desire_helper.py
#	selfdrive/controls/lib/longitudinal_planner.py
#	selfdrive/monitoring/dmonitoringd.py
#	selfdrive/thermald/power_monitoring.py
#	system/loggerd/uploader.py
2023-09-05 11:50:47 -04:00
Jason Wen 57136b3e1a Toyota longitudinal: new TSS2 tuning (#200) 2023-08-16 21:57:31 -04:00
Jason Wen 583bf38e6a bump to 0.9.4.2 2023-08-11 17:51:36 -04:00
Jason Wen 3449d301ae Update CHANGELOGS.md 2023-08-11 09:49:38 -04:00
Jason Wen e57d077fd3 Update CHANGELOGS.md 2023-08-10 22:45:00 -04:00
Jacob Pfeifer fbd4771469 mapd: utilize advisory speed limit in curves (#142)
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2023-08-10 22:43:39 -04:00
Jason Wen fc59ed06f2 ui: remove Speed Limit Style 2023-08-10 16:07:13 -04:00
Jason Wen 07a81c16bb Update CHANGELOGS.md 2023-08-10 00:20:27 -04:00
Jason Wen aa043a3073 bump cereal 2023-08-07 00:41:07 -04:00
Jason Wen 259203e8b2 Update CHANGELOGS.md 2023-08-04 17:45:56 -04:00
Jason Wen 6a93469290 bump to 0.9.4.1 2023-08-04 17:41:01 -04:00
Jason Wen 1c7e799cc8 bump to 0.9.4.1 2023-08-02 16:38:33 -04:00
Jason Wen 58e106c0d5 sunnypilot: fix upstream conflicts 2023-08-02 15:03:05 -04:00
Jason Wen 35e8d675bc bump submodules 2023-08-01 23:04:11 -04:00
Jason Wen 8498b1a1c3 Merge branch 'upstream/openpilot/master' 2023-08-01 23:03:54 -04:00
Mathew Locoteta ac9315f6a7 Honda: Car Port for Accord 4-Cylinder 9th Generation (#124)
* Add 2016/2017 Accord 2.4L (Serial Steering V3)

* No longer used

* bump opendbc

* bump opendbc

* bump opendbc

* IDE

* unused

* small cleanup

* platform rename

* some more

* add to docs

* shorter name

* add to FCR

* update footnote

* Update CARS.md

* Update CARS.md

* bump opendbc

* Update footnote

* Update CARS.md

* Update CHANGELOGS.md

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2023-07-12 01:16:26 -04:00
Jason Wen 1dfa7c0039 Update CHANGELOGS.md 2023-07-11 09:29:32 -04:00
Jason Wen 06b1a862d9 bump to 0.9.3.2 2023-07-11 09:10:53 -04:00
Jason Wen 0621af480e car docs: add additional supported cars in sunnypilot (#192)
* car docs: add additional supported cars in sunnypilot

* Update non-SCC models

* Update non-SCC required parts

* sync
2023-07-09 23:51:08 -04:00
Jason Wen 2658378ebe HKG: disable experimental longitudinal for non-SCC platforms (#195)
* HKG: disable experimental longitudinal for non-SCC platforms

* CAN-FD also
2023-07-09 23:47:42 -04:00
Jason Wen 140d5272c8 HKG: specify required parts with no SCC models (#194) 2023-07-09 23:42:14 -04:00
Jason Wen 06960c04fe HKG: specify supported trims with no SCC (#193) 2023-07-09 23:35:16 -04:00
Jason Wen 7ec767f53f Update CHANGELOGS.md 2023-07-09 01:38:20 -04:00
Jason Wen 122efe3a89 Use spFlags for sunnypilot specific features (pub) (#189)
* Use spFlags for sunnypilot specific features (pub)

* add remaining
2023-07-01 05:49:16 -04:00
Jason Wen 32dd76bcb7 ui: Screen Recorder toggle display default on 2023-06-30 15:48:31 -04:00
Jason Wen 133fdcb43a ui: Screen Recorder toggle display prerequisites 2023-06-30 15:38:40 -04:00
Jason Wen c0df986710 Update CHANGELOGS.md 2023-06-30 15:37:40 -04:00
Jason Wen d79689b967 Update CHANGELOGS.md 2023-06-29 17:25:56 -04:00
Jason Wen 39e0a32bcb Update CHANGELOGS.md 2023-06-29 11:55:58 -04:00
Jason Wen 31a7b305ee Update CHANGELOGS.md 2023-06-26 12:09:53 -04:00
Jason Wen 2b506e49f0 Toyota longitudinal: TSS2 custom tuning behind toggle (#186)
* Toyota longitudinal: TSS2 custom tuning behind toggle

* cleanup

* add param

* Update CHANGELOGS.md

* Update CHANGELOGS.md
2023-06-26 12:28:20 -04:00
Jason Wen f7f90fd847 ui: Sidebar Temperature selector prerequisites 2023-06-25 06:30:22 -04:00
Jason Wen 8f192cb975 Update CHANGELOGS.md 2023-06-25 00:29:52 -04:00
Jason Wen 813d591204 Update CHANGELOGS.md 2023-06-22 21:11:46 -04:00
Jason Wen 54c4dbd49b Merge branch 'upstream/openpilot/master'
# Conflicts:
#	cereal
#	common/version.h
#	opendbc
#	panda
#	selfdrive/car/honda/carstate.py
#	selfdrive/car/honda/interface.py
#	selfdrive/car/hyundai/values.py
#	selfdrive/car/subaru/carcontroller.py
#	selfdrive/car/subaru/subarucan.py
#	selfdrive/controls/lib/longitudinal_planner.py
#	selfdrive/manager/manager.py
2023-06-22 14:52:51 -04:00
Jason Wen ac75b20104 Rename DevUIInfo 2023-06-22 11:54:19 -04:00
Jason Wen 6e781d3801 Update CHANGELOGS.md 2023-06-18 22:36:14 -04:00
Jason Wen 97a61463b2 HKG CAN: Smoother Stopping Performance prerequisites 2023-06-18 22:09:17 -04:00
Jason Wen 733cf3c521 Add SP flags 2023-06-18 20:49:05 -04:00
Jason Wen 30e455e367 bump to 0.9.3.1 2023-06-18 20:33:30 -04:00
Jason Wen d4fa3ad160 Update CHANGELOGS.md 2023-06-18 10:03:05 -04:00
Jason Wen 848718e0c1 Update CHANGELOGS.md 2023-06-18 07:14:01 -04:00
Jason Wen e2f7da5cc9 Update CHANGELOGS.md 2023-06-17 12:37:51 -04:00
Jason Wen bac7873513 Update CHANGELOGS.md 2023-06-15 19:37:23 -04:00
Jason Wen d9b652af7c Update CHANGELOGS.md 2023-06-15 18:41:46 -04:00
Jason Wen 7e3f6add58 Update CHANGELOGS.md 2023-06-15 07:09:38 -04:00
Jason Wen 8dbfd8180e Update param 2023-06-15 07:02:53 -04:00
Jason Wen 7e86bdc371 Fleet Manager: toggle PIN requirement prerequisites 2023-06-15 07:02:27 -04:00
Jason Wen 97dce4ab17 Update CHANGELOGS.md 2023-06-15 04:11:59 -04:00
Jason Wen 20d5802010 Update CHANGELOGS.md 2023-06-14 23:51:49 -04:00
Jason Wen 1fbaab0b34 Auto Lane Change: Delay execution with BSM detection prerequisites 2023-06-14 07:28:45 -04:00
Jason Wen d5a7644209 Update CHANGELOGS.md 2023-06-14 07:27:22 -04:00
Jason Wen 728c65a14a Update CHANGELOGS.md 2023-06-13 13:45:25 -04:00
Jason Wen d576dfdf2d Update CHANGELOGS.md 2023-06-13 12:24:23 -04:00
Jason Wen 132762fd17 Update CHANGELOGS.md 2023-06-13 11:06:13 -04:00
Jason Wen e092e7ed19 Driving Screen Off: param updates 2023-06-13 11:05:58 -04:00
Jason Wen d66c7f18c8 bump to 0.9.2.3 2023-06-13 05:07:39 -04:00
Jason Wen 676fdd31c8 Update CHANGELOGS.md 2023-06-13 04:55:01 -04:00
Jason Wen 76896a910f Update CHANGELOGS.md 2023-06-13 00:26:28 -04:00
Jason Wen af6b2979d0 MADS: Toyota: gate LKAS button behind toggle default off 2023-06-12 23:22:44 -04:00
Jason Wen 5cf13b0a72 MADS: Toyota: gate LKAS button behind toggle prerequisites 2023-06-12 22:45:44 -04:00
Jason Wen bd1c833920 Docs: Don't be a ghost @FrogAi 2023-06-12 21:28:13 -04:00
Jason Wen 3aa5a23118 bump to 0.9.2.2 2023-06-11 20:08:00 -04:00
Jason Wen 19e2cf185b bump to 0.9.2.2 2023-06-11 18:44:56 -04:00
Jason Wen d78bdaafec Docs: update comma three branches (#183) 2023-06-11 08:58:06 -04:00
Jason Wen e57cdfe5fe Docs: update Installation section (#182)
* Start the cleanup

* add

* update some urls

* add version

* revert c2 instructions

* revert c2 instructions

* c3 only
2023-06-11 08:50:50 -04:00
Jason Wen 5ec32dcbe2 Updater: persistent superseded branch alert 2023-06-11 08:13:18 -04:00
Jason Wen cd1077e93e Updater: superseded branch alert prerequisites 2023-06-11 08:10:32 -04:00
John P 1a7c469a13 Update README.md | Update Recommended Link (#168)
Update README.md | Update Link

The [1] marker mentions an old link to an old branch, so I fixed that.
2023-06-11 00:45:10 -04:00
Jason Wen 9f60ec8871 Update CHANGELOGS.md 2023-06-10 22:32:16 -04:00
Jason Wen 6cfa7445ac Update CHANGELOGS.md 2023-06-10 22:06:08 -04:00
Jason Wen 27f1df1a9b sunnypilot: bump version to 0.9.2.1 2023-06-10 06:36:19 -04:00
Jason Wen 7d2eaa7d74 Fleet Manager: update instruction screenshot (#181) 2023-06-10 01:48:35 -04:00
Jason Wen a421b78972 Update CHANGELOGS.md 2023-06-09 18:08:52 -04:00
Jason Wen 88821fb8d8 ui: display CPU temperature on sidebar prerequisites 2023-06-09 18:02:53 -04:00
Jason Wen ceb2a6a721 Update CHANGELOGS.md 2023-06-09 09:20:26 -04:00
Jason Wen 73b2e4bb2a Update CHANGELOGS.md 2023-06-08 23:15:34 -04:00
Jason Wen 6d9eeced08 Custom Stock Longitudinal Control: temporary disable for HKG CAN-FD 2023-06-08 22:54:42 -04:00
Jason Wen cdb4bd0a4c FCR: Autogenerate HKG Non-SCC platforms (#180) 2023-06-08 22:37:48 -04:00
Jason Wen a937e82015 FCR: sync with upstream supported car platforms 2023-06-08 22:34:14 -04:00
Jason Wen 1dd4eb6fe0 Fleet Manager: rename process 2023-06-08 20:30:28 -04:00
Jason Wen fd07250d2a Update CHANGELOGS.md 2023-06-08 11:43:50 -04:00
Jason Wen 8949ad0b8f Ram DT: handle lower speed alert (#179) 2023-06-08 10:32:08 -04:00
AlexandreSato 6fd591e4b5 Fleet Manager: Error log access support (#169)
* Update README.md

* add error troubleshooting and delScreenRecords btn

* Revert "Update README.md"

This reverts commit 5d22fe815f.

* complete coment at paths

* add button to delete screen record

* remove button to delete screen record

* index cleanup

* rename

* simpler

* same module

* no need auth on home

* ide

* name

* smaller text

* spacing

* Update README.md

* Update CHANGELOGS.md

* '\n on changelogs.md

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2023-06-08 10:19:24 -04:00
Jason Wen 0065709a25 Fleet Manager: redirect cleanup (#178) 2023-06-08 09:17:10 -04:00
Jason Wen 3790c6c756 Fleet Manager: One-Time Password cleanup (#177)
* init

* keep previous page from session
2023-06-08 08:48:37 -04:00
Jason Wen d9c348fb48 Ram DT: check EPS firmware explicitly to set minEnableSpeed to 0 (#173) 2023-06-08 06:42:20 -04:00
Jason Wen 462b20ac12 Dashcam Viewer ▶️ Fleet Manager (#174)
* Dashcam Viewer ▶️ Fleet Manager

* missed

* process
2023-06-07 13:56:36 -04:00
Jason Wen a34c596b76 Docs: add Patreon and GitHub Sponsor links 2023-06-07 12:41:23 -04:00
Jason Wen b30b1222d9 Add sunnypilot Patreon 2023-06-07 03:09:06 -04:00
Jason Wen e4aa1dee05 Dashcam Viewer: One-Time Password support (#171)
* skeleton

* Print PIN under Device menu

* wrap in decorator

* login page reformat

* simplify

* cleanup

* add instruction

* formatting
2023-06-07 02:10:43 -04:00
Jason Wen 604761f6a4 Dashcam Viewer: small style change (#172) 2023-06-07 02:08:58 -04:00
Jason Wen bf0411be00 Enhanced Speed Control: accelerator press state handling (#170)
Enhanced Speed Control: accelerator press state handling
2023-06-06 21:00:21 -04:00
Jason Wen 8eafdd7058 Update CHANGELOGS.md 2023-06-06 01:13:05 -04:00
Jason Wen a1b6cb1077 Update CHANGELOGS.md 2023-06-06 01:12:08 -04:00
Jason Wen 9aed6070a9 GAC: init at 3 2023-06-05 22:54:04 -04:00
Jason Wen cb8ba14c53 bump opendbc 2023-06-05 22:31:29 -04:00
Jason Wen 7ff8e02ed5 bump cereal 2023-06-05 12:43:12 -04:00
Jason Wen 2f77c0d9ee Docs: sunnypilot README and relevant docs (#167)
* Docs: sunnypilot README and relevant docs

* Update QR dir

* Add icon

* Add back later

* Dividers
2023-06-03 20:57:51 -04:00
Jason Wen b6cb343a4a Update CHANGELOGS.md 2023-06-03 01:59:47 -04:00
Jason Wen b2fd4ec25a HKG: support steer to 0 with smartMDPS on certain models (#166)
HKG: support steer to 0 with a smartMDPS on certain models
2023-06-03 01:52:44 -04:00
Jason Wen 92281d2bf3 Controls: Custom Stock Longitudinal Control prerequisites (#165) 2023-06-03 01:18:47 -04:00
Jason Wen f03492e2cf Retain hotspot/tethering state across reboots prerequisites 2023-06-03 00:04:08 -04:00
Jason Wen 8ba9748ad9 Parse and display sunnypilot changelogs 2023-06-02 18:20:43 -04:00
AlexandreSato 1846814ac5 Dashcam Viewer: Screen Recordings support and interface refresh (#160)
* init bootstrap 5.3

* bootstrap done

* watch screen records

* formatting

* syntax

* import

* specific path

* pathing

* text

* not needed

* sunnypilot home

* better name

* Revert "syntax"

This reverts commit 45c54a54ef.

* path

* fix miss "/" at end of path and show current screenrecord video

* Created the About page

* Display errors in a more communicative way

* enable <br> at error messages

* display title on top of the page

* link to download screenrecord

* Update README.md

* Update styles

* Navbar on top, don't block content

* Don't center and format

* Update CHANGELOGS.md

* Update About page

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2023-06-02 18:16:02 -04:00
Vincent Wright a004024ef4 Ram HD: remove from dashcam (#164)
* Added support for Ram steer to 0/7

* Made the suggested changes

Also added in additional FW to support the other trucks.

* Spacing

* Spacing

* Match stock

* Match stock

* Reverted FW changes

* Put back the max steer

* Bring back comment

* Unused

* Remove DashCamOnly for HD

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2023-06-01 14:20:12 -04:00
Jason Wen c1c4a241e0 MADS toggle with Cruise Main on by default 2023-05-31 13:23:58 -04:00
Jason Wen 2e07780eae RoadEdge param 2023-05-31 13:22:53 -04:00
Jason Wen d0be8af88d No disengage lateral on brake by default 2023-05-30 22:39:53 -04:00
Jason Wen 22b310c556 MADS: add toggle for Cruise Main button engage - prerequisites 2023-05-30 22:38:49 -04:00
Vincent Wright 9cb81a8dac Ram: Steer to 0/7 MPH support (#157)
* Added support for Ram steer to 0/7

* Made the suggested changes

Also added in additional FW to support the other trucks.

* Spacing

* Spacing

* Match stock

* Match stock

* Reverted FW changes

* Put back the max steer

* Bring back comment

* Unused

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2023-05-30 22:03:18 -04:00
Jason Wen 2673fbecd0 Subaru: add FW for 2019 Impreza with increased torque (#163) 2023-05-30 21:26:30 -04:00
Miles Calloway 1067a18445 Honda: Car Port for Clarity 2018-22 (#154)
* Fork

* Revert "Fork"

This reverts commit a10cb9677b.

* I think this is it, to be tested.

* Correct panda

* update panda

* Revert "update panda"

This reverts commit 09d7cc9330.

* Revert "Correct panda"

This reverts commit aa052a52e7.

* Update sunnypilot_carname.json

* bump panda

* sort

* formatting

* could break OP long cars

* simpler

* separate

* missed

* format

* cleaner

* bump panda

* Clarity is not in HONDA_BOSCH_RADARLESS

* match

* update MY in docs

* format

* format

* Update CHANGELOGS.md

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2023-05-29 23:57:19 -04:00
Jason Wen 5351d6fe5b Bring back CHANGELOGS.md (#161) 2023-05-29 23:49:22 -04:00
Jason Wen 6e7c2c54c4 FCR: sync with upstream supported car platforms & add Ford support 2023-05-29 22:07:29 -04:00
Curtis Jenkins 13616ab771 Dashcam Viewer support (#155)
* add webserver + dashcam reviewer

* add offroad flag to webserver process

* fix process and rename tag in webpage

* add read me

* formatting & shadow names

* small cleanup

* +

* Force offroad only

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* Update function name

change from "hello_world" to "index"

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* Change webserver process name

now dashcam_viewer

* change process name to dashcam(_)viewer

* sort

* Update README.md

* Credit

* fix

* shadow

* name

* name

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2023-05-29 19:32:12 -04:00
Jason Wen 4fc2e41c47 Subaru legacy: flip driver torque (#158)
* Subaru legacy: flip driver torque

* bump panda
2023-05-29 10:49:22 -04:00
Jason Wen 4796f674da Higher torque limit (3071) for 2018 Crosstrek / 2017 Impreza @ClockeNessMnstr (#146)
* Higher torque limit (3071) for 2018 Crosstrek / 2017 Impreza @ClockeNessMnstr

* bump panda

* set with int flag

* bump panda

* flag

* sync tune

* bump panda

* fix

* fix

* oops

* update FW

* List comprehension

* bump panda
2023-05-28 19:51:22 -04:00
Jason Wen 3894a930b3 bump cereal 2023-05-28 01:38:33 -04:00
Jason Wen a7a3190f6d bump cereal 2023-05-28 00:50:18 -04:00
Jason Wen cb33af841c bump cereal 2023-05-28 00:25:55 -04:00
Jason Wen f965ebee27 Remove unused params 2023-05-27 12:26:25 -04:00
Jason Wen 1aeff99740 E2E Long State: update params (#156)
update params
2023-05-27 12:03:58 -04:00
Jason Wen a0dc58fc5d bump cereal 2023-05-25 12:45:59 -04:00
Jason Wen 6c2a58f2e9 Merge branch 'upstream/openpilot/master'
# Conflicts:
#	cereal
#	common/params.cc
#	panda
#	selfdrive/car/subaru/subarucan.py
#	selfdrive/controls/lib/lateral_planner.py
#	selfdrive/controls/lib/longitudinal_planner.py
2023-05-25 12:17:54 -04:00
Jason Wen 862ad7a438 FCR: sync with upstream supported car platforms 2023-04-25 02:20:49 -04:00
Jason Wen 2654fe9696 fix merge conflicts 2023-04-25 01:45:01 -04:00
Jason Wen 46c80749be cereal: fix duplicate ordinals 2023-04-25 01:20:00 -04:00
Jason Wen 8a61496937 Merge remote-tracking branch 'upstream/commaai/openpilot/master'
# Conflicts:
#	.pre-commit-config.yaml
#	cereal
#	opendbc
#	panda
#	selfdrive/car/hyundai/carstate.py
#	selfdrive/car/hyundai/interface.py
#	selfdrive/car/toyota/interface.py
2023-04-25 01:10:56 -04:00
Jason Wen b84972c6d9 DLP: default to off and laneless 2023-04-25 01:02:21 -04:00
Jason Wen a8a853514f ui: show driver monitoring camera while onroad prerequisites 2023-04-01 12:50:58 -04:00
Jason Wen 89e2a6ea9b Merge remote-tracking branch 'upstream/commaai/openpilot/master'
# Conflicts:
#	cereal
#	panda
2023-03-30 23:07:29 -04:00
Jason Wen cb865a7b18 ui: button auto-hide prerequisites 2023-03-29 23:28:11 -04:00
Jacob Pfeifer 26097e778e mapd: consistency adjustments (#117)
mapd consistency adjustments:

* Project gps location onto map route line for determining distance to
  next node.
* Increase distance for determining if we have left a route. Helpful for
  when osm route line is not perfectly centered on road.
* Match max lateral accel against vision turn speed controller max
  lateral accel.
2023-03-29 23:07:16 -04:00
Jason Wen 75fd9b1b22 Long planner: fix upstream merge conflicts (#145)
Fix upstream merge conflicts
2023-03-29 17:53:58 -04:00
Jason Wen eb2f13d6d6 Merge remote-tracking branch 'upstream/commaai/openpilot/master'
# Conflicts:
#	cereal
#	panda
2023-03-28 17:16:08 -04:00
Jason Wen 8208cf9a5a pre-commit: skip all checks for now 2023-03-28 17:16:01 -04:00
Jason Wen 0bf00410d4 Hyundai: gate speed limit parsing availability (#144) 2023-03-27 22:05:35 -04:00
Jason Wen 03f8b45a1e gpxd: remove secret (#135)
* gpxd: remove secret

* make it stick

* enforce dongle ID check

* redirect

* static

* small cleanup
2023-03-26 12:01:31 -04:00
Jason Wen 5ae00ea1fc sunnypilot: update brand 2023-03-26 09:20:57 -04:00
Jason Wen d4a039823b HKG: add FW versions for Kia Forte Non-SCC 2019 (#141) 2023-03-25 22:41:51 -04:00
Jason Wen bb76d4f9e9 Block Enhanced Speed Control events on unsupported platforms (#140) 2023-03-25 10:07:52 -04:00
Jason Wen 38068dc916 sunnypilot: HKG: non-SCC platform support prerequisites (#139) 2023-03-25 00:05:03 -04:00
Jason Wen 5243da9487 FCR: sync with upstream supported car platforms 2023-03-24 17:34:28 -04:00
Jason Wen 18a5cf0277 Merge remote-tracking branch 'upstream/commaai/openpilot/master'
# Conflicts:
#	cereal
#	opendbc
#	panda
#	selfdrive/ui/ui.cc
2023-03-24 15:05:42 -04:00
Jason Wen b73078dc43 mapd: bring back README (#136) 2023-03-24 13:57:54 -04:00
Jason Wen 9f2a0080c0 gpxd: fix upstream conflict 2023-03-12 17:11:02 -04:00
Jason Wen b475e28087 Merge remote-tracking branch 'upstream/commaai/openpilot/master'
# Conflicts:
#	cereal
#	panda
#	selfdrive/car/hyundai/interface.py
#	selfdrive/car/toyota/carcontroller.py
2023-03-12 14:52:12 -04:00
Jason Wen 1635a176b7 Subaru: brake light signal fix 2023-02-27 13:57:07 -05:00
Jason Wen d1f7bb6bb5 Pre-Global Subaru: counter fix and disable dashcamOnly (#119)
Pre-Global Subaru: counter fix and remove dashcam only

* Revert legacy es_lkas counter autogeneration
2023-02-21 23:48:09 -05:00
Jason Wen 038afae028 mapd: use correct path 2023-02-21 22:53:13 -05:00
Jason Wen 6b5ef45bdf mapd: cache downloaded dependencies 2023-02-21 17:30:43 -05:00
Jason Wen f7b0250652 GAC: params init 2023-02-21 01:22:45 -05:00
Jason Wen 0ce258612b move-fast: v-tsc fix 2023-02-20 22:48:51 -05:00
Jason Wen 643fe3b7fa HKG: parse speed limit (#118)
HKG: parse speed limits
2023-02-20 02:58:57 -05:00
Jason Wen f3a44c1e3a HKG: add more int flags 2023-02-20 02:51:46 -05:00
Jason Wen c1c03ff4c3 cereal: fix duplicate ordinals 2023-02-19 00:14:25 -05:00
Jason Wen 4b2ce89412 Merge remote-tracking branch 'upstream/commaai/openpilot/master'
# Conflicts:
#	cereal
#	selfdrive/ui/ui.cc
2023-02-18 23:52:21 -05:00
Jason Wen c9d784a0b9 ui: speedometer customization more init 2023-02-18 19:35:54 -05:00
Jason Wen 9881d1a6e4 ui: speedometer customization params init 2023-02-18 19:10:23 -05:00
Jason Wen 7fea5dc842 bump panda 2023-02-17 20:06:31 -05:00
Jason Wen 2830c020f6 Hyundai: Enhanced SCC (ESCC) Radar Interceptor support (#114)
* escc: wip

* finish up

* use new intflag

* bump panda
2023-02-17 18:33:14 -05:00
Jason Wen 32d50a6504 bump panda 2023-02-17 18:31:10 -05:00
Jason Wen be037b31be bump panda 2023-02-17 15:07:17 -05:00
Jason Wen b2465c3494 Merge remote-tracking branch 'upstream/commaai/openpilot/master' 2023-02-17 01:26:38 -05:00
Jason Wen 7934454088 Longitudinal: parse physical distance button (#113)
* Longitudinal: parse distance button from steering wheel

* missing gm signal
2023-02-16 20:57:07 -05:00
Jason Wen 0fd1cfbe56 mapd: Remove preloaded dependencies (#112) 2023-02-15 00:33:06 -05:00
Jason Wen 75a00af955 Merge remote-tracking branch 'upstream/commaai/openpilot/master'
# Conflicts:
#	cereal
#	opendbc
#	panda
2023-02-14 20:42:02 -05:00
Jason Wen 2d070dbdb7 mapd: add path 2023-02-13 19:58:53 -05:00
Jason Wen b7a3855ede SLC: adjustable speed limit offset - init 2023-02-13 19:55:00 -05:00
Jason Wen bf659453aa move-fast: mapd, Speed Limit Control, Vision & Map Turn Speed Control (#111)
* move-fast: Hands on wheel monitoring: Implementation according to r079r4e regulation

* move-fast: VisionTurnController Implementation & UI prerequisites

* move-fast: LiveMapData: Implementation & UI prerequisites

* add dependencies

* move-fast: SpeedLimitControl: Implementation & UI prerequisites

* move-fast: TurnSpeedController: Implementation & UI prerequisites

* move-fast: Debug: Tap on Ui to capture snapshot of debug data & UI prerequisites

* Debug UI: Toggle to display debug UI elements & UI prerequisites
2023-02-13 11:38:11 -05:00
Jason Wen 755b5746fb FCR: generate all sunnypilot supported car platforms 2023-02-11 02:34:35 -05:00
Jason Wen 6ad79d3e81 Longitudinal: Reverse ACC Change (#110) 2023-02-11 02:26:50 -05:00
Jason Wen eb591e3015 Merge remote-tracking branch 'upstream/commaai/openpilot/master'
# Conflicts:
#	opendbc
2023-02-11 01:23:43 -05:00
Jason Wen d201a4b08c Merge remote-tracking branch 'upstream/commaai/openpilot/master'
# Conflicts:
#	cereal
#	opendbc
#	panda
2023-02-09 02:07:22 -05:00
Jason Wen a0c9b12341 bump cereal 2023-02-08 20:13:28 -05:00
Jason Wen 25efc5316a bump cereal 2023-02-08 14:23:45 -05:00
Jason Wen 8102fc8572 Merge remote-tracking branch 'upstream/commaai/openpilot/master' 2023-02-06 00:29:11 -05:00
Jason Wen 60c02cf87b Toyota TSS2 longitudinal improvements (#108)
* Toyota TSS2 longitudinal improvements

* IDE doesn't like it
2023-02-05 21:58:19 -05:00
Jason Wen 3188d11efd Braking status prerequisites (#107)
* Braking status prerequisites

* No need for this
2023-02-05 20:54:59 -05:00
Jason Wen 0790e4d9f7 gpxd (#106) 2023-02-05 19:58:26 -05:00
Jason Wen d4f1b12070 Disable Onroad Uploads (#105) 2023-02-05 19:53:21 -05:00
Jason Wen 2a841a7757 Lane Change Timer (#104) 2023-02-05 14:31:09 -05:00
Jason Wen 5e1d9da867 Max Time Offroad 2023-02-05 14:17:32 -05:00
Jason Wen 0208188975 Merge remote-tracking branch 'upstream/commaai/openpilot/master' 2023-02-05 02:21:51 -05:00
Jason Wen 931718e937 bump cereal 2023-02-04 19:47:55 -05:00
Jason Wen 300c33583a bump cereal 2023-02-04 14:28:45 -05:00
Jason Wen 4e03bd488d bump cereal 2023-02-04 12:10:57 -05:00
Jason Wen 054562fc77 import param init 2023-02-04 04:19:39 -05:00
Jason Wen 3f431e4c6d Merge remote-tracking branch 'upstream/commaai/openpilot/master' into dev-pub/master
# Conflicts:
#	cereal
#	opendbc
2023-02-04 00:39:30 -05:00
Jason Wen 215b03118e bump cereal 2023-02-03 23:49:00 -05:00
Jason Wen 428dbb52e2 fix duplicate ordinal 2023-01-31 18:09:43 -05:00
Jason Wen 4d0fb94161 import all params 2023-01-31 01:04:32 -05:00
Jason Wen 93a4090476 MADS: add more event 2023-01-31 00:40:47 -05:00
Jason Wen eb7b3f5489 fix merge conflicts 2023-01-28 21:04:51 -05:00
Jason Wen 4f60a73471 Merge remote-tracking branch 'upstream/commaai/openpilot/master' into dev-pub/master
# Conflicts:
#	cereal
#	panda
2023-01-28 20:46:44 -05:00
Jason Wen da778f69b3 bump cereal 2023-01-18 22:35:39 -05:00
Jason Wen 9168bae8da bump panda 2023-01-15 04:10:46 -05:00
Jason Wen 50f3dfe37a Merge remote-tracking branch 'upstream/commaai/openpilot/master' into dev-pub/master 2023-01-15 04:10:28 -05:00
Jason Wen eb3eb92d5e bump submodules 2023-01-12 19:35:07 -05:00
Jason Wen df79142199 Merge remote-tracking branch 'upstream/commaai/openpilot/master' 2023-01-12 19:32:25 -05:00
Jason Wen fe6bf5e293 Merge remote-tracking branch 'upstream/commaai/openpilot/master' into master-public 2023-01-02 20:05:54 -05:00
Jason Wen 6ad18dae26 update refs 2022-12-20 01:14:23 -05:00
116 changed files with 12045 additions and 162 deletions
+12
View File
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [sunnyhaibin] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: sunnyhaibin # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['https://paypal.me/sunnyhaibin0850'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
+3 -3
View File
@@ -1,12 +1,12 @@
[submodule "panda"]
path = panda
url = ../../commaai/panda.git
url = ../../sunnyhaibin/panda.git
[submodule "opendbc"]
path = opendbc
url = ../../commaai/opendbc.git
url = ../../sunnyhaibin/opendbc.git
[submodule "cereal"]
path = cereal
url = ../../commaai/cereal.git
url = ../../sunnyhaibin/cereal.git
[submodule "rednose_repo"]
path = rednose_repo
url = ../../commaai/rednose.git
+855
View File
@@ -0,0 +1,855 @@
sunnypilot - 0.9.7.0 (2024-xx-xx)
========================
* New driving model
* Support for many hybrid Ford models
************************
* UPDATED: Synced with commaai's openpilot
* master commit 56e343b (February 27, 2024)
* NEW❗: iOS Siri Shortcuts Navigation support thanks to twilsonco and mike86437!
* iOS and macOS Shortcuts to quickly set navigation destinations from your iOS device
* comma Prime support
* Personal Mapbox/Amap/Google Maps token support
* Instructions on how to set up your iOS Siri Shortcuts: https://routinehub.co/shortcut/17677/
sunnypilot - 0.9.6.1 (2024-02-27)
========================
* New driving model
* Vision model trained on more data
* Improved driving performance
* Directly outputs curvature for lateral control
* New driver monitoring model
* Trained on larger dataset
* AGNOS 9
* comma body streaming and controls over WebRTC
* Improved fuzzy fingerprinting for many makes and models
* Alpha longitudinal support for new Toyota models
* Chevrolet Equinox 2019-22 support thanks to JasonJShuler and nworb-cire!
* Dodge Durango 2020-21 support
* Hyundai Staria 2023 support thanks to sunnyhaibin!
* Kia Niro Plug-in Hybrid 2022 support thanks to sunnyhaibin!
* Lexus LC 2024 support thanks to nelsonjchen!
* Toyota RAV4 2023-24 support
* Toyota RAV4 Hybrid 2023-24 support
************************
* UPDATED: Synced with commaai's openpilot
* master commit db57a21 (February 22, 2024)
* v0.9.6 release (February 27, 2024)
* UPDATED: Dynamic Experimental Control (DEC)
* Synced with dragonpilot-community/dragonpilot:beta3 commit f4ee52f
* NEW❗: Default Driving Model: Certified Herbalist v2 (February 13, 2024)
* UPDATED: Driving Model Selector v3
* NEW❗: Driving Model additions
* Certified Herbalist v2 (February 13, 2024) - CHv2
* Certified Herbalist (February 5, 2024) - CH
* Los Angeles v2 (January 24, 2024) - LAv2
* Los Angeles (January 22, 2024) - LAv1
* NEW❗: Model Caching thanks to DevTekVE!
* Model caching allows the selection of previously downloaded Driving Model
* Users can now access cached versions of selected models, eliminating redundant downloads for previously fetched models
* Legacy Driving Models support
* New Delhi (December 21, 2023) - ND
* Blue Diamond v2 (December 11, 2023) - BDv2
* Blue Diamond (November 18, 2023) - BDv1
* Farmville (November 7, 2023) - FV
* Night Strike (October 3, 2023) - NS
* Certain features are deprecated with newer Driving Models
* Dynamic Lane Profile (DLP)
* Custom Offsets
* UPDATED: Dynamic Lane Profile (DLP)
* Continued support for Legacy Driving Models (e.g., ND, BDv2, BDv1, FV, NS)
* Deprecated support for newer Driving Models (e.g., CHv2, CH, LAv2, LAv1)
* UPDATED: Custom Offsets
* Continued support for Legacy Driving Models (e.g., ND, BDv2, BDv1, FV, NS)
* Deprecated support for newer Driving Models (e.g., CHv2, CH, LAv2, LAv1)
* UPDATED: Hyundai/Kia/Genesis - ESCC Radar Interceptor
* Message parsing improvements with the latest firmware update: https://github.com/sunnypilot/panda/tree/test-escc-smdps
* UI Updates
* NEW❗: Visuals: Display Feature Status toggle
* Display the statuses of certain features on the driving screen
* NEW❗: Visuals: Enable Onroad Settings toggle
* Display the Onroad Settings button on the driving screen to adjust feature options on the driving screen, without navigating into the settings menu
* REMOVED: "Device ambient" temperature option on the sidebar
* FIXED: New comma 3X support
* FIXED: New comma eSIM support
* Bug fixes and performance improvements
sunnypilot - 0.9.5.3 (2023-12-24)
========================
* UPDATED: Dynamic Experimental Control (DEC)
* Synced with dragonpilot-community/dragonpilot:lp-dp-beta2 commit 578d38b
* UPDATED: Driving Model Selector v2
* Driving models sort in descending order based on availability date
* Experimental/unmerged driving models are only available in "dev-c3" branch
* To select and use experimental driving models, navigate to "Software" panel, select the "dev-c3" branch, and check for update
* UPDATED: Vision-based Turn Speed Control (V-TSC) implementation
* Refactored implementation thanks to pfeiferj!
* More accurate and consistent velocity calculation to achieve smoother longitudinal control in curves
* NEW❗: Speed Limit Warning
* Display alert and/or chime to warn the driver when the cruising speed is faster than the speed limit plus the Warning Offset
* Customizable Warning Offset, independent of Speed Limit Control (SLC)'s Limit Offset
* UPDATED: Speed Limit Source Policy
* Selectable speed limit source for Speed Limit Control and Speed Limit Warning
* Applicable to: Speed Limit Control, Speed Limit Warning
* UPDATED: Speed Limit Control (SLC)
* Engage Mode: Removed "Warning Only" mode - this has been replaced by the new Speed Limit Warning sub-menu
* UPDATED: OpenStreetMap (OSM) implementation
* Refactored implementation thanks to pfeiferj!
* Less resource impact
* Significantly smaller sizes with databases
* All regions are available to download
* Weekly map updates thanks to pfeiferj!
* Increased the font size of the road name
* C3X-specific changes
* Altitude (ALT.) display on Developer UI
* Current street name on top of driving screen when "OSM Debug UI" is enabled
* UPDATED: Map-based Turn Speed Control (M-TSC) implementation
* Only available in "staging-c3" and "dev-c3" branches. If you are using "release-c3" branch, navigate to "Software" panel, select the desired target branch, and check for update
* Refactored implementation thanks to pfeiferj!
* Based on the new OpenStreetMap implementation
* Improved predicted curvature calculations from OpenStreetMap data
* UI updates
* RE-ENABLED: Navigation: Full screen support
* Display the map view in full screen
* To switch back to driving view, tap on the border edge
* Hyundai Bayon Non-SCC 2019 support thanks to polein78!
sunnypilot - 0.9.5.2 (2023-12-07)
========================
* NEW❗: MADS: Allow Navigate on openpilot in Chill Mode
* Allow navigation to feed map view into the driving model while using Chill Mode
* Support all platforms, including platforms that do not support openpilot longitudinal control & Experimental Mode
* NEW❗: Neural Network Lateral Controller
* Formerly known as "NNFF", this replaces the lateral "torque" controller with one using a neural network trained on each car's (actually, each separate EPS firmware) driving data for increased controls accuracy
* Contact @twilsonco in the sunnypilot Discord server with feedback, or to provide log data for your car if your car is currently unsupported
* NEW❗: Driving Model Selector
* Easily switch between driving models without reinstalling branches. Offering immediate access to the latest models upon release
* An internet connection is required for downloading models. Each model switch currently involves downloading the model again. Future updates may allow for offline switching
* Warning is displayed for metered connections to avoid unexpected data usage if on cellular data
* Change driving models via **Settings -> Software -> Current Driving Model**.
* NEW❗: Hyundai CAN longitudinal:
* NEW❗: Enable radar tracks for certain Santa Fe platforms
* Internal Combustion Engine (ICE) 2021-23
* Hybrid 2022-23
* Plug-in Hybrid 2022-23
* NEW❗: Lane Change: When manually braking with steering engaged, turning on the turn signal will default to Nudge mode
* Volkswagen MQB CC only platforms (radar or no radar) support thanks to jyoung8607!
sunnypilot - 0.9.5.1 (2023-11-17)
========================
* UPDATED: Synced with commaai's master commit e94c3c5
* NEW❗: Farmville driving model
* NEW❗: Onroad Settings Panel
* Onroad buttons (i.e., DLP, GAC) moved to its dedicated panel
* Driving Personality
* Dynamic Lane Profile (DLP)
* Dynamic Experimental Control (DEC)
* Speed Limit Control (SLC)
* NEW❗: Display main feature status on onroad view in real-time
* GAP - Driving Personality
* DLP - Dynamic Lane Profile
* DEC - Dynamic Experimental Control
* SLC - Speed Limit Control
* NEW❗: Dynamic Experimental Control (DEC) thanks to dragonpilot-community!
* Automatically determines and selects between openpilot ACC and openpilot End to End longitudinal based on conditions for a more natural drive
* Dynamic Experimental Control is only active while in Experimental Mode
* When Dynamic Experimental Control is ON, initially setting cruise speed will set to the vehicle's current speed
* NEW❗: Hyundai CAN longitudinal:
* NEW❗: Parse lead info for camera-based SCC platforms
* Improve lead tracking when using openpilot longitudinal
* NEW❗: Parse lead distance to display on car cluster
* Introduced better lead distance calculation to display on the car's cluster, replacing the binary "lead visible" indication on the SCC cluster
* Lead distance is now categorized into different ranges for more detailed and comprehensive information to the driver similar to how stock ACC does it
* NEW❗: Parse speed limit sign recognition from camera for certain supported platforms
* NEW❗: Subaru - Stop and Go auto-resume support thanks to martinl!
* Global (excluding Gen 2 and Hybrid) and Pre-Global support
* NEW❗: Toyota - Stop and Go hack
* Allow some Toyota/Lexus cars to auto resume during stop and go traffic
* Only applicable to certain models and model years
* NEW❗: Toyota: ZSS support thanks to dragonpilot-community and ErichMoraga!
* NEW❗: MSPA (Cereal structs refactor)
* Make sunnypilot Parsable Again - @sshane
* sunnypilot is now parsable with stock openpilot tools
* NEW❗: Display 3D buildings on map thanks to jakethesnake420!
* openpilot Longitudianl Control capable cars only
* UPDATED: Gap Adjust Cruise is now a part of Driving Personality
* [DISTANCE/FOLLOW DISTANCE/GAP DISTANCE] physical button on the steering wheel to select Driving Personality on by default
* Status now viewable in onroad view or Onroad Settings Panel
* REMOVED: Gap Adjust Cruise toggle
* UPDATED: Speed Limit Control (SLC)
* NEW❗: Speed Limit Engage Mode
* Select the desired mode to set the cruising speed to the speed limit
* Warning Only: Warn the driver when the vehicle is driven faster than the speed limit
* Auto: Automatic speed adjustment on motorways based on speed limit data
* User Confirm: Inform the driver to change set speed of Adaptive Cruise Control to help the driver stay within the speed limit
* Supported platforms
* openpilot Longitudinal Control available cars (Excluding certain Toyota/Lexus, Ford, explained below)
* Custom Stock Longitudinal Control available cars
* Unsupported platforms
* Toyota/Lexus and Ford - most platforms do not allow us to control the PCM's set speed, requires testers to verify
* NEW❗: Speed limit source selector
* Select the desired precedence order of sources used to adapt cruise speed to road limits
* UPDATED: Custom Stock Longitudinal Control
* RE-ENABLED: Hyundai/Kia/Genesis CAN-FD platforms
* UPDATED: Custom Offsets reimplementation
* Camera Offset only works in Laneful (Laneful Only or Laneful in Auto mode when using Dynamic Lane Profile)
* Path Offset can be applied to both Laneless and Laneful
* UPDATED: Refactored Torque Lateral Control custom tuning menu
* NEW❗: Less Restrict Settings for Self-Tune (Beta)
* NEW❗: Custom Tuning for setting offline and live values in real-time
* UPDATED: Auto-detect custom Mapbox token if a personal Mapbox token is provided
* REMOVED: "Enable Mapbox Navigation" toggle
* UI updates
* New Settings menu redesign and improved interactions
* FIXED: Retain hotspot/tethering state was not consistently saved
* FIXED: Map stuck in "Map Loading" if comma Prime is active
* FIXED: OpenStreetMap implementation on C3X devices
* M-TSC
* Altitude (ALT.) display on Developer UI
* Current street name on top of driving screen when "OSM Debug UI" is enabled
* Hyundai Kona Non-SCC 2019 support thanks to Quex!
* Kia Seltos Non-SCC 2023-24 support thanks to Moodkiller and jeroid_!
sunnypilot - 0.9.4.1 (2023-08-11)
========================
* UPDATED: Synced with commaai's 0.9.4 release
* NEW❗: Moonrise driving model
* NEW❗: Ford upstream models support
* UPDATED: Dynamic Lane Profile selector in the "SP - Controls" menu
* REMOVED: Dynamic Lane Profile driving screen UI button
* FIXED: Disallow torque lateral control for angle control platforms (e.g. Ford, Nissan, Tesla)
* Torque lateral control cannot be used by angle control platforms, and would cause a "Controls Unresponsive" error if Torque lateral control is enforced in settings
* REMOVED: Speed Limit Style override
* Honda Accord 2016-17 support thanks to mlocoteta!
* Serial Steering hardware required. For more information, see https://github.com/mlocoteta/serialSteeringHardware
* mapd: utilize advisory speed limit in curves (#142) thanks to pfeiferj!
sunnypilot - 0.9.3.1 (2023-07-09)
========================
* UPDATED: Synced with commaai's 0.9.3 release
* NEW❗: Display Temperature on Sidebar toggle
* Display Ambient temperature, memory temperature, CPU core with the highest temperature, GPU temperature, or max of Memory/CPU/GPU on the sidebar
* Replace "Display CPU Temperature on Sidebar" toggle
* NEW❗: Hot Coffee driving model
* NEW❗: HKG CAN: Smoother Stopping Performance (Beta) toggle
* Smoother stopping behind a stopped car or desired stopping event.
* This is only applicable to HKG CAN platforms using openpilot longitudinal control
* NEW❗: Toyota: TSS2 longitudinal: Custom Tuning
* Smoother longitudinal performance for Toyota/Lexus TSS2/LSS2 cars thanks to dragonpilot-community!
* NEW❗: Enable Screen Recorder toggle
* Enable this will display a button on the onroad screen to toggle on or off real-time screen recording with UI elements.
* IMPROVED: Dynamic Lane Profile: when using Laneline planner via Laneline Mode or Auto Mode, enforce Laneless planner while traveling below 10 MPH or 16 km/h
* REMOVED: Display CPU Temperature on Sidebar
sunnypilot - 0.9.2.3 (2023-06-18)
========================
* NEW❗: Auto Lane Change: Delay with Blind Spot
* Toggle to enable a delay timer for seamless lane changes when blind spot monitoring (BSM) detects an obstructing vehicle, ensuring safe maneuvering
* NEW❗: Driving Screen Off: Wake with Non-Critical Events
* When Driving Screen Off Timer is not set to "Always On":
* Enabled: Wake the brightness of the screen to display all events
* Disabled: Wake the brightness of the screen to display critical events
* Currently, all non-nudge modes are default to continue lane change after 1 seconds of blind spot detection
* NEW❗: Fleet Manager PIN Requirement toggle
* User can now enable or disable PIN requirement on the comma device before accessing Fleet Manager
* NEW❗: Reset all sunnypilot settings toggle
* NEW❗: Turn signals display on screen when blinker is used
* Green: Blinker is on
* Red: Blinker is on, car detected in the adjacent blind spot or road edge detected
* IMPROVED: mapd: better exceptions handling when loading dependencies
* UPDATED: Green Traffic Light Chime no longer displays an orange border when executed
* FIXED: mapd: Road name flashing caused by desync with last GPS timestamp
* FIXED: Ram HD (2500/3500): Ignore paramsd sanity check
* Live parameters have trouble with self-tuning on this platform with upstream openpilot 0.9.2
* Hyundai: Longitudinal support for CAN-based Camera SCC cars thanks to Zack1010OP's Patreon sponsor!
sunnypilot - 0.9.2.2 (2023-06-13)
========================
* NEW❗: Toyota: Allow M.A.D.S. toggling with LKAS Button (Beta)
* IMPROVED: Ram: cruise button handling
sunnypilot - 0.9.2.1 (2023-06-10)
========================
* UPDATED: Synced with commaai's 0.9.2 release
* UPDATED: feature revamp with better stability
* UPDATED:
* M.A.D.S.
* Path color becomes LIGHT ORANGE during Driver Steering Override
* Gap Adjust Cruise (now known as Driving Personality in upstream openpilot 0.9.3):
* Updated profiles and jerk changes
* Experimental Mode support
* Three settings: Stock, Aggressive, and Maniac
* Stock is recommended and the default
* In Aggressive/Maniac mode, lead follow distance is shorter and quicker gas/brake response
* Dynamic Lane Profile
* Display blue borders on both sides of the driving path when Laneline mode is being used in the planner
* Auto Mode optimization
* Permanent: Laneless during Auto Lane Change execution
* Mapd
* OpenStreetMap Database: new regions added
* Developer UI (Dev UI)
* REMOVED: 2-column design
* NEW❗: 1-column + 1-row design
* Custom Stock Longitudinal Control
* NEW❗: Chrysler/Jeep/Ram support
* NEW❗: Mazda support
* NEW❗: Volkswagen PQ support
* DISABLED: Hyundai/Kia/Genesis CAN-FD platforms
* NEW❗: Switch between Chill (openpilot ACC) and Experimental (E2E longitudinal) with DISTANCE button on the steering wheel
* To switch between Chill and Experimental Mode: press and hold the DISTANCE button on the steering wheel for over 0.5 second
* All openpilot longitudinal capable cars support
* NEW❗: Nicki Minaj driving model
* NEW❗: Nissan and Mazda upstream models support
* NEW❗: Pre-Global Subaru upstream models support
* NEW❗: Display End-to-end Longitudinal Status (Beta)
* Display an icon that appears when the End-to-end model decides to start or stop
* NEW❗: Green Traffic Light Chime (Beta)
* A chime will play when the traffic light you are waiting for turns green, and you have no vehicle in front of you.
* NEW❗: Lead Vehicle Departure Alert
* Notify when the leading vehicle drives away
* NEW❗: Speedometer: Display True Speed
* Display the true vehicle current speed from wheel speed sensors.
* NEW❗: Speedometer: Hide from Onroad Screen
* NEW❗: Auto-Hide UI Buttons
* Hide UI buttons on driving screen after a 30-second timeout. Tap on the screen at anytime to reveal the UI buttons
* Applicable to Dynamic Lane Profile (DLP) and Gap Adjust Cruise (GAC)
* NEW❗: Display DM Camera in Reverse Gear
* Show Driver Monitoring camera while the car is in reverse gear
* NEW❗: Block Lane Change: Road Edge Detection (Beta)
* Block lane change when road edge is detected on the stalk actuated side
* NEW❗: Display CPU Temperature on Sidebar
* Display the CPU core with the highest temperature on the sidebar
* NEW❗: Display current driving model in Software settings
* NEW❗: HKG: smartMDPS automatic detection (installed with applicable firmware)
* FIXED: Unintended siren/alarm from the comma device if the vehicle is turned off too quickly in PARK gear
* FIXED: mapd: Exception handling for loading dependencies
* Fleet Manager via Browser support thanks to actuallylemoncurd, AlexandreSato, ntegan1, and royjr!
* Access your dashcam footage, screen recordings, and error logs when the car is turned off
* Connect to the device via Wi-Fi, mobile hotspot, or tethering on the comma device, then navigate to http://ipAddress:5050 to access.
* Honda Clarity 2018-22 support thanks to mcallbosco, vanillagorillaa and wirelessnet2!
* Ram: Steer to 0/7 MPH support thanks to vincentw56!
* Retain hotspot/tethering state across reboots thanks to rogerioaguas!
sunnypilot - Version Latest (2023-02-22)
========================
* UPDATED: Synced with commaai's master branch - 2023.02.19-04:52:00:GMT - 0.9.2
* Refactor sunnypilot features to be more stable
sunnypilot - Version Latest (2022-12-16)
========================
* UPDATED: Synced with commaai's master branch - 2022.12.16-06:31:00:GMT - 0.9.1
* NEW❗: GM:
* NEW❗: Gap Adjust Cruise support - Chill, Normal, Aggressive
* NEW❗: Experimental Mode: Hold DISTANCE button on the steering wheel for 0.5 second to switch between Experimental Mode and Chill Mode
* REMOVED❌: Toytoa: SnG Hack
* This method is not recommended and may cause some cars to not behave as expected
* SDSU is strongly recommended to enable SnG for Toyota vehicles without SnG from factory
* commaai: radard: add missing accel data for vision-only leads (commaai/openpilot#26619) - pending PR
* VOACC performance is drastically improved when using Chill Mode
* IMPROVED: M.A.D.S. events handling
* IMPROVED: UI: screen recorder button change
* IMPROVED: OpenStreetMap Offline Database optimization
* FIXED: Toyota: vehicles' LKAS button no longer has a delay with toggling M.A.D.S.
* FIXED: Toyota: brake pedal press at standstill causing Cruise Fault
* FIXED: Volkswagen MQB: reduce Camera Malfunction occurrences (requires testing)
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-12-10)
========================
* IMPROVED: NEW❗ Developer UI design
* Second column metrics is now moved to the bottom of the screen
* ACC. = Acceleration
* L.S. = Lead Speed
* E.T. = EPS Torque
* B.D. = Bearing Degree
* FRI. = Friction
* L.A. = Lateral Acceleration
* ALT. = Altitude
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-12-07)
========================
* NEW❗: Screen Recorder support thanks to neokii and Kumar!
* NEW❗: End-to-end longitudinal start/stop status icon
* Only appears when Experimental Mode is enabled
* NEW❗: End-to-end longitudinal car chime when starting
* Hyundai/Kia/Genesis CAN platform, Honda/Acura Bosch/Nidec, Toyota/Lexus
* i.e. Traffic light turns green, stop sign ready to go, etc.
* Only appears when Experimental Mode is enabled AND longitudinal control is disengaged
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-12-05)
========================
* UPDATED: Synced with commaai's master branch - 2022.12.04-22:46:00:GMT - 0.9.1
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-11-12)
========================
* UPDATED: Synced with commaai's master branch - 2022.11.12-10:02:00:GMT - 0.8.17
* FIXED: CAN Error for CAN HKG cars that do not have navigation from the factory
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-11-11)
========================
* UPDATED: Synced with commaai's master branch - 2022.11.11-21:22:00:GMT - 0.8.17
* commaai: AGNOS 6.2 (commaai/openpilot#26441)
* NEW❗: Speed Limit Control - HKG - add speed limit from car's navigation head unit
* Compatible with certain models, trims, and model years
* DISABLED: FCA: RAM HD - steer down to 0
* FIXED: UI: End-to-end longitudinal button on driving screen synchronization
* FIXED: Honda: Longitudinal status with set cruise speed now displays properly in the car's dashboard
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-11-08)
========================
* ADDED: New Zealand offline OpenStreetMap database
sunnypilot - Version Latest (2022-11-04)
========================
* UPDATED: Synced with commaai's master branch - 2022.11.05-01:44:00:GMT - 0.8.17
* RE-ENABLED: Dynamic Lane Profile - preserves lanelines
* Can be found in "SP - Controls" menu
* NEW❗: DLP: switch to laneless for current/future curves thanks to @twilsonco!
* Can be found in "SP - Controls" menu
* NEW❗: UI: Road Camera Selector
* Enable this will display a button on the driving screen to select the driving camera
* Can be found in "SP - Visuals" menu
* NEW❗: Controls: Camera & Path Custom Offsets
* Only applicable to laneline mode when using Dynamic Lane Profile
* NEW❗: Buttons on driving screen are now sorted based on priority and availability
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-10-28)
========================
* UPDATED: Synced with commaai's master branch - 2022.10.28-03:53:00:GMT - 0.8.17
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-10-26)
========================
* UPDATED: Synced with commaai's master branch - 2022.10.26-06:20:00:GMT - 0.8.17
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-10-25)
========================
* UPDATED: Synced with commaai's master branch - 2022.10.25-23:53:00:GMT - 0.8.17
* Pre-Global Subaru support thanks to @martinl!
* NEW❗: Speed Limit values turn red when current speed is higher than posted speed limit
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-10-23)
========================
* UPDATED: Synced with commaai's master branch - 2022.10.22-23:15:00:GMT - 0.8.17
* IMPROVED: Custom Stock Longitudinal Control - HKG - only allow engagement on user button press
* IMPROVED: Custom Stock Longitudinal Control - Volkswagen MQB & PQ - more consistent set speed change
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-10-21)
========================
* UPDATED: Synced with commaai's master branch - 2022.10.21-17:33:00:GMT - 0.8.17
* IMPROVED: Custom Stock Longitudinal Control - Volkswagen MQB & PQ - more predictable button send logic
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-10-20)
========================
* UPDATED: Synced with commaai's master branch - 2022.10.20-20:25:00:GMT - 0.8.17
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-10-19)
========================
* UPDATED: Synced with commaai's master branch - 2022.10.19-08:31:00:GMT - 0.8.17
* IMPROVED: Controls: Speed Limit Control - accelerator press only disengage if "Disengage on Accelerator Pedal" is enabled
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-10-18)
========================
* UPDATED: Synced with commaai's master branch - 2022.10.18-04:44:00:GMT - 0.8.17
* RE-ENABLED: Volkswagen MQB & PQ with Custom Stock Longitudinal Control
* NEW❗: Steering Rate Cost Live Tune
* Enables live tune for Steering Rate Cost. Lower value allows steering wheel to move more freely at low speed
* Can be found in "SP - Controls" menu
* FIXED: MADS: GM - include Regen Paddle logic thanks to @twilsonco!
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-10-17)
========================
* UPDATED: Synced with commaai's master branch - 2022.10.17-23:54:00:GMT+1 - 0.8.17
* ENABLED: "Custom Stock Longitudinal Control" toggle for CAN-FD cars
* FIXED: HKG CAN-FD: Could not engage when openpilot longitudinal is enabled
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-10-13)
========================
* UPDATED: Synced with commaai's master branch - 2022.10.13-19:43:00:GMT+1 - 0.8.17
* ADDED: Live Tmux toggle
* Can be found in "SP - General" menu
* IMPROVED: OpenStreetMap Database Update - only check for database update with explicit user decision
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-10-11)
========================
* ADDED: Hyundai openpilot longitudinal improvements - huge thanks to @aragon7777!
* ADDED: Check for OpenStreetMap Database Update button
* UPDATED: commaai: Low speed lateral control improvements (commaai:openpilot#26022, bbcd448) - pending PR
* FIXED: MUTCD speed limit spacing adjusts dynamically when no subtext is shown (i.e., speed limit offset, distance to next speed limit)
* FIXED: MADS: Intermittent CAN Error when engaging for Toyota Prius TSS-P
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-10-09)
========================
* ADDED: commaai: Low speed lateral control improvements (commaai:openpilot#26022, bca288bb) - pending PR
* FIXED: MADS: Intermittent CAN Error when engaging for Toyota Prius TSS-P
* IMPROVED: mapd: stop signs and other supported traffic_calming tags are now slowing/stopping as expected
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-10-08)
========================
* UPDATED: Synced with commaai's master branch - 2022.10.08-12:07:00:GMT+1 - 0.8.17
* FIXED: MADS: Intermittent CAN Error when engaging for Toyota Prius TSS-P
* IMPROVED: mapd: Speed Humps are now set at 20 MPH or 32 km/h
* IMPROVED: OpenStreetMap Offline Database download experience
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-10-07)
========================
* UPDATED: Synced with commaai's master branch - 2022.10.07-08:16:00:GMT - 0.8.17
* NEW❗: OpenStreetMap database can now be downloaded locally for offline use
* Now offering US South, US West, US Northeast, US Florida, Taiwan, and South Africa
* Databases updated - 2022.10.05-03:30:00:GMT
* NEW❗: mapd: Stop Sign, Yield, Speed Bump, Speed Hump, Sharp Curve support - huge thanks to @move-fast and @dragonpilot-community!
* Go to https://openstreetmap.org and start mapping out your area!
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-09-30)
========================
* UPDATED: Synced with commaai's master branch - 2022.09.30-22:43:00:GMT - 0.8.17
* RE-ADDED: Torque Lateral Controller Live Tune Menu
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-09-23)
========================
* ADDED: Developer UI: latAccelFactorFiltered & frictionCoefficientFiltered values displays in green if Torque is using live params
* Bug fixes and performance improvements
sunnypilot - Version Latest (2022-09-22)
========================
* UPDATED: Synced with commaai's master branch - 2022.09.19-22:19:00:GMT - 0.8.17
* NEW❗: Toggle to explicitly enable Custom Stock Longitudinal Control
* Applicable cars only: Honda, Hyundai/Kia/Genesis
* Settings -> Toggles menu
sunnypilot - Version Latest (2022-09-21)
========================
* UPDATED: Synced with commaai's master branch - 2022.09.19-22:19:00:GMT - 0.8.17
* ADDED: Toggle to enable Live Torque (self/auto tune) with Torque lateral controller
* To enable, first enable "Enforce Torque Lateral Controller" toggle
* UPDATED: New metrics in Developer UI (when Live Torque is enabled)
* REMOVED: latAccelFactorRaw & frictionCoefficientRaw from torqued
* ADDED: latAccelFactorFiltered & frictionCoefficientFiltered from torqued
* REMOVED: Temporary remove Torque Lateral Controller Live Tune Menu
sunnypilot - Version Latest (2022-09-20)
========================
* UPDATED: Synced with commaai's master branch - 2022.09.19-22:19:00:GMT - 0.8.17
* ADDED: Toggle to enable Live Torque (self/auto tune) with Torque lateral controller
* To enable, first enable "Enforce Torque Lateral Controller" toggle
* REMOVED: Temporary remove Torque Lateral Controller Live Tune Menu
sunnypilot - Version Latest (2022-09-18)
========================
* UPDATED: Synced with commaai's master branch - 2022.09.17-11:23:00:GMT - 0.8.17
* ADDED: Kia Forte Non-SCC 2019 support for @askalice
* FIXED: Torque Lateral Control Live Tune now syncs with commaai:openpilot#25822
* FIXED: mapd dependencies no longer need to be re-downloaded after unknown reboots
sunnypilot - Version Latest (2022-09-17)
========================
* UPDATED: Synced with commaai's master branch - 2022.09.17-11:23:00:GMT - 0.8.17
* NEW❗: Non SCC HKG support
* Custom Stock Longitudinal Control
* ❗No❗ openpilot longitudinal control
* FIXED: Honda Bosch random low-value set speed changes
sunnypilot - Version Latest (2022-09-16)
========================
* UPDATED: Synced with commaai's master branch - 2022.09.16-20:23:00:GMT - 0.8.17
sunnypilot - Version Latest (2022-09-15)
========================
* UPDATED: Synced with commaai's master branch - 2022.09.16-02:00:00:GMT - 0.8.17
* FIXED: Block additional auto lane change actions if blinker stays on after the first lane change
* REVERTED: Some Toyota with LKAS button no longer requires double press to engage/disengage M.A.D.S.
sunnypilot - Version Latest (2022-09-14)u
========================
* UPDATED: Synced with commaai's master branch - 2022.09.11-02:47:00:GMT - 0.8.17
* NEW❗: GM models supported in Force Car Recognition (FCR)
* Under "SP - Vehicles"
* NEW❗: Prompt to select car in "SP - Vehicles" if car unrecognized on startup
* FIXED: Some Toyota with LKAS button no longer requires double press to engage/disengage M.A.D.S.
* UPDATED: ESCC: Use radar tracks from radar if available
sunnypilot - Version Latest (2022-09-13)
========================
* UPDATED: Synced with commaai's master branch - 2022.09.11-02:47:00:GMT - 0.8.17
* NEW❗: New metric in Developer UI
* Actual Lateral Acceleration (Roll Compensated)
sunnypilot - Version Latest (2022-09-12)
========================
* UPDATED: Synced with commaai's master branch - 2022.09.11-02:47:00:GMT - 0.8.17
* FIXED: Honda Nidec models not gaining speed when longitudinal engaged
sunnypilot - Version Latest (2022-09-11)
========================
* UPDATED: Synced with commaai's master branch - 2022.09.11-02:47:00:GMT - 0.8.17
* NEW❗: Hyundai Enhanced SCC now forwards FCW and AEB signals and commands from radar to car
* RE-ENABLED: MADS Status Icon toggle
sunnypilot - Version Latest (2022-09-10)
========================
* UPDATED: Synced with commaai's master branch - 2022.09.11-02:47:00:GMT - 0.8.17
* NEW❗: RAM improvement implementation thanks to realfast!
* DISABLED: Chrysler/Jeep/Ram with Custom Stock Longitudinal Control
* DISABLED: Volkswagen MQB & PQ with Custom Stock Longitudinal Control
sunnypilot - Version Latest (2022-09-09)
========================
* UPDATED: Synced with commaai's master branch - 2022.09.09-07:35:00:GMT - 0.8.17
* NEW❗: MADS now supporting General Motors (GM)
* ADDED: Custom Stock Longitudinal Control - Volkswagen
* MQB & PQ
* ADDED: Reverse ACC Change
* ACC +/-: Short=5, Long=1
* ADDED: Custom Stock Longitudinal Control
* Hyundai/Kia/Genesis
* Honda Bosch
* ADDED: Hyundai: 2015-16 Genesis resume from standstill fix (commaai:openpilot#25579) - pending PR
* Vision Turn Speed Control re-enabled
* Disable Onroad Uploads toggle re-enabled
sunnypilot - Version Latest (2022-09-08)
========================
* UPDATED: Synced with commaai's master branch - 2022.09.08-04:05:00:GMT - 0.8.17
* NEW❗: Block lane change initiation while brake is pressed
sunnypilot - Version Latest (2022-09-07)
========================
* UPDATED: Synced with commaai's master branch - 2022.09.08-04:05:00:GMT - 0.8.17
* NEW❗: Display End-to-end longitudinal 🌮 on screen
* NEW❗: Hold DISTANCE button on the steering wheel for 1 second to switch between E2E Long and ACC mode
* Enable toggle on the driving screen to switch between modes with End-to-end longitudinal
* Only applicable to cars with openpilot longitudinal control
* NEW❗: Block lane change initiation while brake is pressed
* REMOVED: Dynamic Lane Profile - upstream laneless model is now on by default
* REMOVED: hyundai: consistent start from stop (commaai:openpilot#25672) - pending PR
sunnypilot - Version Latest (2022-09-06)
========================
* UPDATED: Synced with commaai's master branch - 2022.09.06 - 0.8.17
* NEW❗: Display useful metrics above the chevron that tracks the lead car
* Under "SP - Visuals" menu
* Only applicable to cars with openpilot longitudinal control
* ADDED: hyundai: consistent start from stop (commaai:openpilot#25672) - pending PR
* FIXED: Vienna speed limit interface now scales properly with the outer box
* REMOVED: Hyundai long improvements (commaai:openpilot#25604) - closed PR
sunnypilot - Version Latest (2022-09-05)
========================
* UPDATED: Synced with commaai's master branch - 2022.09.03 - 0.8.17
* NEW❗: Speed Limit Control (SLC) interface integrated with upstream
* NEW❗: Speed limit from active navigation is now prioritized for Speed Limit Control
* NEW❗: MUTCD (U.S.) or Vienna (E.U.) speed limit interfaces can now be selected under "SP - Controls"
sunnypilot - Version Latest (2022-09-04)
========================
* UPDATED: Synced with commaai's master branch - 2022.09.03 - 0.8.17
* FIXED: Gap Adjust Cruise status now displays properly on screen
* FIXED: mapd - missing index in list caused mapd to crash
* REMOVED: Temporary removed Vision Turn Speed Control
sunnypilot - Version Latest (2022-09-03)
========================
* UPDATED: Synced with commaai's master branch - 2022.09.03 - 0.8.17
* ADDED: New border colors for different operation engagements
* ADDED: UI: Show barrier when car detected in blind spot
* Only applicable to cars that have BSM detection with openpilot
* FIXED: Cruise Cancel button no longer display prompt if cruise not engaged
* TWEAKED: Update changelogs on startup in Settings -> Software -> Version
* REMOVED: Upload Raw Logs and Full Resolution Videos toggles
sunnypilot - Version Latest (2022-08-31)
========================
* UPDATED: Synced with commaai's master branch - 2022.08.31 - 0.8.17
* ADDED: New border colors for different operation engagements
* ADDED: UI: Show barrier when car detected in blind spot
* Only applicable to cars that have BSM detection with openpilot
* FIXED: Cruise Cancel button no longer display prompt if cruise not engaged
* REMOVED: Upload Raw Logs and Full Resolution Videos toggles
sunnypilot - Version 0.8.16 (2022-07-16)
========================
* Sync with commaai's master branches
* NEW❗: Add toggle to pause lateral actuation below 30 MPH / 50 KM/H
* IMPROVED: Better controls mismatch handling
* IMPROVED: Less frequent Low Memory alert
* IMPROVED: Only allow lateral control when in forward gears
* IMPROVED: Better alerts handling on gear changes
sunnypilot - Version 0.8.14-1.3 (2022-06-29)
========================
* Hyundai/Kia/Genesis
* NEW❗: MADS: Add GAP/Distance button on the steering wheel to engage/disengage
* To engage/disengage MADS: Hold the button for 0.5 second
* NEW❗: Dynamic Lane Profile: Add toggle to enable "Laneless for Curves in Auto Lane"
* HOTFIX🛠: Improve Torque lateral control and reduce ping pong for some Toyota cars
* Torque control: higher low speed gains and better steering angle deadzone logic
* Developer UI: Remove Distance Traveled, replace with Memory Usage %
* This may have a potential to fix the Low Memory alert that may appear
sunnypilot - Version 0.8.14-1 (2022-06-27)
========================
* HOTFIX🛠: Honda, Toyota, Volkswagen now initialized correctly with Torque Lateral Live Tune
sunnypilot - Version 0.8.14-1 (2022-06-27)
========================
* NEW❗: Added toggle to enable updates for sunnypilot
* HOTFIX🛠: Volkswagen car list now displays properly in Force Car Recognition menu
* REVERTED: Honda - temporary removes CRUISE (MAIN) for MADS engagement
* LKAS button continues to be used for MADS engagement/disengagement
sunnypilot - Version 0.8.14-1 (2022-06-26)
========================
Visit https://bit.ly/sunnyreadme for more details
* sunnypilot 0.8.14 release - based on openpilot 0.8.14 devel
* "0.8.14-prod-c3" branch only supports comma three
* If you have a comma two, EON, or other devices than a comma three, visit sunnyhaibin's discord server for more details: https://discord.gg/wRW3meAgtx
* Mono-branch support
* Honda/Acura
* Hyundai/Kia/Genesis
* Toyota/Lexus
* Volkswagen MQB
* Modified Assistive Driving Safety (MADS) Mode
* NEW❗: CRUISE (MAIN) now engages MADS for all supported car makes
* NEW❗: Added toggle to disable disengaging Automatic Lane Centering (ALC) on the brake pedal
* Dynamic Lane Profile (DLP)
* NEW❗: Gap Adjust Cruise (GAC)
* openpilot longitudinal cars can now adjust between the lead car's following distance gap via 3 modes:
* Steering Wheel (SW) | User Interface (UI) | Steering Wheel + User Interface (SW+UI)
* NEW❗: Custom Camera & Path Offsets
* NEW❗: Torque Lateral Control from openpilot 0.8.15 master (as of 2022-06-15)
* NEW❗: Torque Lateral Control Live Tune Menu
* NEW❗: Speed Limit Sign from openpilot 0.8.15 master (as of 2022-06-22)
* NEW❗: Mapbox Speed Limit data will now be utilized in Speed Limit Control (SLC)
* Speed limit data will be utilized in the following availability:
* Mapbox (active navigation) -> OpenStreetMap -> Car Interface (Toyota's TSR)
* Custom Stock Longitudinal Control
* NEW❗: Volkswagen MQB
* Honda
* Hyundai/Kia/Genesis
* NEW❗: Mapbox navigation support for non-Prime users
* Visit sunnyhaibin's discord server for more details: https://discord.gg/wRW3meAgtx
* Hyundai/Kia/Genesis
* NEW❗: Enhanced SCC (ESCC) Support
* Requires hardware modification. Visit sunnyhaibin's discord server for more details: https://discord.gg/wRW3meAgtx
* NEW❗: Smart MDPS (SMDPS) Support - Auto-detection
* Requires hardware modification and custom firmware for the SMDPS. Visit sunnyhaibin's discord server for more details: https://discord.gg/wRW3meAgtx
* Toyota/Lexus
* NEW❗: Added toggle to enforce stock longitudinal control
sunnypilot - Version 0.8.12-4
========================
* NEW❗: Custom Stock Longitudinal Control by setting the target speed via openpilot's "MAX" speed thanks to multikyd!
* Speed Limit Control
* Vision-based Turn Control
* Map-based Turn Control
* NEW❗: HDA status integration with Custom Stock Longitudinal Control on applicable HKG cars only
* NEW❗: Roll Compensation and SteerRatio fix from comma's 0.8.13
* NEW❗: Dev UI to display different metrics on screen
* Click on the "MAX" box on the top left of the openpilot display to toggle different metrics display
* Lead car relative distance; Lead car relative speed; Actual steering degree; Desired steering degree; Engine RPM; Longitudinal acceleration; Lead car actual speed; EPS torque; Current altitude; Compass direction
* NEW❗: Stand Still Timer to display time spent at a stop with M.A.D.S engaged (i.e., stop lights, stop signs, traffic congestions)
* NEW❗: Current car speed text turns red when the car is braking
* NEW❗: Export GPS tracks into GPX files and upload to OSM thanks to eFini!
* NEW❗: Enable ACC and M.A.D.S with a single press of the RES+/SET- button
* NEW❗: ACC +/-: Short=5, Long=1
* Change the ACC +/- buttons behavior with cruise speed change in openpilot
* Disabled (Stock): Short=1, Long=5
* Enabled: Short=5, Long=1
* NEW❗: Speed Limit Value Offset (not %)*
* Set speed limit higher or lower than actual speed limit for a more personalized drive.
* *To use this feature, turn off "Enable Speed Limit % Offset"*
* NEW❗: Dedicated icon to show the status of M.A.D.S.
* NEW❗: No Offroad Fix for non-official devices that cannot shut down after the car is turned off
* NEW❗: Stop N' Go Resume Alternative
* Offer alternative behavior to auto resume when stopped behind a lead car using stock SCC/ACC. This feature removes the repeating prompt chime when stopped and/or allows some cars to use auto resume (i.e., Genesis)
* IMPROVED: Show the lead car icon in the car's dashboard when a lead car is detected by openpilot's camera vision
* FIXED: MADS button unintentionally set MAX when using stock longitudinal control thanks to Spektor56!
sunnypilot - Version 0.8.12-3
========================
* NEW❗: Bypass "System Malfunction" alert toggle
* Prevent openpilot from returning the "System Malfunction" alert that hinders the ability use openpilot
* FIXED: Hyundai/Kia/Genesis Brake Hold Active now outputs the correct events on screen with M.A.D.S. engaged
sunnypilot - Version 0.8.12-2
========================
* NEW❗: Disable M.A.D.S. toggle to disable the beloved M.A.D.S. feature
* Enable Stock openpilot engagement/disengagement
* ADJUST: Initialize Driving Screen Off Brightness at 50%
sunnypilot - Version 0.8.12-1
========================
* sunnypilot 0.8.12 release - based on openpilot 0.8.12 devel
* Dedicated Hyundai/Kia/Genesis branch support
* NEW❗: OpenStreetMap integration thanks to the Move Fast team!
* NEW❗: Vision-based Turn Control
* NEW❗: Map-Data-based Turn Control
* NEW❗: Speed Limit Control w/ optional Speed Limit Offset
* NEW❗: OpenStreetMap integration debug UI
* Only available to openpilot longitudinal enabled cars
* NEW❗: Hands on Wheel Monitoring according to EU r079r4e regulation
* NEW❗: Disable Onroad Uploads for data-limited Wi-Fi hotspots when using OpenStreetMap related features
* NEW❗: Fast Boot (Prebuilt)
* NEW❗: Auto Lane Change Timer
* NEW❗: Screen Brightness Control (Global)
* NEW❗: Driving Screen Off Timer
* NEW❗: Driving Screen Off Brightness (%)
* NEW❗: Max Time Offroad
* Improved user feedback with M.A.D.S. operations thanks to Spektor56!
* Lane Path
* Green🟢 (Laneful), Red🔴 (Laneless): M.A.D.S. engaged
* White⚪: M.A.D.S. suspended or disengaged
* Black⚫: M.A.D.S. engaged, steering is being manually override by user
* Screen border now only illuminates Green when SCC/ACC is engaged
sunnypilot - Version 0.8.10-1 (Unreleased)
========================
* sunnypilot 0.8.10 release - based on openpilot 0.8.10 `devel`
* Add Toyota cars to Force Car Recognition
sunnypilot - Version 0.8.9-4
========================
* Hyundai: Fix Ioniq Hybrid signals
sunnypilot - Version 0.8.9-3
========================
* Update home screen brand and version structure
sunnypilot - Version 0.8.9-2
========================
* Added additional Sonata Hybrid Firmware Versions
* Features
* Modified Assistive Driving Safety (MADS) Mode
* Dynamic Lane Profile (DLP)
* Quiet Drive 🤫
* Force Car Recognition (FCR)
* PID Controller: add kd into the stock PID controller
sunnypilot - Version 0.8.9-1
========================
* First changelog!
* Features
* Modified Assistive Driving Safety (MADS) Mode
* Dynamic Lane Profile (DLP)
* Quiet Drive 🤫
* Force Car Recognition (FCR)
* PID Controller: add kd into the stock PID controller
+430 -50
View File
@@ -1,80 +1,460 @@
[![openpilot on the comma 3X](https://github.com/commaai/openpilot/assets/8762862/f09e6d29-db2d-4179-80c2-51e8d92bdb5c)](https://comma.ai/shop/comma-3x)
![](https://user-images.githubusercontent.com/47793918/233812617-beab2e71-57b9-479e-8bff-c3931347ca40.png)
What is openpilot?
Table of Contents
=======================
* [Join our Discord](#-join-our-discord)
* [What is sunnypilot?](#-what-is-sunnypilot)
* [Running in a car](#-running-on-a-dedicated-device-in-a-car)
* [Read Before Installing](#-read-before-installing)
* [Prohibited Safety Modifications](#-prohibited-safety-modifications)
* [Installation](#-installation)
* [Highlight Features](#-highlight-features)
* [Driving Enhancements](#-driving-enhancements)
* [Branch Definitions](#-branch-definitions)
* [Recommended Branches](#-recommended-branches)
* [How-To's](#-How-Tos)
* [Pull Requests](#-Pull-Requests)
* [Special Thanks](#-special-thanks)
* [User Data](#-user-data)
* [Licensing](#licensing)
* [Donate](#-support-sunnypilot)
---
<details><summary><h3>💭 Join our Discord</h3></summary>
---
Join the official sunnypilot Discord server to stay up to date with all the latest features and be a part of shaping the future of sunnypilot!
* https://discord.gg/sunnypilot
![](https://dcbadge.vercel.app/api/server/wRW3meAgtx?style=flat) ![Discord Shield](https://discordapp.com/api/guilds/880416502577266699/widget.png?style=shield)
</details>
<details><summary><h3>🌞 What is sunnypilot?</h3></summary>
---
[sunnypilot](https://github.com/sunnyhaibin/sunnypilot) is a fork of comma.ai's openpilot, an open source driver assistance system. sunnypilot offers the user a unique driving experience for over 250+ supported car makes and models with modified behaviors of driving assist engagements. sunnypilot complies with comma.ai's safety rules as accurately as possible.
</details>
<details><summary><h3>🚘 Running on a dedicated device in a car</h3></summary>
---
To use sunnypilot in a car, you need the following:
* A supported device to run this software
* a [comma three](https://comma.ai/shop/products/three), or
* a comma two (only with older versions below 0.8.13)
* This software
* One of [the 250+ supported cars](https://github.com/commaai/openpilot/blob/master/docs/CARS.md). We support Honda, Toyota, Hyundai, Nissan, Kia, Chrysler, Lexus, Acura, Audi, VW, Ford and more. If your car is not supported but has adaptive cruise control and lane-keeping assist, it's likely able to run sunnypilot.
* A [car harness](https://comma.ai/shop/products/car-harness) to connect to your car
Detailed instructions for [how to mount the device in a car](https://comma.ai/setup).
</details>
<details><summary><h3>🚨 Read Before Installing</h3></summary>
---
It is recommended to read this **entire page** before proceeding. This will ensure that you fully understand each added feature on sunnypilot, and you are selecting the right branch for your car to have the best driving experience.
This is a fork of [comma.ai's openpilot](https://github.com/commaai/openpilot). By installing this software, you accept all responsibility for anything that might occur while you use it. All contributors to sunnypilot are not liable. ❗<ins>**Use at your own risk.**</ins>❗
</details>
<details><summary><h3>⛔ Prohibited Safety Modifications</h3></summary>
---
All [official sunnypilot branches](https://github.com/sunnyhaibin/sunnypilot/branches) strictly adhere to [comma.ai's safety policy](https://github.com/commaai/openpilot/blob/master/docs/SAFETY.md). Any changes that go against this policy will result in your fork and your device being banned from both comma.ai and sunnypilot channels.
The following changes are a **VIOLATION** of this policy and **ARE NOT** included in any sunnypilot branches:
* Driver Monitoring:
* ❌ "Nerfing" or reducing monitoring parameters.
* Panda safety:
* ❌ No preventing disengaging of <ins>**LONGITUDINAL CONTROL**</ins> (acceleration/brake) on brake pedal press.
* ❌ No auto re-engaging of <ins>**LONGITUDINAL CONTROL**</ins> (acceleration/brake) on brake pedal release.
* ❌ No disengaging on ACC MAIN in OFF state.
</details>
<details><summary><h3>⚒ Installation</h3></summary>
---
<details><summary>URL (Easy)</summary>
comma three
------
[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](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](docs/INTEGRATION.md) and [limitations](docs/LIMITATIONS.md).
Please refer to [Recommended Branches](#-recommended-branches) to find your preferred/supported branch. This guide will assume you want to install the latest `release-c3` branch.
<table>
<tr>
<td><a href="https://youtu.be/NmBfgOanCyk" title="Video By Greer Viau"><img src="https://github.com/commaai/openpilot/assets/8762862/2f7112ae-f748-4f39-b617-fabd689c3772"></a></td>
<td><a href="https://youtu.be/VHKyqZ7t8Gw" title="Video By Logan LeGrand"><img src="https://github.com/commaai/openpilot/assets/8762862/92351544-2833-40d7-9e0b-7ef7ae37ec4c"></a></td>
<td><a href="https://youtu.be/SUIZYzxtMQs" title="A drive to Taco Bell"><img src="https://github.com/commaai/openpilot/assets/8762862/05ceefc5-2628-439c-a9b2-89ce77dc6f63"></a></td>
</tr>
</table>
* sunnypilot not installed or you installed a version before 0.8.17?
1. [Factory reset/uninstall](https://github.com/commaai/openpilot/wiki/FAQ#how-can-i-reset-the-device) the previous software if you have another software/fork installed.
2. After factory reset/uninstall and upon reboot, select `Custom Software` when given the option.
3. Input the installation URL per [Recommended Branches](#-recommended-branches). Example: ```release-c3.sunnypilot.ai``` [^4] (note: `https://` is not requirement on the comma three)
4. Complete the rest of the installation following the onscreen instructions.
To start using openpilot in a car
* sunnypilot already installed and you installed a version after 0.8.17?
1. On the comma three, go to `Settings` ▶️ `Software`.
2. At the `Download` option, press `CHECK`. This will fetch the list of latest branches from sunnypilot.
3. At the `Target Branch` option, press `SELECT` to open the Target Branch selector.
4. Scroll to select the desired branch per [Recommended Branches](#-recommended-branches). Example: `release-c3`
| Branch | Installation URL |
|:------------:|:--------------------------------:|
| `release-c3` | https://release-c3.sunnypilot.ai |
| `staging-c3` | https://staging-c3.sunnypilot.ai |
| `dev-c3` | https://dev-c3.sunnypilot.ai |
Requires further assistance with software installation? Join the [sunnypilot Discord server](https://discord.sunnypilot.com) and message us in the `#installation-help` channel.
comma two
------
To use openpilot in a car, you need four things:
1. **Supported Device:** a comma 3/3X, available at [comma.ai/shop](https://comma.ai/shop/comma-3x).
2. **Software:** The setup procedure for the comma 3/3X allows users to enter a URL for custom software. Use the URL `openpilot.comma.ai` to install the release version.
3. **Supported Car:** Ensure that you have one of [the 250+ supported cars](docs/CARS.md).
4. **Car Harness:** You will also need a [car harness](https://comma.ai/shop/car-harness) to connect your comma 3/3X to your car.
1. [Factory reset/uninstall](https://github.com/commaai/openpilot/wiki/FAQ#how-can-i-reset-the-device) the previous software if you have another software/fork installed.
2. After factory reset/uninstall and upon reboot, select `Custom Software` when given the option.
3. Input the installation URL per [Recommended Branches](#-recommended-branches). Example: ```https://smiskol.com/fork/sunnyhaibin/0.8.12-4-prod```
4. Complete the rest of the installation following the onscreen instructions.
We have detailed instructions for [how to install the harness and device in a car](https://comma.ai/setup). Note that it's possible to run openpilot on [other hardware](https://blog.comma.ai/self-driving-car-for-free/), although it's not plug-and-play.
Requires further assistance with software installation? Join the [sunnypilot Discord server](https://discord.sunnypilot.com) and message us in the `#installation-help` channel.
To start developing openpilot
</details>
<details>
<summary>SSH (More Versatile)</summary>
<br>
Prerequisites: [How to SSH](https://github.com/commaai/openpilot/wiki/SSH)
If you are looking to install sunnypilot via SSH, run the following command in an SSH terminal after connecting to your device:
comma three:
------
* [`release-c3`](https://github.com/sunnyhaibin/openpilot/tree/release-c3):
openpilot is developed by [comma](https://comma.ai/) and by users like you. We welcome both pull requests and issues on [GitHub](http://github.com/commaai/openpilot).
```
cd /data; rm -rf ./openpilot; git clone -b release-c3 --recurse-submodules https://github.com/sunnyhaibin/sunnypilot.git openpilot; cd openpilot; sudo reboot
```
* Join the [community Discord](https://discord.comma.ai)
* Check out [the contributing docs](docs/CONTRIBUTING.md)
* Check out the [openpilot tools](tools/)
* Read about the [development workflow](docs/WORKFLOW.md)
* Code documentation lives at https://docs.comma.ai
* Information about running openpilot lives on the [community wiki](https://github.com/commaai/openpilot/wiki)
Want to get paid to work on openpilot? [comma is hiring](https://comma.ai/jobs#open-positions) and offers lots of [bounties](docs/BOUNTIES.md) for external contributors.
Safety and Testing
----
* openpilot observes [ISO26262](https://en.wikipedia.org/wiki/ISO_26262) guidelines, see [SAFETY.md](docs/SAFETY.md) for more details.
* openpilot has software-in-the-loop [tests](.github/workflows/selfdrive_tests.yaml) that run on every commit.
* The code enforcing the safety model lives in panda and is written in C, see [code rigor](https://github.com/commaai/panda#code-rigor) for more details.
* panda has software-in-the-loop [safety tests](https://github.com/commaai/panda/tree/master/tests/safety).
* Internally, we have a hardware-in-the-loop Jenkins test suite that builds and unit tests the various processes.
* panda has additional hardware-in-the-loop [tests](https://github.com/commaai/panda/blob/master/Jenkinsfile).
* We run the latest openpilot in a testing closet containing 10 comma devices continuously replaying routes.
User Data and comma Account
comma two:
------
* [`0.8.12-prod-personal-hkg`](https://github.com/sunnyhaibin/openpilot/tree/0.8.12-prod-personal-hkg):
By default, openpilot uploads the driving data to our servers. You can also access your data through [comma connect](https://connect.comma.ai/). We use your data to train better models and improve openpilot for everyone.
```
cd /data; rm -rf ./openpilot; git clone -b 0.8.12-prod-personal-hkg --recurse-submodules https://github.com/sunnyhaibin/sunnypilot.git openpilot; cd openpilot; sudo reboot
```
openpilot is open source software: the user is free to disable data collection if they wish to do so.
After running the command to install the desired branch, your comma device should reboot.
</details>
openpilot logs the road-facing cameras, CAN, GPS, IMU, magnetometer, thermal sensors, crashes, and operating system logs.
</details>
<details><summary><h3>🚗 Highlight Features</h3></summary>
---
### Quality of Life Enhancements
- [**Modified Assistive Driving Safety (MADS)**](#modified-assistive-driving-safety-mads) - Automatic Lane Centering (ALC) / Lane Keep Assist System (LKAS) and Adaptive Cruise Control (ACC) / Smart Cruise Control (SCC) can be engaged independently of each other
- [**Dynamic Lane Profile (DLP)**](#dynamic-lane-profile-dlp) - Dynamically switch lane profile (between Laneful and Laneless) based on lane recognition confidence
- [**Enhanced Speed Control**](#enhanced-speed-control) - Automatically adjust cruise control speed using vision model, OpenStreetMap (OSM) data, and/or Speed Limit control (SLC) without user interaction
* Vision-based Turn Speed Control (V-TSC) - lower speed when going around corners using vision model
* Map-Data-based Turn Speed Control (M-TSC) - lower speed when going around corners using OSM data[^1]
* Speed Limit Control (SLC) - Set speed limit based on map data or car interface (if applicable)
* HKG only: Highway Driving Assist (HDA) status integration - Use cars native speed sign detection to set desired speed (on applicable HKG cars only)
- [**Gap Adjust Cruise (GAC)**](#gap-adjust-cruise) - Allow `GAP`/`INTERVAL`/`DISTANCE` button on the steering wheel or on-screen button to adjust the follow distance from the lead car. See table below for options
- [**Quiet Drive 🤫**](#-quiet-drive) - Toggle to mute all notification sounds (excluding driver safety warnings)
- [**Auto Lane Change Timer**](#Auto-Lane-Change-Timer) - 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
- [**Force Car Recognition (FCR)**](#Force-Car-Recognition-) - Use a selector to force your car to be recognized by sunnypilot
- [**Fix sunnypilot No Offroad**](#Fix-sunnypilot-No-Offroad) - Enforce sunnypilot to go offroad and turns off after shutting down the car. This feature fixes non-official devices running sunnypilot without comma power
- [**Enable ACC+MADS with RES+/SET-**](#Enable-ACC+MADS-with-RES+/SET-) - Engage both ACC and MADS with a single press of RES+ or SET- button
- [**Offline OSM Maps**](#Offline-OSM-Maps) - OSM database can now be downloaded locally for offline use[^2]. This enables offline SLC, V-TSC and M-TSC. Currently available for US South, US West, US Northeast, Florida, Taiwan, South Africa and New Zealand
- [**Various Live Tuning**](#Various-Live-Tuning) - Ability to tailor your driving experience on the fly:
* Enforce Torque Lateral Control - Use the newest [torque controller](https://blog.comma.ai/0815release/#torque-controller) for all vehicles.
* Torque Lateral Control Live Tune - Ability to adjust the torque controllers `FRICTION` and `LAT_ACCEL_FACTOR` values to suit your vehicle.
* Torque Lateral Controller Self-Tune - Enable automatic turning for the Torque controller.
### Visual Enhancements
* **M.A.D.S Status Icon** - Dedicated icon to display M.A.D.S. engagement status
* Green🟢: M.A.D.S. engaged
* White⚪: M.A.D.S. suspended or disengaged
* **Lane Path Color** - Various lane path colors to display real-time Lane Model and M.A.D.S. engagement status
* 0.8.14 and later:
* Blue🔵: Laneful mode & M.A.D.S. engaged
* Green🟢: Laneless mode & M.A.D.S. engaged
* Yellow🟡: Experimental e2e & M.A.D.S. engaged
* Pre 0.8.14:
* Green🟢: Laneful mode & M.A.D.S. engaged
* Red🔴: Laneless mode & M.A.D.S. engaged
* White⚪: M.A.D.S. suspended or disengaged
* Black⚫: M.A.D.S. engaged, steering is being manually overridden by user
* **Developer (Dev) UI** - Display various real-time metrics on screen while driving
* **Stand Still Timer** - Display time spent at a stop with M.A.D.S engaged (i.e., at traffic lights, stop signs, traffic congestions)
* **Braking Status** - Current car speed text turns red when the car is braking by the driver or ACC/SCC
### Operational Enhancements
* **Fast Boot** - sunnypilot will fast boot by creating a Prebuilt file
* **Disable Onroad Uploads** - Disable uploads completely when onroad. Necessary to avoid high data usage when connected to Wi-Fi hotspot
* **Brightness Control (Global)** - Manually adjusts the global brightness of the screen
* **Driving Screen Off Timer** - Turns off the device screen or reduces brightness to protect the screen after car starts
* **Driving Screen Off Brightness (%)** - When using the Driving Screen Off feature, the brightness is reduced according to the automatic brightness ratio
* **Max Time Offroad** - Device is automatically turned off after a set time when the engine is turned off (off-road) after driving (on-road)
</details>
<details><summary><h3>🚗 Driving Enhancements</h3></summary>
---
### Modified Assistive Driving Safety (MADS)
The goal of Modified Assistive Driving Safety (MADS) is to enhance the user driving experience with modified behaviors of driving assist engagements. This feature complies with comma.ai's safety rules as accurately as possible with the following changes:
* sunnypilot Automatic Lane Centering (ALC) and ACC/SCC can be engaged independently of each other
* Dedicated button to toggle sunnypilot ALC:
* `CRUISE (MAIN)` button: All supported cars on sunnypilot
* `LFA` button: Newer HKG cars with `LFA` button
* `LKAS` button: Honda, Toyota, Global Subaru
* `SET-` button enables ACC/SCC
* `CANCEL` button only disables ACC/SCC
* `CRUISE (MAIN)` must be `ON` to use ACC/SCC
* `CRUISE (MAIN)` button disables sunnypilot completely when `OFF` **(strictly enforced in panda safety code)**
### Disengage Lateral ALC on Brake Press Mode toggle
Dedicated toggle to handle Lateral state on brake pedal press and release:
1. `ON`: `BRAKE pedal` press will pause Automatic Lane Centering; `BRAKE pedal` release will resume Automatic Lane Centering. Note: `BRAKE pedal` release will NOT resume ACC/SCC/Long control without explicit user engagement **(strictly enforced in panda safety code)**
2. `OFF`: `BRAKE pedal` press will NOT pause Automatic Lane Centering; `BRAKE pedal` release will NOT resume ACC/SCC/Long control without explicit user engagement **(strictly enforced in panda safety code)**
### Miscellaneous
* `TURN SIGNALS` (`Left` or `Right`) will pause Automatic Lane Centering if the vehicle speed is below the [threshold](https://github.com/commaai/openpilot/blob/master/selfdrive/controls/lib/desire_helper.py#L8) for Automatic Lane Change
* Event audible alerts are more relaxed to match manufacturer's stock behavior
* Critical events trigger disengagement of Automatic Lane Centering completely. The disengagement is enforced in sunnypilot and panda safety
### Dynamic Lane Profile (DLP)
Dynamic Lane Profile (DLP) aims to provide the best driving experience at staying within a lane confidently. Dynamic Lane Profile allows sunnypilot to dynamically switch between lane profiles based on lane recognition confidence level on road.
There are 3 modes to select on the onroad camera screen:
* **Auto Lane**: sunnypilot dynamically chooses between `Laneline` or `Laneless` model
* **Laneline**: sunnypilot uses Laneline model only.
* **Laneless**: sunnypilot uses Laneless model only.
To use Dynamic Lane Profile, do the following:
```
1. sunnypilot Settings -> `SP - Controls` -> Enable Dynamic Lane Profile -> ON toggle
2. Reboot.
3. Before driving, on the onroad camera screen, toggle between the 3 modes by pressing on the button.
4. Drive.
```
### Enhanced Speed Control
This fork now allows supported cars to dynamically adjust the longitudinal plan based on the fetched map data. Big thanks to the Move Fast team for the amazing implementation!
**Supported cars:**
* sunnypilot Longitudinal Control capable
* Stock Longitudinal Control
* Hyundai/Kia/Genesis (non CAN-FD)
* Honda Bosch
* Volkswagen MQB
Certain features are only available with an active data connection, via:
* [comma Prime](https://comma.ai/prime) - Intuitive service provided directly by comma, or
* Personal Hotspot - From your mobile device, or a dedicated hotspot from a cellular carrier.
**Features:**
* Vision-based Turn Speed Control (VTSC) - Use vision path predictions to estimate the appropriate speed to drive through turns ahead - i.e. slowing down for curves
* Map-Data-based Turn Speed Control (MTSC) - Use curvature information from map data to define speed limits to take turns ahead - i.e. slowing down for curves[^1]
* Speed Limit Control (SLC) - Use speed limit signs information from map data and car interface to automatically adapt cruise speed to road limits
* HKG only: Highway Driving Assist (HDA) status integration - on applicable HKG cars only[^1]
* Speed Limit Offset - When Speed Limit Control is enabled, set speed limit slightly higher than the actual speed limit for a more natural drive[^1]
* Toggle Hands on Wheel Monitoring - Monitors and alerts the driver when their hands have not been on the steering wheel for an extended time
### Custom Stock Longitudinal Control
While using stock Adaptive/Smart Cruise Control, Custom Stock Longitudinal Control in sunnypilot allows sunnypilot to manipulate and take over the set speed on the car's dashboard.
**Supported Cars:**
* Hyundai/Kia/Genesis
* CAN platform
* CAN-FD platform with 0x1CF broadcasted in CAN traffic
* Honda Bosch
* Volkswagen MQB
**Instruction**
**📗 How to use Custom Longitudinal Control on sunnypilot **
When using Speed Limit, Vision, or Map based Turn control, you will be setting the "MAX" ACC speed on the sunnypilot display instead of the one in the dashboard. The car will then set the ACC setting in the dashboard to the targeted speed, but will never exceed the max speed set on the sunnypilot display. A quick press of the RES+ or SET- buttons will change this speed by 5 MPH or KM/H on the sunnypilot display, while a long deliberate press (about a 1/2 second press) changes it by 1 MPH or KM/H. DO NOT hold the RES+ or SET- buttons for longer that a 1 second. Either make quick or long deliberate presses only.
**‼ Where to look when setting ACC speed ‼**
Do not look at the dashboard when setting your ACC max speed. Instead, only look at the one on the sunnypilot display, "MAX". The reason you need to look at the sunnypilot display is because sunnypilot will be changing the one in the dashboard. It will be adjusting it as needed, never raising it above the one set on the sunnypilot display. ONLY look at the MAX speed on the sunnypilot display when setting the ACC speed instead of the dashboard!
(Courtesy instructions from John, author of jvePilot)
### Gap Adjust Cruise
This fork now allows supported openpilot longitudinal cars to adjust the cruise gap between the car and the lead car.
**Supported cars:**
* sunnypilot Longitudinal Control capable
🚨**PROCEED WITH EXTREME CAUTION AND BE READY TO MANUALLY TAKE OVER AT ALL TIMES**
There are 4 modes to select on the steering wheel and/or the onroad camera screen:
* **Stock Gap**: Stock sunnypilot distance - 1.45 second profile
* **Mild Gap**: Semi-aggressive distance - 1.25 second profile
* 🚨**Aggro Gap**🚨: Aggressive distance - 1.0 second profile
**Availability**
| Car Make | Stock Gap | Mild Gap | Aggro Gap |
|:-------------------:|:---------:|:--------:|:---------:|
| Honda/Acura | ✅ | ✅ | ✅ |
| Hyundai/Kia/Genesis | ✅ | ✅ | ✅ |
| Toyota/Lexus | ✅ | ✅ | ✅ |
| Volkswagen MQB/PQ | ✅ | ✅ | ✅ |
</details>
<details><summary><h3>⚒ Branch Definitions</h3></summary>
---
| Tag | Definition | Description |
|:---------:|----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `release` | Release branches | Include features that are **verified** by trusted testers and the community. Ready to use. ✅ |
| `staging` | Staging branches | Include new features that are **tested** by trusted testers and the community. Stability may vary. ⚠ |
| `dev` | Development branches | All features are gathered in respective versions. Reviewed and merged features will be committed to `dev`. Stability may vary. ⚠ |
| `master` | Main branch | Syncs with [commaai's openpilot `master`](https://github.com/commaai/openpilot) upstream branch. Accepts all pull requests. Does not include all sunnypilot features. Stability may vary. ⚠ |
Example:
* [`release-c3`](https://github.com/sunnyhaibin/sunnypilot/tree/release-c3): Latest release branch for comma three that are verified by trusted testers and the community. Ready to use.
* [`staging-c3`](https://github.com/sunnyhaibin/sunnypilot/tree/staging-c3): Latest staging branch for comma three that are tested by trusted testers and the community. Verification required.
* [`dev-c3`](https://github.com/sunnyhaibin/sunnypilot/tree/dev-c3): Latest development branch for comma three that include all sunnypilot features. Testing required.
</details>
<details><summary><h3>✅ Recommended Branches</h3></summary>
---
| Branch | Definition | Compatible Device | Changelogs |
|:------------------------------------------------------------------------------------|---------------------------------------------------------|-------------------|--------------------------------------------------------------------------------------------|
| [`release-c3`](https://github.com/sunnyhaibin/sunnypilot/tree/release-c3) | • Latest release/stable branch | comma three | [`CHANGELOGS.md`](https://github.com/sunnyhaibin/sunnypilot/blob/release-c3/CHANGELOGS.md) |
| [`staging-c3`](https://github.com/sunnyhaibin/sunnypilot/tree/staging-c3) | • Latest staging branch | comma three | [`CHANGELOGS.md`](https://github.com/sunnyhaibin/sunnypilot/blob/staging-c3/CHANGELOGS.md) |
| [`dev-c3`](https://github.com/sunnyhaibin/sunnypilot/tree/dev-c3) | • Latest development branch with experimental features | comma three | [`CHANGELOGS.md`](https://github.com/sunnyhaibin/sunnypilot/blob/dev-c3/CHANGELOGS.md) |
</details>
<details><summary><h3>📗 How To's</h3></summary>
---
How-To instructions can be found in [HOW-TOS.md](https://github.com/sunnyhaibin/openpilot/blob/(!)README/HOW-TOS.md).
</details>
<details><summary><h3>🎆 Pull Requests</h3></summary>
---
We welcome both pull requests and issues on GitHub. Bug fixes are encouraged.
Pull requests should be against the most current `master` branch.
</details>
<details><summary><h3>🏆 Special Thanks</h3></summary>
---
* [spektor56](https://github.com/spektor56/openpilot)
* [rav4kumar](https://github.com/rav4kumar/openpilot)
* [mob9221](https://github.com/mob9221/opendbc)
* [briantran33](https://github.com/briantran33/openpilot)
* [Aragon7777](https://github.com/aragon7777/openpilot)
* [sshane](https://github.com/sshane/openpilot-installer-generator)
* [jung](https://github.com/chanhojung/openpilot)
* [dri94](https://github.com/dri94/openpilot)
* [FrogAi](https://github.com/frogAi/FrogPilot/)
* [twilsonco](https://github.com/twilsonco/openpilot)
* [martinl](https://github.com/martinl/openpilot)
* [multikyd](https://github.com/openpilotkr)
* [Move Fast GmbH](https://github.com/move-fast/openpilot)
* [dragonpilot](https://github.com/dragonpilot-community/dragonpilot)
* [neokii](https://github.com/neokii/openpilot)
* [AlexandreSato](https://github.com/AlexandreSato/openpilot)
* [Moodkiller](https://github.com/moodkiller)
</details>
<details><summary><h3>📊 User Data</h3></summary>
---
By default, sunnypilot uploads the driving data to comma servers. You can also access your data through [comma connect](https://connect.comma.ai/).
sunnypilot is open source software. The user is free to disable data collection if they wish to do so.
sunnypilot logs the road-facing camera, CAN, GPS, IMU, magnetometer, thermal sensors, crashes, and operating system logs.
The driver-facing camera is only logged if you explicitly opt-in in settings. The microphone is not recorded.
By using openpilot, you agree to [our Privacy Policy](https://comma.ai/privacy). You understand that use of this software or its related services will generate certain types of user data, which may be logged and stored at the sole discretion of comma. By accepting this agreement, you grant an irrevocable, perpetual, worldwide right to comma for the use of this data.
By using this software, you understand that use of this software or its related services will generate certain types of user data, which may be logged and stored at the sole discretion of comma. By accepting this agreement, you grant an irrevocable, perpetual, worldwide right to comma for the use of this data.
Licensing
------
</details>
<details><summary><h3>Licensing</h3></summary>
openpilot is released under the MIT license. Some parts of the software are released under other licenses as specified.
Any user of this software shall indemnify and hold harmless Comma.ai, Inc. and its directors, officers, employees, agents, stockholders, affiliates, subcontractors and customers from and against all allegations, claims, actions, suits, demands, damages, liabilities, obligations, losses, settlements, judgments, costs and expenses (including without limitation attorneys fees and costs) which arise out of, relate to or result from any use of this software by user.
Any user of this software shall indemnify and hold harmless comma.ai, Inc. and its directors, officers, employees, agents, stockholders, affiliates, subcontractors and customers from and against all allegations, claims, actions, suits, demands, damages, liabilities, obligations, losses, settlements, judgments, costs and expenses (including without limitation attorneys fees and costs) which arise out of, relate to or result from any use of this software by user.
**THIS IS ALPHA QUALITY SOFTWARE FOR RESEARCH PURPOSES ONLY. THIS IS NOT A PRODUCT.
YOU ARE RESPONSIBLE FOR COMPLYING WITH LOCAL LAWS AND REGULATIONS.
NO WARRANTY EXPRESSED OR IMPLIED.**
</details>
<h3>💰 Support sunnypilot</h3>
---
<img src="https://d1qb2nb5cznatu.cloudfront.net/startups/i/1061157-bc7e9bf3b246ece7322e6ffe653f6af8-medium_jpg.jpg?buster=1458363130" width="75"></img> <img src="https://cdn-images-1.medium.com/max/1600/1*C87EjxGeMPrkTuVRVWVg4w.png" width="225"></img>
If you find any of the features useful, consider becoming a [patron on Patreon](https://www.patreon.com/sunnyhaibin) or a [sponsor on GitHub](https://github.com/sponsors/sunnyhaibin) to support future feature development and improvements.
![openpilot tests](https://github.com/commaai/openpilot/actions/workflows/selfdrive_tests.yaml/badge.svg)
[![codecov](https://codecov.io/gh/commaai/openpilot/branch/master/graph/badge.svg)](https://codecov.io/gh/commaai/openpilot)
By becoming a patron/sponsor, you will gain access to exclusive content, early access to new features, and the opportunity to directly influence the project's development.
<h3>Patreon</h3>
<a href="https://www.patreon.com/sunnyhaibin">
<img src="https://user-images.githubusercontent.com/47793918/244128051-bc7e913e-a196-4455-926e-23aec9a4bd3b.png" alt="Become a Patron" width="300" style="max-width: 100%; height: auto;">
</a>
<br>
<h3>GitHub Sponsor</h3>
<a href="https://github.com/sponsors/sunnyhaibin">
<img src="https://user-images.githubusercontent.com/47793918/244135584-9800acbd-69fd-4b2b-bec9-e5fa2d85c817.png" alt="Become a Sponsor" width="300" style="max-width: 100%; height: auto;">
</a>
<br>
<h3>PayPal</h3>
<a href="https://paypal.me/sunnyhaibin0850" target="_blank">
<img src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" alt="PayPal this" title="PayPal - The safer, easier way to pay online!" border="0" />
</a>
<br></br>
Your continuous love and support are greatly appreciated! Enjoy 🥰
<span>-</span> Jason, Founder of sunnypilot
[^1]:Requires data connection if not using Offline Maps data
[^2]:At least 50 GB of storage space is required. If you have the 32 GB version of comma three, upgrading with a compatible 250 GB or 1 TB SSD is strongly recommended
[^4]:Shortened URL for convenience. Full URL is ```smiskol.com/fork/sunnyhaibin/release-c3```
+1 -1
Submodule cereal updated: 2012d9fd16...d4c43a0865
+94
View File
@@ -207,6 +207,100 @@ std::unordered_map<std::string, uint32_t> keys = {
{"UpdaterLastFetchTime", PERSISTENT},
{"Version", PERSISTENT},
{"VisionRadarToggle", PERSISTENT},
{"AccMadsCombo", PERSISTENT},
{"AmapKey1", PERSISTENT},
{"AmapKey2", PERSISTENT},
{"AutoLaneChangeTimer", PERSISTENT},
{"AutoLaneChangeBsmDelay", PERSISTENT},
{"BelowSpeedPause", PERSISTENT},
{"BrakeLights", PERSISTENT},
{"BrightnessControl", PERSISTENT},
{"ButtonAutoHide", PERSISTENT},
{"CameraControl", PERSISTENT},
{"CameraControlToggle", PERSISTENT},
{"CameraOffset", PERSISTENT},
{"CarModel", PERSISTENT},
{"CarModelText", PERSISTENT},
{"ChevronInfo", PERSISTENT},
{"CustomBootScreen", PERSISTENT},
{"CustomMapboxTokenPk", PERSISTENT},
{"CustomMapboxTokenSk", PERSISTENT},
{"CustomOffsets", PERSISTENT},
{"CustomStockLong", PERSISTENT},
{"CustomTorqueLateral", PERSISTENT},
{"DevUI", PERSISTENT},
{"DevUIInfo", PERSISTENT},
{"DisableOnroadUploads", PERSISTENT},
{"DisengageLateralOnBrake", PERSISTENT},
{"DynamicExperimentalControl", PERSISTENT},
{"DynamicExperimentalControlToggle", PERSISTENT},
{"DynamicLaneProfile", PERSISTENT},
{"DynamicLaneProfileToggle", PERSISTENT},
{"EnableAmap", PERSISTENT},
{"EnableDebugSnapshot", PERSISTENT},
{"EnableGmap", PERSISTENT},
{"EnableMads", PERSISTENT},
{"EndToEndLongAlertLead", PERSISTENT},
{"EndToEndLongAlertLight", PERSISTENT},
{"EndToEndLongAlertUI", PERSISTENT},
{"EndToEndLongToggle", PERSISTENT},
{"EnforceTorqueLateral", PERSISTENT},
{"EnhancedScc", PERSISTENT},
{"FleetManagerPin", PERSISTENT},
{"GapAdjustCruise", PERSISTENT},
{"GapAdjustCruiseMax", PERSISTENT},
{"GapAdjustCruiseMin", PERSISTENT},
{"GapAdjustCruiseMode", PERSISTENT},
{"GapAdjustCruiseTr", PERSISTENT},
{"GmapKey", PERSISTENT},
{"HandsOnWheelMonitoring", PERSISTENT},
{"HideVEgoUi", PERSISTENT},
{"HkgSmoothStop", PERSISTENT},
{"HotspotOnBoot", PERSISTENT},
{"LastCarModel", PERSISTENT},
{"LastSpeedLimitSignTap", PERSISTENT},
{"LiveTorque", PERSISTENT},
{"LkasToggle", PERSISTENT},
{"MadsCruiseMain", PERSISTENT},
{"MadsIconToggle", PERSISTENT},
{"MapboxFullScreen", PERSISTENT},
{"MaxTimeOffroad", PERSISTENT},
{"OnroadScreenOff", PERSISTENT},
{"OnroadScreenOffBrightness", PERSISTENT},
{"OnroadScreenOffEvent", PERSISTENT},
{"OsmDbUpdatesCheck", PERSISTENT},
{"OsmLocal", PERSISTENT},
{"OsmLocalDb", PERSISTENT},
{"OsmLocationName", PERSISTENT},
{"OsmLocationTitle", PERSISTENT},
{"OsmLocationUrl", PERSISTENT},
{"OsmWayTest", PERSISTENT},
{"PathOffset", PERSISTENT},
{"QuietDrive", PERSISTENT},
{"RoadEdge", PERSISTENT},
{"ReverseAccChange", PERSISTENT},
{"ReverseDmCam", PERSISTENT},
{"ScreenRecorder", PERSISTENT},
{"ShowDebugUI", PERSISTENT},
{"SidebarTemperature", PERSISTENT},
{"SidebarTemperatureOptions", PERSISTENT},
{"SpeedLimitControl", PERSISTENT},
{"SpeedLimitPercOffset", PERSISTENT},
{"SpeedLimitValueOffset", PERSISTENT},
{"SpeedLimitOffsetType", PERSISTENT},
{"StandStillTimer", PERSISTENT},
{"StockLongToyota", PERSISTENT},
{"TorqueDeadzoneDeg", PERSISTENT},
{"TorqueFriction", PERSISTENT},
{"TorqueMaxLatAccel", PERSISTENT},
{"ToyotaTSS2Long", PERSISTENT},
{"TrueVEgoUi", PERSISTENT},
{"TurnSpeedControl", PERSISTENT},
{"TurnVisionControl", PERSISTENT},
{"VisionCurveLaneless", PERSISTENT},
{"VwAccType", PERSISTENT},
{"Offroad_SupersededUpdate", PERSISTENT},
};
} // namespace
+1 -1
View File
@@ -1 +1 @@
#define COMMA_VERSION "0.9.7"
#define COMMA_VERSION "0.9.7.0"
+77
View File
@@ -0,0 +1,77 @@
# How Tos
This page is a repository of useful how-tos as a supplement for additional information.
Table of Contents
=======================
* [Radar Tracks](#Radar-Tracks)
* [Enable Radar Tracks](#-Enable-Radar-Tracks)
* [Enable Mapbox Navigation](#-Enable-Mapbox-Navigation)
---
<details><summary><h3>📡 Radar Tracks</h3></summary>
Radar tracks can now be enabled manually on applicable cars through SSH thanks to [@greghogan](https://github.com/greghogan) and [@pd0wm](https://github.com/pd0wm).
Some Hyundai radars can be reconfigured to output (debug) radar points on bus 1.
Reconfiguration is done over UDS by reading/writing to 0x0142 using the Read/Write Data By Identifier
endpoints (0x22 & 0x2E). This script checks your radar firmware version against a list of known
firmware versions. If you want to try on a new radar, make sure to note the default config value
in case it is different from the other radars and you need to revert the changes.
After changing the config the car should not show any faults when openpilot is not running.
These config changes are persistent across car reboots. You need to run this script again
to go back to the default values.
**USE AT YOUR OWN RISK!** Stock system safety features, like AEB and FCW, might be affected by these changes.
**How radar points can be used along with vision:**
* Current OP long policy is identify with vision first, if vision sees a vehicle match it to a radar point. If vision sees nothing you get a false negative and no lead car detection. (Source: [Hubblesphere#7894 from comma.ai community Discord](https://discord.com/channels/469524606043160576/872899198738104330/872913890793635872))
### 🚨 Enable Radar Tracks
***(EXPERIMENTAL, as of January 1st, 2022)***
***(Only applicable to some Hyundai, Kia, and Genesis cars, as of January 1st, 2022)***
*(Base on version 0.8.12 [`devel`](https://github.com/commaai/openpilot/tree/devel))*
**USE AT YOUR OWN RISK!** Stock system safety features, like AEB and FCW, might be affected by these changes.
1. Ensure the car is at the `OFF` ignition position.
2. Connect your compatible comma device (EON, C2, C3) to the car. comma device power should be ON.
3. Use a laptop or applicable device to connect to your comma device via SSH. (Tips: Instructions to SSH in [HERE](https://github.com/commaai/openpilot/wiki/SSH))
4. In the SSH terminal after successfully connected to your comma device, execute the following commands:
1. `pkill -f openpilot`
2. `python /data/openpilot/selfdrive/debug/hyundai_enable_radar_points.py`
3. Follow the instructions in the script:
* `Power on the vehicle keeping the engine off (press start button twice) then type OK to continue`.
* If successful, the following message should appear: `[DONE]. Restart your vehicle and ensure there are no faults`.
* If the script did not run successfully, reach out to the community in [Sunnyhaibin's Openpilot Discord Server](https://discord.gg/wRW3meAgtx) or `#hyundai-kia-genesis channel` on [commaai community Discord Server](https://discord.comma.ai) for assistance.
4. Reboot your comma device:
1. C3: `sudo reboot`
2. C2 or EON: `reboot`
5. Once your comma device is rebooted, start your car with engine on (with or without comma device connected). Ensure that there are no faults from the car. If there are faults, reach out to the community in [Sunnyhaibin's Openpilot Discord Server](https://discord.gg/wRW3meAgtx) or `#hyundai-kia-genesis channel` on [commaai community Discord Server](https://discord.comma.ai) for assistance.
6. Go for a quick drive and drive behind a lead car with varied follow distance. Then, come back and allow the drive to upload its `rlogs` in [comma Connect](https://connect.comma.ai).
7. With all `rlogs` uploaded, open the drive in Cabana from [comma Connect](https://connect.comma.ai). Load DBC -> `hyundai_kia_mando_front_radar.dbc`, then search `RADAR_TRACK_50x` (`x` could be anything), open any of them, and look at `LONG_DIST`.
8. If the radar tracks data is relevant with the lead car you drove behind, you are done! Your car now have radar tracks enabled.
</details>
<details><summary><h3>🗺 Enable Mapbox Navigation</h3></summary>
1) Create a free mapbox account. Account will ask for a credit card for verification. You will not be charged for the free tier.
2) On the Dashboard, you will see a section called Access Tokens. Click `Create a Token`. Name it whatever you like. Set the scopes to allow everything for both Public and Secret. Copy both of these keys. **YOU WON'T BE ABLE TO ACCESS THE SECRET KEY AFTER THIS WINDOW.**
3) Once rebooted, connect your C3 to a network with internet access and find the C3s IP address.
4) In a browser, navigate to that IP with **port 8082** (i.e 192.168.1.69:8082). You should be greeted with the Comma logo and a public key input field.
5) Paste your Public token (pk.xx), click enter, paste your Secret key (sk.xx), click enter. You can now search for places. This page will be available at your devicess IP address/port 8082 to search for destinations.
6) To set Home and Work addresses, search for a place, select Home/Work from the dropdown and click Navigate. For non-Home/Work destinations, select Recent Places.<br>*At this time, it is not possible to search directly on the C3.*
**TIPS:**
- If your C3 is showing a black screen that says “Map Loading”, performing a reboot via the UI should fix it.
- If your phone can create a Hotspot, you are able to connect the C3 to your phone hotspot and use your phone browser to search for places.
- In the Navigation panel on the C3, you can select Home, Work, and from a list of Recent Places you have navigated to without needing a browser (assuming the C3 is connected to the internet.)
**IMPORTANT NOTE:** Your C3 will require an active internet connection to download map data, generate driving directions, and ETA. Once map data and directions are downloaded, it *is* possible to use it offline, however nothing will update (such as new driving direction after a missed turn, updated ETA, map data further into your drive etc.)
***NAVIGATION NOTE:** At this time, mapbox does not support alphanumeric addresses (i.e W123N1234 Main St). There is currently no known workaround for this.*
</details>
+121
View File
@@ -0,0 +1,121 @@
# This document is still a WIP and I used ChatGPT to help me put things down in writing as there's a lot to cover. Feel free to help improve it.
## Introduction
Welcome to the ESCC (Enhanced Smart Cruise Control) IONIQ PHEV Guide. This document provides detailed instructions for connecting and configuring the ESCC Interceptor board with your Hyundai IONIQ Plug-in Hybrid Electric Vehicle (PHEV). Our goal is to simplify the wiring process, enhance vehicle functionality, and ensure a seamless integration with aftermarket components like the Panda device.
## Updated info
On july 28th this guide was updated to rework it's setup and now it uses the relay harness box instead of the custom ESCC board previously mentioned. This simplifies the setup significantly, adds a layer of security with the relay, and makes it even more accessible to use.
## Terminology and Abbreviations
- **ESCC**: Enhanced Smart Cruise Control
- **PANDA**: A universal car interface
- **C-CAN**: Chassis Controller Area Network
- **L-CAN**: Local Controller Area Network
- **IGPM**: Ignition Power Module
## Components
### Harness Female Connector
This connector originates from the car's harness and plugs directly into the radar's male connector.
![](attachment/a4ae5e59abc1483c766af0e9377441ce.png)
### Radar's Male Connector
Located on the radar, this is where the car's harness plugs in. The image shows the connector from the front, with securing guides facing upwards.
![](attachment/caab30983673f68f7ae8f702c856ac44.png)
## Wire Configuration from the Radar Connector and Connections
### Viewing the Car's Harness from Different Angles
#### From the Back
![](attachment/967edbc70d3a2481639ec347fc0cf33d.png)
#### Upside Down
![](attachment/c058dd352308ab61cdb1e86ff47c6fe9.png)
#### Tracing Cables and Pins
![](attachment/SCR-20240729-kdhf.jpeg)
### Detailed Connection List
```
IONIQ 2203663 Molex 5018762640 IONIQ 2203663
Car Harness (Female) Car Radar (Male)
+-----+-----+ +-----+-----+ +-----+-----+
| 18 | 9 | | 2 | 1 | | 10 | 1 |
| 17 | 8 | | 4 | 3 | | 11 | 2 |
| 16 | 7 | | 6 | 5 | | 12 | 3 |
| 15 | 6 | | 8 | 7 | | 13 | 4 |
| 14 | 5 | NOTCH | 10 | 9 | | 14 | 5 | NOTCH
| 13 | 4 | | 12 | 11 | | 15 | 6 |
| 12 | 3 | | 14 | 13 | NOTCH | 16 | 7 |
| 11 | 2 | | 16 | 15 | | 17 | 8 |
| 10 | 1 | | 18 | 17 | | 18 | 9 |
+-----+-----+ | 20 | 19 | +-----+-----+
| 22 | 21 |
| 24 | 23 |
| 26 | 25 |
+-----+-----+
Connections:
Molex Pin 3 (120 Ohm) <--> Molex Pin 5 (120 Ohm)
Harness Pin 1 (12V) <--> Molex Pin 12 (12V)
Harness Pin 4 (GND) <--> Molex Pin 1 (GND)
Harness Pin 10 (IGN) <--> Molex Pin 2 (IGN)
Harness Pin 8 (C-CAN H) <--> Molex Pin 4 (C-CAN H)
Harness Pin 7 (C-CAN L) <--> Molex Pin 6 (C-CAN L)
Harness Pin 18 (L-CAN H) <--> Molex Pin 8 (L-CAN H)
Harness Pin 9 (L-CAN L) <--> Molex Pin 10 (L-CAN L)
Molex Pin 20 (L-CAN L) <--> Radar Pin 9 (L-CAN L)
Molex Pin 18 (L-CAN H) <--> Radar Pin 18 (L-CAN H)
Molex Pin 24 (C-CAN L) <--> Radar Pin 7 (C-CAN L)
Molex Pin 22 (C-CAN H) <--> Radar Pin 8 (C-CAN H)
Molex Pin 16 (IGN) <--> Radar Pin 10 (IGN)
Molex Pin 14 (12V) <--> Radar Pin 1 (12V)
Molex Pin 26 (GND) <--> Radar Pin 4 (GND)
```
#### Molex 5018762640 Pinout:
- Pin 1: GND
- Pin 2: IGN
- Pin 3: internal 120 Ohm Resistor, simply bridge to Pin 5
- Pin 4: C-CAN HIGH
- Pin 5: internal 120 Ohm Resistor, simply bridge to Pin 3
- Pin 6: C-CAN LOW
- Pin 8: L-CAN HIGH (***OPTIONAL, IF EQUIPPED***)
- Pin 10: L-CAN LOW (***OPTIONAL, IF EQUIPPED***)
- Pin 12: 12v
- Pin 14: 12v
- Pin 16: IGN
- Pin 18: L-CAN HIGH (***OPTIONAL, IF EQUIPPED***)
- Pin 20: L-CAN LOW (***OPTIONAL, IF EQUIPPED***)
- Pin 22: C-CAN HIGH
- Pin 24: C-CAN LOW
- Pin 26: GND
#### IONIQ 2203663 (Car Harness, Female):
- Pin 1: 12v -> Molex Pin 12
- Pin 4: GND -> Molex Pin 1
- Pin 7: C-CAN LOW -> Molex Pin 6
- Pin 8: C-CAN HIGH -> Molex Pin 4
- Pin 9: L-CAN LOW -> Molex Pin 10
- Pin 10: IGPM (IGN) -> Molex Pin 2
- Pin 18: L-CAN HIGH -> Molex Pin 8
#### IONIQ 2203663 (Car Radar, Male):
- Molex Pin: 14 -> Pin 1: 12v
- Molex Pin: 26 -> Pin 4: GND
- Molex Pin: 24 -> Pin 7: C-CAN LOW
- Molex Pin: 22 -> Pin 8: C-CAN HIGH
- Molex Pin: 20 -> Pin 9: L-CAN LOW
- Molex Pin: 16 -> Pin 10: IGN
- Molex Pin: 18 -> Pin 18: L-CAN HIGH
## Disclaimer
Remember, this guide is for educational purposes, and modifications to your vehicle are performed at your own risk. Always ensure safety and compliance with local automotive regulations.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ae5c756ffbb73dbb776bb3013518f1c2d32acc947d8b03268ac95cd6d7f984da
size 6320758
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e9c4c47c8ee73472d905c52bc550ecd8f84f265d7572382860508e5ced136909
size 6468919
Binary file not shown.

After

Width:  |  Height:  |  Size: 438 KiB

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c5e4205335277097adb51267e32208d573323ecb29181a4099a234bd2f6b6570
size 6464093
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b1d435f54b1660be3c9fe6723c222c2c143ca002eb62836fb1d394a786a8d84e
size 174497
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b8be531950fe99a68535161117f282fa9bca4f7e43a6d4d3b37e2b219cb9b04f
size 7022315
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0213364ddc16ba861cb6edcb871d0bd3b77f3b00afcbacc239c486bbb9e06113
size 4884215
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0203b94693c9066ab28a330b4b4832a44c7529765ff17d572e7dbc2879aedc94
size 326545
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3d8da4a1cdd1f67f461d20b779924e64d6c323e5ea940df14614a4937ad8fe4a
size 6048299
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:39f84aa3d3a6593296c4dc810607384021180e126bab6354fe7abcbb49c8728d
size 8109835
Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

+1 -1
Submodule opendbc updated: 0ac21652f2...ecffe0cc98
+1 -1
Submodule panda updated: 0c7d5f11d7...6683e77bcc
+3
View File
@@ -124,6 +124,9 @@ selfdrive/debug/uiview.py
selfdrive/debug/hyundai_enable_radar_points.py
selfdrive/debug/vw_mqb_config.py
selfdrive/gpxd/gpx_uploader.py
selfdrive/gpxd/gpxd.py
common/SConscript
common/version.h
Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

+7 -2
View File
@@ -2,7 +2,7 @@ from opendbc.can.packer import CANPacker
from openpilot.common.realtime import DT_CTRL
from openpilot.selfdrive.car import apply_meas_steer_torque_limits
from openpilot.selfdrive.car.chrysler import chryslercan
from openpilot.selfdrive.car.chrysler.values import RAM_CARS, CarControllerParams, ChryslerFlags
from openpilot.selfdrive.car.chrysler.values import RAM_CARS, RAM_DT, CarControllerParams, ChryslerFlags
class CarController:
@@ -50,7 +50,12 @@ class CarController:
# TODO: can we make this more sane? why is it different for all the cars?
lkas_control_bit = self.lkas_control_bit_prev
if CS.out.vEgo > self.CP.minSteerSpeed:
if self.CP.carFingerprint in RAM_DT:
if self.CP.minEnableSpeed <= CS.out.vEgo <= self.CP.minEnableSpeed + 0.5:
lkas_control_bit = True
if (self.CP.minEnableSpeed >= 14.5) and (CS.out.gearShifter != 2):
lkas_control_bit = False
elif CS.out.vEgo > self.CP.minSteerSpeed:
lkas_control_bit = True
elif self.CP.flags & ChryslerFlags.HIGHER_MIN_STEERING_SPEED:
if CS.out.vEgo < (self.CP.minSteerSpeed - 3.0):
+1
View File
@@ -35,6 +35,7 @@ class CarState(CarStateBase):
# brake pedal
ret.brake = 0
ret.brakePressed = cp.vl["ESP_1"]['Brake_Pedal_State'] == 1 # Physical brake pedal switch
ret.brakeLightsDEPRECATED = bool(cp.vl["ESP_1"]["BRAKE_PRESSED_ACC"])
# gas pedal
ret.gas = cp.vl["ECM_5"]["Accelerator_Position"]
+11 -5
View File
@@ -10,12 +10,12 @@ class CarInterface(CarInterfaceBase):
@staticmethod
def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs):
ret.carName = "chrysler"
ret.dashcamOnly = candidate in RAM_HD
# radar parsing needs some work, see https://github.com/commaai/openpilot/issues/26842
ret.radarUnavailable = True # DBC[candidate]['radar'] is None
ret.steerActuatorDelay = 0.1
ret.steerLimitTimer = 0.4
ret.customStockLongAvailable = True
# safety config
ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.chrysler)]
@@ -80,10 +80,16 @@ class CarInterface(CarInterfaceBase):
events = self.create_common_events(ret, extra_gears=[car.CarState.GearShifter.low])
# Low speed steer alert hysteresis logic
if self.CP.minSteerSpeed > 0. and ret.vEgo < (self.CP.minSteerSpeed + 0.5):
self.low_speed_alert = True
elif ret.vEgo > (self.CP.minSteerSpeed + 1.):
self.low_speed_alert = False
if self.CP.carFingerprint in RAM_DT:
if self.CS.out.vEgo >= self.CP.minEnableSpeed:
self.low_speed_alert = False
if (self.CP.minEnableSpeed >= 14.5) and (self.CS.out.gearShifter != car.CarState.GearShifter.drive):
self.low_speed_alert = True
else:
if self.CP.minSteerSpeed > 0. and ret.vEgo < (self.CP.minSteerSpeed + 0.5):
self.low_speed_alert = True
elif ret.vEgo > (self.CP.minSteerSpeed + 1.):
self.low_speed_alert = False
if self.low_speed_alert:
events.add(car.CarEvent.EventName.belowSteerSpeed)
+1 -1
View File
@@ -109,7 +109,7 @@ class CarControllerParams:
elif CP.carFingerprint in RAM_DT:
self.STEER_DELTA_UP = 6
self.STEER_DELTA_DOWN = 6
self.STEER_MAX = 261 # EPS allows more, up to 350?
self.STEER_MAX = 350 # EPS allows more, up to 350?
else:
self.STEER_DELTA_UP = 3
self.STEER_DELTA_DOWN = 3
+1
View File
@@ -32,6 +32,7 @@ class CarState(CarStateBase):
self.prev_cruise_buttons = self.cruise_buttons
self.cruise_buttons = pt_cp.vl["ASCMSteeringButton"]["ACCButtons"]
self.buttons_counter = pt_cp.vl["ASCMSteeringButton"]["RollingCounter"]
self.gap_dist_button = pt_cp.vl["ASCMSteeringButton"]["DistanceButton"]
self.pscm_status = copy.copy(pt_cp.vl["PSCMStatus"])
# This is to avoid a fault where you engage while still moving backwards after shifting to D.
# An Equinox has been seen with an unsupported status (3), so only check if either wheel is in reverse (2)
+26 -9
View File
@@ -8,7 +8,7 @@ from opendbc.can.parser import CANParser
from openpilot.selfdrive.car.honda.hondacan import get_cruise_speed_conversion, get_pt_bus
from openpilot.selfdrive.car.honda.values import CAR, DBC, STEER_THRESHOLD, HONDA_BOSCH, \
HONDA_NIDEC_ALT_SCM_MESSAGES, HONDA_BOSCH_RADARLESS, \
HondaFlags
HondaFlags, SERIAL_STEERING
from openpilot.selfdrive.car.interfaces import CarStateBase
TransmissionType = car.CarParams.TransmissionType
@@ -28,7 +28,7 @@ def get_can_messages(CP, gearbox_msg):
("STEER_MOTOR_TORQUE", 0), # TODO: not on every car
]
if CP.carFingerprint == CAR.ODYSSEY_CHN:
if CP.carFingerprint in (SERIAL_STEERING | {CAR.ODYSSEY_CHN, }):
messages += [
("SCM_FEEDBACK", 25),
("SCM_BUTTONS", 50),
@@ -47,7 +47,7 @@ def get_can_messages(CP, gearbox_msg):
if CP.flags & HondaFlags.BOSCH_ALT_BRAKE:
messages.append(("BRAKE_MODULE", 50))
if CP.carFingerprint in (HONDA_BOSCH | {CAR.CIVIC, CAR.ODYSSEY, CAR.ODYSSEY_CHN}):
if CP.carFingerprint in (HONDA_BOSCH | {CAR.CIVIC, CAR.ODYSSEY, CAR.ODYSSEY_CHN, CAR.CLARITY}):
messages.append(("EPB_STATUS", 50))
if CP.carFingerprint in HONDA_BOSCH:
@@ -58,7 +58,7 @@ def get_can_messages(CP, gearbox_msg):
("ACC_CONTROL", 50),
]
else: # Nidec signals
if CP.carFingerprint == CAR.ODYSSEY_CHN:
if CP.carFingerprint in (SERIAL_STEERING | {CAR.ODYSSEY_CHN, }):
messages.append(("CRUISE_PARAMS", 10))
else:
messages.append(("CRUISE_PARAMS", 50))
@@ -78,6 +78,8 @@ def get_can_messages(CP, gearbox_msg):
if CP.carFingerprint in HONDA_BOSCH_RADARLESS:
messages.append(("CRUISE_FAULT_STATUS", 50))
elif CP.carFingerprint == CAR.CLARITY:
messages.append(("BRAKE_ERROR", 100)),
elif CP.openpilotLongitudinalControl:
messages.append(("STANDSTILL", 50))
@@ -147,6 +149,8 @@ class CarState(CarStateBase):
if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS:
ret.accFaulted = bool(cp.vl["CRUISE_FAULT_STATUS"]["CRUISE_FAULT"])
elif self.CP.carFingerprint == CAR.CLARITY:
ret.accFaulted = bool(cp.vl["BRAKE_ERROR"]["BRAKE_ERROR_1"] or cp.vl["BRAKE_ERROR"]["BRAKE_ERROR_2"])
else:
# On some cars, these two signals are always 1, this flag is masking a bug in release
# FIXME: find and set the ACC faulted signals on more platforms
@@ -185,7 +189,7 @@ class CarState(CarStateBase):
ret.brakeHoldActive = cp.vl["VSA_STATUS"]["BRAKE_HOLD_ACTIVE"] == 1
# TODO: set for all cars
if self.CP.carFingerprint in (HONDA_BOSCH | {CAR.CIVIC, CAR.ODYSSEY, CAR.ODYSSEY_CHN}):
if self.CP.carFingerprint in (HONDA_BOSCH | {CAR.CIVIC, CAR.ODYSSEY, CAR.ODYSSEY_CHN, CAR.CLARITY}):
ret.parkingBrake = cp.vl["EPB_STATUS"]["EPB_STATE"] != 0
gear = int(cp.vl[self.gearbox_msg]["GEAR_SHIFTER"])
@@ -241,12 +245,22 @@ class CarState(CarStateBase):
if ret.brake > 0.1:
ret.brakePressed = True
if self.CP.carFingerprint in (CAR.CIVIC, CAR.ODYSSEY, CAR.ODYSSEY_CHN, CAR.CRV_5G, CAR.ACCORD, CAR.ACCORDH, CAR.CIVIC_BOSCH,
CAR.CIVIC_BOSCH_DIESEL, CAR.CRV_HYBRID, CAR.INSIGHT, CAR.ACURA_RDX_3G, CAR.HONDA_E):
ret.brakeLightsDEPRECATED = bool(cp.vl["ACC_CONTROL"]['BRAKE_LIGHTS'] != 0 or ret.brake > 0.4) if not self.CP.openpilotLongitudinalControl else \
bool(ret.brake > 0.4)
elif self.CP.carFingerprint in HONDA_BOSCH and self.CP.carFingerprint not in (CAR.CIVIC, CAR.ODYSSEY, CAR.ODYSSEY_CHN, CAR.CRV_5G, CAR.ACCORD, CAR.ACCORDH, CAR.CIVIC_BOSCH,
CAR.CIVIC_BOSCH_DIESEL, CAR.CRV_HYBRID, CAR.INSIGHT, CAR.ACURA_RDX_3G, CAR.HONDA_E) and self.CP.carFingerprint not in HONDA_BOSCH_RADARLESS:
ret.brakeLightsDEPRECATED = bool(cp.vl["ACC_CONTROL"]['BRAKE_LIGHTS'] != 0 or ret.brake > 0.4) if not self.CP.openpilotLongitudinalControl else \
bool(ret.brake > 0.4)
if self.CP.carFingerprint in HONDA_BOSCH:
# TODO: find the radarless AEB_STATUS bit and make sure ACCEL_COMMAND is correct to enable AEB alerts
if self.CP.carFingerprint not in HONDA_BOSCH_RADARLESS:
ret.stockAeb = (not self.CP.openpilotLongitudinalControl) and bool(cp.vl["ACC_CONTROL"]["AEB_STATUS"] and cp.vl["ACC_CONTROL"]["ACCEL_COMMAND"] < -1e-5)
else:
ret.stockAeb = bool(cp_cam.vl["BRAKE_COMMAND"]["AEB_REQ_1"] and cp_cam.vl["BRAKE_COMMAND"]["COMPUTER_BRAKE"] > 1e-5)
aeb_sig = "COMPUTER_BRAKE_ALT" if self.CP.carFingerprint == CAR.CLARITY else "COMPUTER_BRAKE"
ret.stockAeb = bool(cp_cam.vl["BRAKE_COMMAND"]["AEB_REQ_1"] and cp_cam.vl["BRAKE_COMMAND"][aeb_sig] > 1e-5)
self.acc_hud = False
self.lkas_hud = False
@@ -271,9 +285,12 @@ class CarState(CarStateBase):
@staticmethod
def get_cam_can_parser(CP):
messages = [
("STEERING_CONTROL", 100),
]
messages = []
if CP.carFingerprint not in SERIAL_STEERING:
messages = [
("STEERING_CONTROL", 100),
]
if CP.carFingerprint in HONDA_BOSCH_RADARLESS:
messages.append(("LKAS_HUD", 10))
+39
View File
@@ -233,6 +233,20 @@ FW_VERSIONS = {
b'39990-TWB-H120\x00\x00',
],
},
CAR.ACCORD_NIDEC_4CYL: {
(Ecu.vsa, 0x18DA28F1, None): [
b'57114-T2F-X840\x00\x00',
],
(Ecu.fwdRadar, 0x18DAB0F1, None): [
b'36161-T2F-A140\x00\x00',
],
(Ecu.combinationMeter, 0x18DA60F1, None): [
b'78109-T2F-L110\x00\x00',
],
(Ecu.srs, 0x18DA53F1, None): [
b'77959-T2F-A030\x00\x00',
],
},
CAR.CIVIC: {
(Ecu.programmedFuelInjection, 0x18da10f1, None): [
b'37805-5AA-A640\x00\x00',
@@ -556,6 +570,31 @@ FW_VERSIONS = {
b'38897-TBA-A020\x00\x00',
],
},
CAR.CLARITY: {
(Ecu.shiftByWire, 0x18da0bf1, None): [
b'54008-TRW-A910\x00\x00',
],
(Ecu.vsa, 0x18da28f1, None): [
b'57114-TRW-A010\x00\x00',
b'57114-TRW-A020\x00\x00',
],
(Ecu.eps, 0x18da30f1, None): [
b'39990-TRW-A020\x00\x00',
b'39990-TRW,A020\x00\x00', # modified firmware
b'39990,TRW,A020\x00\x00', # extra modified firmware
],
(Ecu.srs, 0x18da53f1, None): [
b'77959-TRW-A210\x00\x00',
b'77959-TRW-A220\x00\x00',
],
(Ecu.gateway, 0x18daeff1, None): [
b'38897-TRW-A010\x00\x00',
],
(Ecu.combinationMeter, 0x18da60f1, None): [
b'78109-TRW-A020\x00\x00',
b'78109-TRW-A030\x00\x00',
],
},
CAR.CRV: {
(Ecu.vsa, 0x18da28f1, None): [
b'57114-T1W-A230\x00\x00',
+8 -2
View File
@@ -33,8 +33,6 @@ def create_brake_command(packer, apply_brake, pump_on, pcm_override, pcm_cancel_
pcm_fault_cmd = False
values = {
"COMPUTER_BRAKE": apply_brake,
"BRAKE_PUMP_REQUEST": pump_on,
"CRUISE_OVERRIDE": pcm_override,
"CRUISE_FAULT_CMD": pcm_fault_cmd,
"CRUISE_CANCEL_CMD": pcm_cancel_cmd,
@@ -47,6 +45,14 @@ def create_brake_command(packer, apply_brake, pump_on, pcm_override, pcm_cancel_
"AEB_REQ_2": 0,
"AEB_STATUS": 0,
}
if car_fingerprint == CAR.CLARITY:
values["COMPUTER_BRAKE_ALT"] = apply_brake
values["BRAKE_PUMP_REQUEST_ALT"] = apply_brake > 0
else:
values["COMPUTER_BRAKE"] = apply_brake
values["BRAKE_PUMP_REQUEST"] = pump_on
bus = get_pt_bus(car_fingerprint)
return packer.make_can_msg("BRAKE_COMMAND", bus, values)
+36 -1
View File
@@ -45,6 +45,7 @@ class CarInterface(CarInterfaceBase):
ret.experimentalLongitudinalAvailable = True
ret.openpilotLongitudinalControl = experimental_long
ret.pcmCruise = not ret.openpilotLongitudinalControl
ret.customStockLongAvailable = True
else:
ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.hondaNidec)]
ret.enableGasInterceptor = 0x201 in fingerprint[0]
@@ -224,6 +225,20 @@ class CarInterface(CarInterfaceBase):
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2], [0.06]]
ret.tireStiffnessFactor = 0.677
elif candidate == CAR.ACCORD_NIDEC_4CYL:
ret.mass = 3279. * CV.LB_TO_KG
ret.wheelbase = 2.75
ret.centerToFront = ret.wheelbase * 0.39
ret.steerRatio = 13.66 # 13.37 is spec
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 239], [0, 239]]
ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.,20], [0.,20]]
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.4,0.3], [0,0]]
tire_stiffness_factor = 0.8467
ret.longitudinalTuning.kpBP = [0., 5., 35.]
ret.longitudinalTuning.kpV = [2.4, 1.6, 0.8]
ret.longitudinalTuning.kiBP = [0., 35.]
ret.longitudinalTuning.kiV = [0.2, 0.16]
elif candidate in (CAR.ODYSSEY, CAR.ODYSSEY_CHN):
ret.mass = 1900.
ret.wheelbase = 3.00
@@ -272,6 +287,26 @@ class CarInterface(CarInterfaceBase):
ret.tireStiffnessFactor = 0.82
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.18]] # TODO: can probably use some tuning
elif candidate == CAR.CLARITY:
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_HONDA_CLARITY
ret.mass = 4052. * CV.LB_TO_KG
ret.wheelbase = 2.75
ret.centerToFront = ret.wheelbase * 0.4
ret.steerRatio = 16.50 # 12.72 is end-to-end spec
if eps_modified:
for fw in car_fw:
if fw.ecu == "eps" and b"-" not in fw.fwVersion and b"," in fw.fwVersion:
ret.lateralTuning.pid.kf = 0.00004
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 0xA00, 0x3C00], [0, 2560, 3840]]
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.1575], [0.05175]]
elif fw.ecu == "eps" and b"-" in fw.fwVersion and b"," in fw.fwVersion:
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 0xA00, 0x2800], [0, 2560, 3840]]
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.3], [0.1]]
else:
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 2560], [0, 2560]]
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]]
tire_stiffness_factor = 1.
else:
raise ValueError(f"unsupported car {candidate}")
@@ -296,7 +331,7 @@ class CarInterface(CarInterfaceBase):
# min speed to enable ACC. if car can do stop and go, then set enabling speed
# to a negative value, so it won't matter. Otherwise, add 0.5 mph margin to not
# conflict with PCM acc
ret.autoResumeSng = candidate in (HONDA_BOSCH | {CAR.CIVIC}) or ret.enableGasInterceptor
ret.autoResumeSng = candidate in (HONDA_BOSCH | {CAR.CIVIC, CAR.CLARITY}) or ret.enableGasInterceptor
ret.minEnableSpeed = -1. if ret.autoResumeSng else 25.5 * CV.MPH_TO_MS
ret.steerActuatorDelay = 0.1
+18 -1
View File
@@ -75,6 +75,7 @@ VISUAL_HUD = {
class CAR(StrEnum):
ACCORD = "HONDA ACCORD 2018"
ACCORDH = "HONDA ACCORD HYBRID 2018"
ACCORD_NIDEC_4CYL = "HONDA ACCORD 4CYL 9TH GEN"
CIVIC = "HONDA CIVIC 2016"
CIVIC_BOSCH = "HONDA CIVIC (BOSCH) 2019"
CIVIC_BOSCH_DIESEL = "HONDA CIVIC SEDAN 1.6 DIESEL 2019"
@@ -96,12 +97,21 @@ class CAR(StrEnum):
RIDGELINE = "HONDA RIDGELINE 2017"
INSIGHT = "HONDA INSIGHT 2019"
HONDA_E = "HONDA E 2020"
CLARITY = "HONDA CLARITY 2018"
class Footnote(Enum):
CIVIC_DIESEL = CarFootnote(
"2019 Honda Civic 1.6L Diesel Sedan does not have ALC below 12mph.",
Column.FSR_STEERING)
ACCORD_NIDEC = CarFootnote(
"openpilot operates above 25mph for 9th Generation Accord 4CYL, 6CYL and Hybrid which don't have Low-Speed Follow.",
Column.FSR_LONGITUDINAL)
SERIAL_STEERING = CarFootnote(
"9th Generation model-years have ALC data over serial lines and require third party hardware to " +
"interface with openpilot. For more information, " +
"see <a href=\"https://github.com/mlocoteta/serialSteeringHardware\" target=\"_blank\">mlocoteta's GitHub</a>.",
Column.HARDWARE)
@dataclass
@@ -152,6 +162,8 @@ CAR_INFO: dict[str, HondaCarInfo | list[HondaCarInfo] | None] = {
CAR.RIDGELINE: HondaCarInfo("Honda Ridgeline 2017-24", min_steer_speed=12. * CV.MPH_TO_MS),
CAR.INSIGHT: HondaCarInfo("Honda Insight 2019-22", "All", min_steer_speed=3. * CV.MPH_TO_MS),
CAR.HONDA_E: HondaCarInfo("Honda e 2020", "All", min_steer_speed=3. * CV.MPH_TO_MS),
CAR.CLARITY: HondaCarInfo("Honda Clarity 2018-22"),
CAR.ACCORD_NIDEC_4CYL: HondaCarInfo("Honda Accord 4-Cylinder 2016-17", footnotes=[Footnote.ACCORD_NIDEC, Footnote.SERIAL_STEERING], min_steer_speed=3. * CV.MPH_TO_MS),
}
HONDA_VERSION_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \
@@ -218,6 +230,7 @@ FW_QUERY_CONFIG = FwQueryConfig(
DBC = {
CAR.ACCORD_NIDEC_4CYL: dbc_dict('honda_accord_touring_2016_can_generated', 'acura_ilx_2016_nidec'),
CAR.ACCORD: dbc_dict('honda_accord_2018_can_generated', None),
CAR.ACCORDH: dbc_dict('honda_accord_2018_can_generated', None),
CAR.ACURA_ILX: dbc_dict('acura_ilx_2016_can_generated', 'acura_ilx_2016_nidec'),
@@ -241,17 +254,21 @@ DBC = {
CAR.INSIGHT: dbc_dict('honda_insight_ex_2019_can_generated', None),
CAR.HONDA_E: dbc_dict('acura_rdx_2020_can_generated', None),
CAR.CIVIC_2022: dbc_dict('honda_civic_ex_2022_can_generated', None),
CAR.CLARITY: dbc_dict('honda_clarity_hybrid_2018_can_generated', 'acura_ilx_2016_nidec'),
}
STEER_THRESHOLD = {
# default is 1200, overrides go here
CAR.ACCORD_NIDEC_4CYL: 30,
CAR.ACURA_RDX: 400,
CAR.CRV_EU: 400,
}
HONDA_NIDEC_ALT_PCM_ACCEL = {CAR.ODYSSEY}
HONDA_NIDEC_ALT_SCM_MESSAGES = {CAR.ACURA_ILX, CAR.ACURA_RDX, CAR.CRV, CAR.CRV_EU, CAR.FIT, CAR.FREED, CAR.HRV, CAR.ODYSSEY_CHN,
CAR.PILOT, CAR.RIDGELINE}
CAR.PILOT, CAR.RIDGELINE, CAR.ACCORD_NIDEC_4CYL}
HONDA_BOSCH = {CAR.ACCORD, CAR.ACCORDH, CAR.CIVIC_BOSCH, CAR.CIVIC_BOSCH_DIESEL, CAR.CRV_5G,
CAR.CRV_HYBRID, CAR.INSIGHT, CAR.ACURA_RDX_3G, CAR.HONDA_E, CAR.CIVIC_2022, CAR.HRV_3G}
HONDA_BOSCH_RADARLESS = {CAR.CIVIC_2022, CAR.HRV_3G}
SERIAL_STEERING = {CAR.ACCORD_NIDEC_4CYL, }
+7 -5
View File
@@ -6,7 +6,7 @@ from opendbc.can.packer import CANPacker
from openpilot.selfdrive.car import apply_driver_steer_torque_limits, common_fault_avoidance
from openpilot.selfdrive.car.hyundai import hyundaicanfd, hyundaican
from openpilot.selfdrive.car.hyundai.hyundaicanfd import CanBus
from openpilot.selfdrive.car.hyundai.values import HyundaiFlags, Buttons, CarControllerParams, CANFD_CAR, CAR
from openpilot.selfdrive.car.hyundai.values import HyundaiFlags, HyundaiFlagsSP, Buttons, CarControllerParams, CANFD_CAR, CAR
VisualAlert = car.CarControl.HUDControl.VisualAlert
LongCtrlState = car.CarControl.Actuators.LongControlState
@@ -86,12 +86,14 @@ class CarController:
sys_warning, sys_state, left_lane_warning, right_lane_warning = process_hud_alert(CC.enabled, self.car_fingerprint,
hud_control)
escc = self.CP.spFlags & HyundaiFlagsSP.SP_ENHANCED_SCC.value
can_sends = []
# *** common hyundai stuff ***
# tester present - w/ no response (keeps relevant ECU disabled)
if self.frame % 100 == 0 and not (self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC.value) and self.CP.openpilotLongitudinalControl:
if self.frame % 100 == 0 and not ((self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC.value) or escc) and self.CP.openpilotLongitudinalControl:
# for longitudinal control, either radar or ADAS driving ECU
addr, bus = 0x7d0, 0
if self.CP.flags & HyundaiFlags.CANFD_HDA2.value:
@@ -148,7 +150,7 @@ class CarController:
use_fca = self.CP.flags & HyundaiFlags.USE_FCA.value
can_sends.extend(hyundaican.create_acc_commands(self.packer, CC.enabled, accel, jerk, int(self.frame / 2),
hud_control.leadVisible, set_speed_in_units, stopping,
CC.cruiseControl.override, use_fca))
CC.cruiseControl.override, use_fca, CS, escc))
# 20 Hz LFA MFA message
if self.frame % 5 == 0 and self.CP.flags & HyundaiFlags.SEND_LFA.value:
@@ -156,10 +158,10 @@ class CarController:
# 5 Hz ACC options
if self.frame % 20 == 0 and self.CP.openpilotLongitudinalControl:
can_sends.extend(hyundaican.create_acc_opt(self.packer))
can_sends.extend(hyundaican.create_acc_opt(self.packer, escc))
# 2 Hz front radar options
if self.frame % 50 == 0 and self.CP.openpilotLongitudinalControl:
if self.frame % 50 == 0 and self.CP.openpilotLongitudinalControl and not escc:
can_sends.append(hyundaican.create_frt_radar_opt(self.packer))
new_actuators = actuators.copy()
+51 -2
View File
@@ -7,7 +7,7 @@ from openpilot.common.conversions import Conversions as CV
from opendbc.can.parser import CANParser
from opendbc.can.can_define import CANDefine
from openpilot.selfdrive.car.hyundai.hyundaicanfd import CanBus
from openpilot.selfdrive.car.hyundai.values import HyundaiFlags, CAR, DBC, CAN_GEARS, CAMERA_SCC_CAR, \
from openpilot.selfdrive.car.hyundai.values import HyundaiFlags, HyundaiFlagsSP, CAR, DBC, CAN_GEARS, CAMERA_SCC_CAR, \
CANFD_CAR, Buttons, CarControllerParams
from openpilot.selfdrive.car.interfaces import CarStateBase
@@ -52,6 +52,12 @@ class CarState(CarStateBase):
self.params = CarControllerParams(CP)
self.escc_aeb_warning = 0
self.escc_aeb_dec_cmd_act = 0
self.escc_cmd_act = 0
self.escc_aeb_dec_cmd = 0
self._speed_limit_clu = 0
def update(self, cp, cp_cam):
if self.CP.carFingerprint in CANFD_CAR:
return self.update_canfd(cp, cp_cam)
@@ -118,6 +124,7 @@ class CarState(CarStateBase):
ret.brakePressed = cp.vl["TCS13"]["DriverOverride"] == 2 # 2 includes regen braking by user on HEV/EV
ret.brakeHoldActive = cp.vl["TCS15"]["AVH_LAMP"] == 2 # 0 OFF, 1 ERROR, 2 ACTIVE, 3 READY
ret.parkingBrake = cp.vl["TCS13"]["PBRAKE_ACT"] == 1
ret.brakeLightsDEPRECATED = bool(cp.vl["TCS13"]["BrakeLight"])
ret.accFaulted = cp.vl["TCS13"]["ACCEnable"] != 0 # 0 ACC CONTROL ENABLED, 1-3 ACC CONTROL DISABLED
if self.CP.flags & (HyundaiFlags.HYBRID | HyundaiFlags.EV):
@@ -151,6 +158,20 @@ class CarState(CarStateBase):
aeb_braking = cp_cruise.vl[aeb_src]["CF_VSM_DecCmdAct"] != 0 or cp_cruise.vl[aeb_src][aeb_sig] != 0
ret.stockFcw = (aeb_warning or scc_warning) and not aeb_braking
ret.stockAeb = aeb_warning and aeb_braking
elif self.CP.spFlags & HyundaiFlagsSP.SP_ENHANCED_SCC:
aeb_src = "ESCC"
aeb_sig = "FCA_CmdAct" if self.CP.flags & HyundaiFlags.USE_FCA.value else "AEB_CmdAct"
aeb_warning_sig = "CF_VSM_Warn_FCA11" if self.CP.flags & HyundaiFlags.USE_FCA.value else "CF_VSM_Warn_SCC12"
aeb_braking_sig = "CF_VSM_DecCmdAct_FCA11" if self.CP.flags & HyundaiFlags.USE_FCA.value else "CF_VSM_DecCmdAct_SCC12"
aeb_braking_cmd = "CR_VSM_DecCmd_FCA11" if self.CP.flags & HyundaiFlags.USE_FCA.value else "CR_VSM_DecCmd_SCC12"
aeb_warning = cp.vl[aeb_src][aeb_warning_sig] != 0
aeb_braking = cp.vl[aeb_src][aeb_braking_sig] != 0 or cp.vl[aeb_src][aeb_sig] != 0
ret.stockFcw = aeb_warning and not aeb_braking
ret.stockAeb = aeb_warning and aeb_braking
self.escc_aeb_warning = cp.vl[aeb_src][aeb_warning_sig]
self.escc_aeb_dec_cmd_act = cp.vl[aeb_src][aeb_braking_sig]
self.escc_cmd_act = cp.vl[aeb_src][aeb_sig]
self.escc_aeb_dec_cmd = cp.vl[aeb_src][aeb_braking_cmd]
if self.CP.enableBsm:
ret.leftBlindspot = cp.vl["LCA11"]["CF_Lca_IndLeft"] != 0
@@ -164,6 +185,10 @@ class CarState(CarStateBase):
self.cruise_buttons.extend(cp.vl_all["CLU11"]["CF_Clu_CruiseSwState"])
self.main_buttons.extend(cp.vl_all["CLU11"]["CF_Clu_CruiseSwMain"])
if self.CP.spFlags & HyundaiFlagsSP.SP_NAV_MSG:
self._update_traffic_signals(self.CP, cp, cp_cam)
ret.cruiseState.speedLimit = self._calculate_speed_limit() * speed_conv
return ret
def update_canfd(self, cp, cp_cam):
@@ -179,7 +204,7 @@ class CarState(CarStateBase):
else:
ret.gasPressed = bool(cp.vl[self.accelerator_msg_canfd]["ACCELERATOR_PEDAL_PRESSED"])
ret.brakePressed = cp.vl["TCS"]["DriverBraking"] == 1
ret.brakePressed = ret.brakeLightsDEPRECATED = cp.vl["TCS"]["DriverBraking"] == 1
ret.doorOpen = cp.vl["DOORS_SEATBELTS"]["DRIVER_DOOR"] == 1
ret.seatbeltUnlatched = cp.vl["DOORS_SEATBELTS"]["DRIVER_SEATBELT"] == 0
@@ -246,8 +271,20 @@ class CarState(CarStateBase):
self.hda2_lfa_block_msg = copy.copy(cp_cam.vl["CAM_0x362"] if self.CP.flags & HyundaiFlags.CANFD_HDA2_ALT_STEERING
else cp_cam.vl["CAM_0x2a4"])
if self.CP.spFlags & HyundaiFlagsSP.SP_NAV_MSG:
self._update_traffic_signals(self.CP, cp, cp_cam)
ret.cruiseState.speedLimit = self._calculate_speed_limit() * speed_factor
return ret
def _update_traffic_signals(self, CP, cp, cp_cam):
speed_limit_clu_canfd = cp if self.CP.flags & HyundaiFlags.CANFD_HDA2 else cp_cam
self._speed_limit_clu = speed_limit_clu_canfd.vl["CLUSTER_SPEED_LIMIT"]["SPEED_LIMIT_1"] if CP.carFingerprint in CANFD_CAR else \
cp.vl["Navi_HU"]["SpeedLim_Nav_Clu"]
def _calculate_speed_limit(self):
return self._speed_limit_clu if self._speed_limit_clu not in (0, 255) else 0
def get_can_parser(self, CP):
if CP.carFingerprint in CANFD_CAR:
return self.get_can_parser_canfd(CP)
@@ -295,6 +332,12 @@ class CarState(CarStateBase):
else:
messages.append(("LVR12", 100))
if CP.spFlags & HyundaiFlagsSP.SP_ENHANCED_SCC.value:
messages.append(("ESCC", 50))
if CP.spFlags & HyundaiFlagsSP.SP_NAV_MSG:
messages.append(("Navi_HU", 5))
return CANParser(DBC[CP.carFingerprint]["pt"], messages, 0)
@staticmethod
@@ -350,6 +393,9 @@ class CarState(CarStateBase):
("SCC_CONTROL", 50),
]
if CP.flags & HyundaiFlags.CANFD_HDA2 and CP.spFlags & HyundaiFlagsSP.SP_NAV_MSG:
messages.append(("CLUSTER_SPEED_LIMIT", 10))
return CANParser(DBC[CP.carFingerprint]["pt"], messages, CanBus(CP).ECAN)
@staticmethod
@@ -363,4 +409,7 @@ class CarState(CarStateBase):
("SCC_CONTROL", 50),
]
if not (CP.flags & HyundaiFlags.CANFD_HDA2) and CP.spFlags & HyundaiFlagsSP.SP_NAV_MSG:
messages.append(("CLUSTER_SPEED_LIMIT", 10))
return CANParser(DBC[CP.carFingerprint]["pt"], messages, CanBus(CP).CAM)
+106
View File
@@ -1707,4 +1707,110 @@ FW_VERSIONS = {
b'\xf1\x00US4_ RDR ----- 1.00 1.00 99110-CG000 ',
],
},
# Non SCC
CAR.GENESIS_G70_2021_NON_SCC: {
(Ecu.eps, 0x7d4, None): [
b'\xf1\x00IK MDPS R 1.00 1.08 57700-G9200 4I2CL108',
],
(Ecu.fwdRadar, 0x7d0, None): [
b'\xf1\x00IK__ SCC --CUP 1.00 1.02 96400-G9100 ',
],
(Ecu.fwdCamera, 0x7c4, None): [
b'\xf1\x00IK MFC MT USA LHD 1.00 1.01 95740-G9000 170920',
],
(Ecu.engine, 0x7e0, None): [
b'\xf1\x81606G2051\x00\x00\x00\x00\x00\x00\x00\x00',
],
},
CAR.KONA_NON_SCC: {
(Ecu.abs, 0x7d1, None): [
b'\xf1\x816V5RAJ00040.ELF\xf1\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.engine, 0x7e0, None): [
b'\xf1\x8161699051\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.eps, 0x7d4, None): [
b'\xf1\x00OS MDPS C 1.00 1.05 56310J9030\x00 4OSDC105',
],
(Ecu.fwdCamera, 0x7c4, None): [
b'\xf1\x00OS9 LKAS AT USA LHD 1.00 1.00 95740-J9200 g30',
],
(Ecu.transmission, 0x7e1, None): [
b'\xf1\x006T6J0_C2\x00\x006T6K1051\x00\x00TOS4N20NS2\x00\x00\x00\x00',
],
},
CAR.KIA_FORTE_2019_NON_SCC: {
(Ecu.eps, 0x7D4, None): [
b'\xf1\x00BD MDPS C 1.00 1.04 56310/M6000 4BDDC104',
],
(Ecu.fwdCamera, 0x7C4, None): [
b'\xf1\x00BD LKAS AT USA LHD 1.00 1.02 95740-M6000 J31',
],
(Ecu.engine, 0x7e0, None): [
b'\xf1\x81616B5051\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.abs, 0x7d1, None): [
b'\xf1\x816VFRAF00018.ELF\xf1\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.transmission, 0x7e1, None): [
b'\xf1\x87CXJQAM4966515JB0x\xa9\x98\x9b\x99fff\x98feg\x88\x88w\x88Ff\x8f\xff{\xff\xff\xff\xa8\xf6\xf1\x816V2C1051\x00\x00\xf1\x006V2B0_C2\x00\x006V2C1051\x00\x00CBD0N20NS8q\xc1&\xd2',
],
},
CAR.KIA_FORTE_2021_NON_SCC: {
(Ecu.eps, 0x7D4, None): [
b'\xf1\x00BD MDPS C 1.00 1.08 56310M6000\x00 4BDDC108',
],
(Ecu.fwdCamera, 0x7C4, None): [
b'\xf1\x00BD LKAS AT USA LHD 1.00 1.04 95740-M6000 J33',
],
(Ecu.engine, 0x7e0, None): [
b'\xf1\x81616B6051\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.abs, 0x7d1, None): [
b'\xf1\x816VFRAL00010.ELF\xf1\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.transmission, 0x7e1, None): [
b'\xf1\x87CXLQAM0906975JB0\x89\x88\xa6\x8aVfug\xba\x87\x94yffuxgfo\xff\x8b\xff\xff\xff\x91\x82\xf1\x816V2C1051\x00\x00\xf1\x006V2B0_C2\x00\x006V2C1051\x00\x00CBD0N20NS8q\xc1&\xd2',
],
},
CAR.KIA_SELTOS_2023_NON_SCC: {
(Ecu.abs, 0x7d1, None): [
b'\xf1\x00SP ESC \t 101"\t\x01 58910-Q5510',
b'\xf1\x00SP ESC \r 100"\x04\x01 58910-Q5510',
],
(Ecu.engine, 0x7e0, None): [
b'\xf1\x81616K0051\x00\x00\x00\x00\x00\x00\x00\x00',
b'\xf1\x81616G2051\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.eps, 0x7d4, None): [
b'\xf1\x00SP2 MDPS C 1.00 1.04 56310Q5240 4SPSC104',
b'\xf1\x00SP2 MDPS C 1.00 1.01 56300Q5920 ',
],
(Ecu.fwdCamera, 0x7c4, None): [
b'\xf1\x00SP2 MFC AT USA LHD 1.00 1.03 99210-Q5500 230208',
b'\xf1\x00SP2 MFC AT AUS RHD 1.00 1.02 99210-Q5500 220624',
],
(Ecu.transmission, 0x7e1, None): [
b'\xf1\x006V2B0_C2\x00\x006V2D5051\x00\x00CSP2N20NL0\x00\x00\x00\x00',
b'\xf1\x006V2B0_C2\x00\x006V2D4051\x00\x00CSP2N20KL1\x00\x00\x00\x00',
],
},
CAR.ELANTRA_2022_NON_SCC: {
(Ecu.eps, 0x7d4, None): [
b'\xf1\x8756310AA030\x00\xf1\x00CN7 MDPS C 1.00 1.06 56310AA030\x00 4CNDC106',
],
(Ecu.fwdCamera, 0x7c4, None): [
b'\xf1\x00CN7 MFC AT USA LHD 1.00 1.01 99210-AB000 210205',
],
(Ecu.abs, 0x7d1, None): [
b'\xf1\x8758910-AB500\xf1\x00CN ESC \t 100 \x06\x01 58910-AB500',
],
(Ecu.transmission, 0x7e1, None): [
b'\xf1\x87CXNQEM4091445JB3g\x98\x98\x89\x99\x87gv\x89wuwgwv\x89hD_\xffx\xff\xff\xff\x86\xeb\xf1\x89HT6VA640A1\xf1\x82CCN0N20NS5\x00\x00\x00\x00\x00\x00',
],
(Ecu.engine, 0x7e0, None): [
b'\xf1\x870\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf1\x82CNDWD0ANF3XCSG8A',
],
},
}
+18 -7
View File
@@ -126,7 +126,8 @@ def create_lfahda_mfc(packer, enabled, hda_set_speed=0):
}
return packer.make_can_msg("LFAHDA_MFC", 0, values)
def create_acc_commands(packer, enabled, accel, upper_jerk, idx, lead_visible, set_speed, stopping, long_override, use_fca):
def create_acc_commands(packer, enabled, accel, upper_jerk, idx, lead_visible, set_speed, stopping, long_override, use_fca,
CS, escc):
commands = []
scc11_values = {
@@ -148,6 +149,11 @@ def create_acc_commands(packer, enabled, accel, upper_jerk, idx, lead_visible, s
"aReqRaw": accel,
"aReqValue": accel, # stock ramps up and down respecting jerk limit until it reaches aReqRaw
"CR_VSM_Alive": idx % 0xF,
"AEB_CmdAct": CS.escc_cmd_act,
"CF_VSM_Warn": CS.escc_aeb_warning,
"CF_VSM_DecCmdAct": CS.escc_aeb_dec_cmd_act,
"CR_VSM_DecCmd": CS.escc_aeb_dec_cmd,
}
# show AEB disabled indicator on dash with SCC12 if not sending FCA messages.
@@ -177,9 +183,14 @@ def create_acc_commands(packer, enabled, accel, upper_jerk, idx, lead_visible, s
# https://github.com/commaai/opendbc/commit/9ddcdb22c4929baf310295e832668e6e7fcfa602
fca11_values = {
"CR_FCA_Alive": idx % 0xF,
"PAINT1_Status": 1,
"FCA_DrvSetStatus": 1,
"FCA_Status": 1, # AEB disabled
"PAINT1_Status": 0 if escc else 1,
"FCA_DrvSetStatus": 0 if escc else 1,
"FCA_Status": 0 if escc else 1, # AEB disabled
"FCA_CmdAct": CS.escc_cmd_act,
"CF_VSM_Warn": CS.escc_aeb_warning,
"CF_VSM_DecCmdAct": CS.escc_aeb_dec_cmd_act,
"CR_VSM_DecCmd": CS.escc_aeb_dec_cmd,
}
fca11_dat = packer.make_can_msg("FCA11", 0, fca11_values)[2]
fca11_values["CR_FCA_ChkSum"] = hyundai_checksum(fca11_dat[:7])
@@ -187,7 +198,7 @@ def create_acc_commands(packer, enabled, accel, upper_jerk, idx, lead_visible, s
return commands
def create_acc_opt(packer):
def create_acc_opt(packer, escc):
commands = []
scc13_values = {
@@ -199,8 +210,8 @@ def create_acc_opt(packer):
# TODO: this needs to be detected and conditionally sent on unsupported long cars
fca12_values = {
"FCA_DrvSetState": 2,
"FCA_USM": 1, # AEB disabled
"FCA_DrvSetState": 0 if escc else 2,
"FCA_USM": 0 if escc else 1, # AEB disabled
}
commands.append(packer.make_can_msg("FCA12", 0, fca12_values))
+29 -11
View File
@@ -2,8 +2,8 @@ from cereal import car
from panda import Panda
from openpilot.common.conversions import Conversions as CV
from openpilot.selfdrive.car.hyundai.hyundaicanfd import CanBus
from openpilot.selfdrive.car.hyundai.values import HyundaiFlags, CAR, DBC, CANFD_CAR, CAMERA_SCC_CAR, CANFD_RADAR_SCC_CAR, \
CANFD_UNSUPPORTED_LONGITUDINAL_CAR, EV_CAR, HYBRID_CAR, LEGACY_SAFETY_MODE_CAR, \
from openpilot.selfdrive.car.hyundai.values import HyundaiFlags, HyundaiFlagsSP, CAR, DBC, CANFD_CAR, CAMERA_SCC_CAR, CANFD_RADAR_SCC_CAR, \
CANFD_UNSUPPORTED_LONGITUDINAL_CAR, NON_SCC_CAR, EV_CAR, HYBRID_CAR, LEGACY_SAFETY_MODE_CAR, \
UNSUPPORTED_LONGITUDINAL_CAR, Buttons
from openpilot.selfdrive.car.hyundai.radar_interface import RADAR_START_ADDR
from openpilot.selfdrive.car import create_button_events, get_safety_config
@@ -23,12 +23,13 @@ class CarInterface(CarInterfaceBase):
def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs):
ret.carName = "hyundai"
ret.radarUnavailable = RADAR_START_ADDR not in fingerprint[1] or DBC[ret.carFingerprint]["radar"] is None
ret.customStockLongAvailable = True
# These cars have been put into dashcam only due to both a lack of users and test coverage.
# These cars likely still work fine. Once a user confirms each car works and a test route is
# added to selfdrive/car/tests/routes.py, we can remove it from this list.
# FIXME: the Optima Hybrid 2017 uses a different SCC12 checksum
ret.dashcamOnly = candidate in {CAR.KIA_OPTIMA_H, }
ret.dashcamOnly = candidate in ({CAR.KIA_OPTIMA_H, } | NON_SCC_CAR)
hda2 = Ecu.adas in [fw.ecu for fw in car_fw]
CAN = CanBus(None, hda2, fingerprint)
@@ -72,6 +73,9 @@ class CarInterface(CarInterfaceBase):
if 0x38d in fingerprint[0] or 0x38d in fingerprint[2]:
ret.flags |= HyundaiFlags.USE_FCA.value
if 0x2AB in fingerprint[0]:
ret.spFlags |= HyundaiFlagsSP.SP_ENHANCED_SCC.value
ret.steerActuatorDelay = 0.1 # Default delay
ret.steerLimitTimer = 0.4
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning)
@@ -106,7 +110,7 @@ class CarInterface(CarInterfaceBase):
ret.steerRatio = 15.4 # 14 is Stock | Settled Params Learner values are steerRatio: 15.401566348670535
ret.tireStiffnessFactor = 0.385 # stiffnessFactor settled on 1.0081302973865127
ret.minSteerSpeed = 32 * CV.MPH_TO_MS
elif candidate == CAR.ELANTRA_2021:
elif candidate in (CAR.ELANTRA_2021, CAR.ELANTRA_2022_NON_SCC):
ret.mass = 2800. * CV.LB_TO_KG
ret.wheelbase = 2.72
ret.steerRatio = 12.9
@@ -121,7 +125,7 @@ class CarInterface(CarInterfaceBase):
ret.wheelbase = 3.01
ret.steerRatio = 16.5
ret.minSteerSpeed = 60 * CV.KPH_TO_MS
elif candidate in (CAR.KONA, CAR.KONA_EV, CAR.KONA_HEV, CAR.KONA_EV_2022, CAR.KONA_EV_2ND_GEN):
elif candidate in (CAR.KONA, CAR.KONA_EV, CAR.KONA_HEV, CAR.KONA_EV_2022, CAR.KONA_EV_2ND_GEN, CAR.KONA_NON_SCC):
ret.mass = {CAR.KONA_EV: 1685., CAR.KONA_HEV: 1425., CAR.KONA_EV_2022: 1743., CAR.KONA_EV_2ND_GEN: 1740.}.get(candidate, 1275.)
ret.wheelbase = {CAR.KONA_EV_2ND_GEN: 2.66, }.get(candidate, 2.6)
ret.steerRatio = {CAR.KONA_EV_2ND_GEN: 13.6, }.get(candidate, 13.42) # Spec
@@ -179,7 +183,7 @@ class CarInterface(CarInterfaceBase):
ret.tireStiffnessFactor = 0.385
if candidate == CAR.KIA_NIRO_PHEV:
ret.minSteerSpeed = 32 * CV.MPH_TO_MS
elif candidate == CAR.KIA_SELTOS:
elif candidate in (CAR.KIA_SELTOS, CAR.KIA_SELTOS_2023_NON_SCC):
ret.mass = 1337.
ret.wheelbase = 2.63
ret.steerRatio = 14.56
@@ -198,7 +202,7 @@ class CarInterface(CarInterfaceBase):
ret.mass = 1825.
ret.wheelbase = 2.78
ret.steerRatio = 14.4 * 1.15 # 15% higher at the center seems reasonable
elif candidate == CAR.KIA_FORTE:
elif candidate in (CAR.KIA_FORTE, CAR. KIA_FORTE_2019_NON_SCC, CAR.KIA_FORTE_2021_NON_SCC):
ret.mass = 2878. * CV.LB_TO_KG
ret.wheelbase = 2.80
ret.steerRatio = 13.75
@@ -245,7 +249,7 @@ class CarInterface(CarInterfaceBase):
ret.mass = 1640.0
ret.wheelbase = 2.84
ret.steerRatio = 13.56
elif candidate == CAR.GENESIS_G70_2020:
elif candidate in (CAR.GENESIS_G70_2020, CAR.GENESIS_G70_2021_NON_SCC):
ret.mass = 3673.0 * CV.LB_TO_KG
ret.wheelbase = 2.83
ret.steerRatio = 12.9
@@ -270,11 +274,12 @@ class CarInterface(CarInterfaceBase):
if candidate in CANFD_CAR:
ret.longitudinalTuning.kpV = [0.1]
ret.longitudinalTuning.kiV = [0.0]
ret.experimentalLongitudinalAvailable = candidate not in (CANFD_UNSUPPORTED_LONGITUDINAL_CAR | CANFD_RADAR_SCC_CAR)
ret.experimentalLongitudinalAvailable = candidate not in (CANFD_UNSUPPORTED_LONGITUDINAL_CAR | CANFD_RADAR_SCC_CAR | NON_SCC_CAR)
ret.customStockLongAvailable = False
else:
ret.longitudinalTuning.kpV = [0.5]
ret.longitudinalTuning.kiV = [0.0]
ret.experimentalLongitudinalAvailable = candidate not in (UNSUPPORTED_LONGITUDINAL_CAR | CAMERA_SCC_CAR)
ret.experimentalLongitudinalAvailable = candidate not in (UNSUPPORTED_LONGITUDINAL_CAR | CAMERA_SCC_CAR | NON_SCC_CAR)
ret.openpilotLongitudinalControl = experimental_long and ret.experimentalLongitudinalAvailable
ret.pcmCruise = not ret.openpilotLongitudinalControl
@@ -288,9 +293,15 @@ class CarInterface(CarInterfaceBase):
# *** feature detection ***
if candidate in CANFD_CAR:
ret.enableBsm = 0x1e5 in fingerprint[CAN.ECAN]
if 0x1fa in fingerprint[CAN.ECAN]:
ret.spFlags |= HyundaiFlagsSP.SP_NAV_MSG.value
else:
ret.enableBsm = 0x58b in fingerprint[0]
if 0x544 in fingerprint[0]:
ret.spFlags |= HyundaiFlagsSP.SP_NAV_MSG.value
# *** panda safety config ***
if candidate in CANFD_CAR:
cfgs = [get_safety_config(car.CarParams.SafetyModel.hyundaiCanfd), ]
@@ -316,6 +327,9 @@ class CarInterface(CarInterfaceBase):
if candidate in CAMERA_SCC_CAR:
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_HYUNDAI_CAMERA_SCC
if ret.spFlags & HyundaiFlagsSP.SP_ENHANCED_SCC:
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_HYUNDAI_ESCC
if ret.openpilotLongitudinalControl:
ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_LONG
if ret.flags & HyundaiFlags.HYBRID:
@@ -329,11 +343,15 @@ class CarInterface(CarInterfaceBase):
ret.centerToFront = ret.wheelbase * 0.4
# Detect smartMDPS, which bypasses EPS low speed lockout, allowing sunnypilot to send steering commands down to 0
if 0x2AA in fingerprint[0]:
ret.minSteerSpeed = 0.
return ret
@staticmethod
def init(CP, logcan, sendcan):
if CP.openpilotLongitudinalControl and not (CP.flags & HyundaiFlags.CANFD_CAMERA_SCC.value):
if CP.openpilotLongitudinalControl and not ((CP.flags & HyundaiFlags.CANFD_CAMERA_SCC.value) or (CP.spFlags & HyundaiFlagsSP.SP_ENHANCED_SCC)):
addr, bus = 0x7d0, 0
if CP.flags & HyundaiFlags.CANFD_HDA2.value:
addr, bus = 0x730, CanBus(CP).ECAN
+46 -21
View File
@@ -3,7 +3,7 @@ import math
from cereal import car
from opendbc.can.parser import CANParser
from openpilot.selfdrive.car.interfaces import RadarInterfaceBase
from openpilot.selfdrive.car.hyundai.values import DBC
from openpilot.selfdrive.car.hyundai.values import DBC, HyundaiFlagsSP
RADAR_START_ADDR = 0x500
RADAR_MSG_COUNT = 32
@@ -11,8 +11,12 @@ RADAR_MSG_COUNT = 32
# POC for parsing corner radars: https://github.com/commaai/openpilot/pull/24221/
def get_radar_can_parser(CP):
if DBC[CP.carFingerprint]['radar'] is None:
return None
if (CP.spFlags & HyundaiFlagsSP.SP_ENHANCED_SCC) and DBC[CP.carFingerprint]['radar'] is None:
messages = ("ESCC", 50)
return CANParser(DBC[CP.carFingerprint]['pt'], messages, 0)
else:
if DBC[CP.carFingerprint]['radar'] is None:
return None
messages = [(f"RADAR_TRACK_{addr:x}", 50) for addr in range(RADAR_START_ADDR, RADAR_START_ADDR + RADAR_MSG_COUNT)]
return CANParser(DBC[CP.carFingerprint]['radar'], messages, 1)
@@ -21,8 +25,9 @@ def get_radar_can_parser(CP):
class RadarInterface(RadarInterfaceBase):
def __init__(self, CP):
super().__init__(CP)
self.enhanced_scc = (CP.spFlags & HyundaiFlagsSP.SP_ENHANCED_SCC) and DBC[CP.carFingerprint]['radar'] is None
self.updated_messages = set()
self.trigger_msg = RADAR_START_ADDR + RADAR_MSG_COUNT - 1
self.trigger_msg = 0x2AB if self.enhanced_scc else RADAR_START_ADDR + RADAR_MSG_COUNT - 1
self.track_id = 0
self.radar_off_can = CP.radarUnavailable
@@ -54,26 +59,46 @@ class RadarInterface(RadarInterfaceBase):
errors.append("canError")
ret.errors = errors
for addr in range(RADAR_START_ADDR, RADAR_START_ADDR + RADAR_MSG_COUNT):
msg = self.rcp.vl[f"RADAR_TRACK_{addr:x}"]
if self.enhanced_scc:
msg = self.rcp.vl["ESCC"]
valid = msg['ACC_ObjStatus']
for ii in range(1):
if valid:
if ii not in self.pts:
self.pts[ii] = car.RadarData.RadarPoint.new_message()
self.pts[ii].trackId = self.track_id
self.track_id += 1
self.pts[ii].measured = True
self.pts[ii].dRel = msg['ACC_ObjDist']
self.pts[ii].yRel = -msg['ACC_ObjLatPos']
self.pts[ii].vRel = msg['ACC_ObjRelSpd']
self.pts[ii].aRel = float('nan')
self.pts[ii].yvRel = float('nan')
if addr not in self.pts:
self.pts[addr] = car.RadarData.RadarPoint.new_message()
self.pts[addr].trackId = self.track_id
self.track_id += 1
else:
if ii in self.pts:
del self.pts[ii]
else:
for addr in range(RADAR_START_ADDR, RADAR_START_ADDR + RADAR_MSG_COUNT):
msg = self.rcp.vl[f"RADAR_TRACK_{addr:x}"]
valid = msg['STATE'] in (3, 4)
if valid:
azimuth = math.radians(msg['AZIMUTH'])
self.pts[addr].measured = True
self.pts[addr].dRel = math.cos(azimuth) * msg['LONG_DIST']
self.pts[addr].yRel = 0.5 * -math.sin(azimuth) * msg['LONG_DIST']
self.pts[addr].vRel = msg['REL_SPEED']
self.pts[addr].aRel = msg['REL_ACCEL']
self.pts[addr].yvRel = float('nan')
if addr not in self.pts:
self.pts[addr] = car.RadarData.RadarPoint.new_message()
self.pts[addr].trackId = self.track_id
self.track_id += 1
else:
del self.pts[addr]
valid = msg['STATE'] in (3, 4)
if valid:
azimuth = math.radians(msg['AZIMUTH'])
self.pts[addr].measured = True
self.pts[addr].dRel = math.cos(azimuth) * msg['LONG_DIST']
self.pts[addr].yRel = 0.5 * -math.sin(azimuth) * msg['LONG_DIST']
self.pts[addr].vRel = msg['REL_SPEED']
self.pts[addr].aRel = msg['REL_ACCEL']
self.pts[addr].yvRel = float('nan')
else:
del self.pts[addr]
ret.points = list(self.pts.values())
return ret
+32 -1
View File
@@ -67,6 +67,12 @@ class HyundaiFlags(IntFlag):
EV = 2048
class HyundaiFlagsSP(IntFlag):
SP_ENHANCED_SCC = 1
SP_CAN_LFA_BTN = 2
SP_NAV_MSG = 4
class CAR(StrEnum):
# Hyundai
AZERA_6TH_GEN = "HYUNDAI AZERA 6TH GEN"
@@ -74,6 +80,7 @@ class CAR(StrEnum):
ELANTRA = "HYUNDAI ELANTRA 2017"
ELANTRA_GT_I30 = "HYUNDAI I30 N LINE 2019 & GT 2018 DCT"
ELANTRA_2021 = "HYUNDAI ELANTRA 2021"
ELANTRA_2022_NON_SCC = "HYUNDAI ELANTRA SE 2022 NON-SCC"
ELANTRA_HEV_2021 = "HYUNDAI ELANTRA HYBRID 2021"
HYUNDAI_GENESIS = "HYUNDAI GENESIS 2015-2016"
IONIQ = "HYUNDAI IONIQ HYBRID 2017-2019"
@@ -83,6 +90,7 @@ class CAR(StrEnum):
IONIQ_PHEV_2019 = "HYUNDAI IONIQ PLUG-IN HYBRID 2019"
IONIQ_PHEV = "HYUNDAI IONIQ PHEV 2020"
KONA = "HYUNDAI KONA 2020"
KONA_NON_SCC = "HYUNDAI KONA 2019 NON-SCC"
KONA_EV = "HYUNDAI KONA ELECTRIC 2019"
KONA_EV_2022 = "HYUNDAI KONA ELECTRIC 2022"
KONA_EV_2ND_GEN = "HYUNDAI KONA ELECTRIC 2ND GEN"
@@ -106,6 +114,8 @@ class CAR(StrEnum):
# Kia
KIA_FORTE = "KIA FORTE E 2018 & GT 2021"
KIA_FORTE_2019_NON_SCC = "KIA FORTE 2019 NON-SCC"
KIA_FORTE_2021_NON_SCC = "KIA FORTE LXS 2021 NON-SCC"
KIA_K5_2021 = "KIA K5 2021"
KIA_K5_HEV_2020 = "KIA K5 HYBRID 2020"
KIA_K8_HEV_1ST_GEN = "KIA K8 HYBRID 1ST GEN"
@@ -120,6 +130,7 @@ class CAR(StrEnum):
KIA_OPTIMA_H = "KIA OPTIMA HYBRID 2017 & SPORTS 2019"
KIA_OPTIMA_H_G4_FL = "KIA OPTIMA HYBRID 4TH GEN FACELIFT"
KIA_SELTOS = "KIA SELTOS 2021"
KIA_SELTOS_2023_NON_SCC = "KIA SELTOS 2023 NON-SCC"
KIA_SPORTAGE_5TH_GEN = "KIA SPORTAGE 5TH GEN"
KIA_SORENTO = "KIA SORENTO GT LINE 2018"
KIA_SORENTO_4TH_GEN = "KIA SORENTO 4TH GEN"
@@ -134,6 +145,7 @@ class CAR(StrEnum):
GENESIS_GV60_EV_1ST_GEN = "GENESIS GV60 ELECTRIC 1ST GEN"
GENESIS_G70 = "GENESIS G70 2018"
GENESIS_G70_2020 = "GENESIS G70 2020"
GENESIS_G70_2021_NON_SCC = "GENESIS G70 2021 NON-SCC"
GENESIS_GV70_1ST_GEN = "GENESIS GV70 1ST GEN"
GENESIS_G80 = "GENESIS G80 2017"
GENESIS_G90 = "GENESIS G90 2017"
@@ -305,6 +317,14 @@ CAR_INFO: dict[str, HyundaiCarInfo | list[HyundaiCarInfo] | None] = {
CAR.GENESIS_G80: HyundaiCarInfo("Genesis G80 2018-19", "All", car_parts=CarParts.common([CarHarness.hyundai_h])),
CAR.GENESIS_G90: HyundaiCarInfo("Genesis G90 2017-18", "All", car_parts=CarParts.common([CarHarness.hyundai_c])),
CAR.GENESIS_GV80: HyundaiCarInfo("Genesis GV80 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_m])),
# Non-SCC Cars
CAR.ELANTRA_2022_NON_SCC: HyundaiCarInfo("Hyundai Elantra Non-SCC 2022", "No Smart Cruise Control (SCC)", car_parts=CarParts.common([CarHarness.hyundai_k])),
CAR.KONA_NON_SCC: HyundaiCarInfo("Hyundai Kona Non-SCC 2019", "No Smart Cruise Control (SCC)", car_parts=CarParts.common([CarHarness.hyundai_b])),
CAR.KIA_FORTE_2019_NON_SCC: HyundaiCarInfo("Kia Forte Non-SCC 2019", "No Smart Cruise Control (SCC)", car_parts=CarParts.common([CarHarness.hyundai_g])),
CAR.KIA_FORTE_2021_NON_SCC: HyundaiCarInfo("Kia Forte Non-SCC 2021", "No Smart Cruise Control (SCC)", car_parts=CarParts.common([CarHarness.hyundai_g])),
CAR.KIA_SELTOS_2023_NON_SCC: HyundaiCarInfo("Kia Seltos Non-SCC 2023-24", "No Smart Cruise Control (SCC)", car_parts=CarParts.common([CarHarness.hyundai_l])),
CAR.GENESIS_G70_2021_NON_SCC: HyundaiCarInfo("Genesis G70 Non-SCC 2021", "No Smart Cruise Control (SCC)", car_parts=CarParts.common([CarHarness.hyundai_f])),
}
class Buttons:
@@ -522,7 +542,7 @@ FW_QUERY_CONFIG = FwQueryConfig(
CHECKSUM = {
"crc8": [CAR.SANTA_FE, CAR.SONATA, CAR.PALISADE, CAR.KIA_SELTOS, CAR.ELANTRA_2021, CAR.ELANTRA_HEV_2021,
CAR.SONATA_HYBRID, CAR.SANTA_FE_2022, CAR.KIA_K5_2021, CAR.SANTA_FE_HEV_2022, CAR.SANTA_FE_PHEV_2022,
CAR.KIA_K5_HEV_2020, CAR.CUSTIN_1ST_GEN],
CAR.KIA_K5_HEV_2020, CAR.CUSTIN_1ST_GEN, CAR.ELANTRA_2022_NON_SCC, CAR.GENESIS_G70_2021_NON_SCC, CAR.KIA_SELTOS_2023_NON_SCC],
"6B": [CAR.KIA_SORENTO, CAR.HYUNDAI_GENESIS],
}
@@ -564,6 +584,11 @@ LEGACY_SAFETY_MODE_CAR = {CAR.HYUNDAI_GENESIS, CAR.IONIQ_EV_LTD, CAR.KIA_OPTIMA_
UNSUPPORTED_LONGITUDINAL_CAR = LEGACY_SAFETY_MODE_CAR | {CAR.KIA_NIRO_PHEV, CAR.KIA_SORENTO, CAR.SONATA_LF, CAR.KIA_OPTIMA_G4_FL,
CAR.KIA_OPTIMA_H_G4_FL}
NON_SCC_CAR = {CAR.KIA_FORTE_2021_NON_SCC, CAR.ELANTRA_2022_NON_SCC, CAR.KIA_FORTE_2019_NON_SCC, CAR.GENESIS_G70_2021_NON_SCC,
CAR.KIA_SELTOS_2023_NON_SCC, CAR.KONA_NON_SCC}
NON_SCC_NO_FCA_CAR = {CAR.KIA_FORTE_2019_NON_SCC, }
NON_SCC_RADAR_FCA_CAR = {CAR.GENESIS_G70_2021_NON_SCC, }
# If 0x500 is present on bus 1 it probably has a Mando radar outputting radar points.
# If no points are outputted by default it might be possible to turn it on using selfdrive/debug/hyundai_enable_radar_points.py
DBC = {
@@ -572,9 +597,11 @@ DBC = {
CAR.ELANTRA: dbc_dict('hyundai_kia_generic', None),
CAR.ELANTRA_GT_I30: dbc_dict('hyundai_kia_generic', None),
CAR.ELANTRA_2021: dbc_dict('hyundai_kia_generic', None),
CAR.ELANTRA_2022_NON_SCC: dbc_dict('hyundai_kia_generic', None),
CAR.ELANTRA_HEV_2021: dbc_dict('hyundai_kia_generic', None),
CAR.GENESIS_G70: dbc_dict('hyundai_kia_generic', None),
CAR.GENESIS_G70_2020: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar_generated'),
CAR.GENESIS_G70_2021_NON_SCC: dbc_dict('hyundai_kia_generic', None),
CAR.GENESIS_G80: dbc_dict('hyundai_kia_generic', None),
CAR.GENESIS_G90: dbc_dict('hyundai_kia_generic', None),
CAR.HYUNDAI_GENESIS: dbc_dict('hyundai_kia_generic', None),
@@ -585,6 +612,8 @@ DBC = {
CAR.IONIQ: dbc_dict('hyundai_kia_generic', None),
CAR.IONIQ_HEV_2022: dbc_dict('hyundai_kia_generic', None),
CAR.KIA_FORTE: dbc_dict('hyundai_kia_generic', None),
CAR.KIA_FORTE_2019_NON_SCC: dbc_dict('hyundai_kia_generic', None),
CAR.KIA_FORTE_2021_NON_SCC: dbc_dict('hyundai_kia_generic', None),
CAR.KIA_K5_2021: dbc_dict('hyundai_kia_generic', None),
CAR.KIA_K5_HEV_2020: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar_generated'),
CAR.KIA_NIRO_EV: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar_generated'),
@@ -595,10 +624,12 @@ DBC = {
CAR.KIA_OPTIMA_H: dbc_dict('hyundai_kia_generic', None),
CAR.KIA_OPTIMA_H_G4_FL: dbc_dict('hyundai_kia_generic', None),
CAR.KIA_SELTOS: dbc_dict('hyundai_kia_generic', None),
CAR.KIA_SELTOS_2023_NON_SCC: dbc_dict('hyundai_kia_generic', None),
CAR.KIA_SORENTO: dbc_dict('hyundai_kia_generic', None), # Has 0x5XX messages, but different format
CAR.KIA_STINGER: dbc_dict('hyundai_kia_generic', None),
CAR.KIA_STINGER_2022: dbc_dict('hyundai_kia_generic', None),
CAR.KONA: dbc_dict('hyundai_kia_generic', None),
CAR.KONA_NON_SCC: dbc_dict('hyundai_kia_generic', None),
CAR.KONA_EV: dbc_dict('hyundai_kia_generic', None),
CAR.KONA_EV_2022: dbc_dict('hyundai_kia_generic', None),
CAR.KONA_HEV: dbc_dict('hyundai_kia_generic', None),
+3
View File
@@ -177,6 +177,7 @@ class CarInterfaceBase(ABC):
ret.wheelSpeedFactor = 1.0
ret.pcmCruise = True # openpilot's state is tied to the PCM's cruise state on most cars
ret.pcmCruiseSpeed = True # openpilot's state is tied to the PCM's cruise speed
ret.minEnableSpeed = -1. # enable is done by stock ACC, so ignore this
ret.steerRatioRear = 0. # no rear steering, at least on the listed cars aboveA
ret.openpilotLongitudinalControl = False
@@ -358,6 +359,8 @@ class CarStateBase(ABC):
self.cluster_speed_hyst_gap = 0.0
self.cluster_min_speed = 0.0 # min speed before dropping to 0
self.gap_dist_button = 0
Q = [[0.0, 0.0], [0.0, 100.0]]
R = 0.3
A = [[1.0, DT_CTRL], [0.0, 1.0]]
+1
View File
@@ -15,6 +15,7 @@ class CarInterface(CarInterfaceBase):
ret.carName = "mazda"
ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.mazda)]
ret.radarUnavailable = True
ret.customStockLongAvailable = True
ret.dashcamOnly = candidate not in (CAR.CX5_2022, CAR.CX9_2021)
+5
View File
@@ -29,6 +29,10 @@ class CarState(CarStateBase):
cp_brakes = cp_body if self.car_fingerprint in GLOBAL_GEN2 else cp
ret.brakePressed = cp_brakes.vl["Brake_Status"]["Brake"] == 1
brake_msg = "ES_Brake" if self.car_fingerprint in PREGLOBAL_CARS else "ES_DashStatus"
brake_sig = "Cruise_Brake_Lights" if self.car_fingerprint in PREGLOBAL_CARS else "Brake_Lights"
ret.brakeLightsDEPRECATED = bool(cp_cam.vl[brake_msg][brake_sig])
cp_wheels = cp_body if self.car_fingerprint in GLOBAL_GEN2 else cp
ret.wheelSpeeds = self.get_wheel_speeds(
cp_wheels.vl["Wheel_Speeds"]["FL"],
@@ -187,6 +191,7 @@ class CarState(CarStateBase):
messages = [
("ES_DashStatus", 20),
("ES_Distance", 20),
("ES_Brake", 20),
]
else:
messages = [
+8 -1
View File
@@ -17,7 +17,7 @@ class CarInterface(CarInterfaceBase):
# - replacement for ES_Distance so we can cancel the cruise control
# - to find the Cruise_Activated bit from the car
# - proper panda safety setup (use the correct cruise_activated bit, throttle from Throttle_Hybrid, etc)
ret.dashcamOnly = candidate in (PREGLOBAL_CARS | LKAS_ANGLE | HYBRID_CARS)
ret.dashcamOnly = candidate in (LKAS_ANGLE | HYBRID_CARS)
ret.autoResumeSng = False
# Detect infotainment message sent from the camera
@@ -54,6 +54,13 @@ class CarInterface(CarInterfaceBase):
ret.lateralTuning.pid.kf = 0.00005
ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0., 20.], [0., 20.]]
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2, 0.3], [0.02, 0.03]]
# Certain Impreza / Crosstrek EPS use 3071 max value and do not work with stock value/scaling.
if any(fw.ecu == "eps" and fw.fwVersion in (b'z\xc0\x00\x00', b'z\xc0\x04\x00', b'z\xc0\x08\x00', b'\x8a\xc0\x00\x00',
b'\x8a\xc0\x10\x00') for fw in car_fw):
ret.safetyConfigs[0].safetyParam = Panda.FLAG_SUBARU_MAX_STEER_IMPREZA_2018
ret.steerActuatorDelay = 0.18 # measured
ret.lateralTuning.pid.kf = 0.00003333
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.133, 0.2], [0.0133, 0.02]]
elif candidate == CAR.IMPREZA_2020:
ret.lateralTuning.init('pid')
+3
View File
@@ -1,5 +1,6 @@
from dataclasses import dataclass, field
from enum import Enum, IntFlag
from panda import Panda
from cereal import car
from panda.python import uds
@@ -25,6 +26,8 @@ class CarControllerParams:
self.STEER_DELTA_DOWN = 40
elif CP.carFingerprint == CAR.IMPREZA_2020:
self.STEER_MAX = 1439
elif CP.safetyConfigs[0].safetyParam == Panda.FLAG_SUBARU_MAX_STEER_IMPREZA_2018:
self.STEER_MAX = 3071
else:
self.STEER_MAX = 2047
+283
View File
@@ -0,0 +1,283 @@
{
"=== Not Selected ===": "",
"Acura ILX 2016-19": "ACURA ILX 2016",
"Acura RDX 2016-18": "ACURA RDX 2018",
"Acura RDX 2019-22": "ACURA RDX 2020",
"Audi A3 2014-19": "AUDI A3 3RD GEN",
"Audi A3 Sportback e-tron 2017-18": "AUDI A3 3RD GEN",
"Audi Q2 2018": "AUDI Q2 1ST GEN",
"Audi Q3 2019-23": "AUDI Q3 2ND GEN",
"Audi RS3 2018": "AUDI A3 3RD GEN",
"Audi S3 2015-17": "AUDI A3 3RD GEN",
"Buick LaCrosse 2017-19": "BUICK LACROSSE 2017",
"Cadillac Escalade 2017": "CADILLAC ESCALADE 2017",
"Cadillac Escalade ESV 2016": "CADILLAC ESCALADE ESV 2016",
"Cadillac Escalade ESV 2019": "CADILLAC ESCALADE ESV 2019",
"Chevrolet Bolt EUV 2022-23": "CHEVROLET BOLT EUV 2022",
"Chevrolet Bolt EV 2022-23": "CHEVROLET BOLT EUV 2022",
"Chevrolet Silverado 1500 2020-21": "CHEVROLET SILVERADO 1500 2020",
"Chevrolet Trailblazer 2021-22": "CHEVROLET TRAILBLAZER 2021",
"Chevrolet Volt 2017-18": "CHEVROLET VOLT PREMIER 2017",
"Chrysler Pacifica 2017-18": "CHRYSLER PACIFICA 2018",
"Chrysler Pacifica 2019-20": "CHRYSLER PACIFICA 2020",
"Chrysler Pacifica 2021": "CHRYSLER PACIFICA 2020",
"Chrysler Pacifica Hybrid 2017-18": "CHRYSLER PACIFICA HYBRID 2017",
"Chrysler Pacifica Hybrid 2019-23": "CHRYSLER PACIFICA HYBRID 2019",
"Ford Bronco Sport 2021-22": "FORD BRONCO SPORT 1ST GEN",
"Ford Escape 2020-22": "FORD ESCAPE 4TH GEN",
"Ford Explorer 2020-22": "FORD EXPLORER 6TH GEN",
"Ford Focus 2018": "FORD FOCUS 4TH GEN",
"Ford Kuga 2020-22": "FORD ESCAPE 4TH GEN",
"Ford Maverick 2022": "FORD MAVERICK 1ST GEN",
"Ford Maverick 2023": "FORD MAVERICK 1ST GEN",
"Genesis G70 2018-19": "GENESIS G70 2018",
"Genesis G70 2020": "GENESIS G70 2020",
"Genesis G70 Non-SCC 2021": "GENESIS G70 2021 NON-SCC",
"Genesis G80 2017": "HYUNDAI GENESIS 2015-2016",
"Genesis G80 2018-19": "GENESIS G80 2017",
"Genesis G90 2017-18": "GENESIS G90 2017",
"Genesis GV60 (Advanced Trim) 2023": "GENESIS GV60 ELECTRIC 1ST GEN",
"Genesis GV60 (Performance Trim) 2023": "GENESIS GV60 ELECTRIC 1ST GEN",
"Genesis GV70 (2.5T Trim) 2022-23": "GENESIS GV70 1ST GEN",
"Genesis GV70 (3.5T Trim) 2022-23": "GENESIS GV70 1ST GEN",
"Genesis GV80 2023": "GENESIS GV80 2023",
"GMC Acadia 2018": "GMC ACADIA DENALI 2018",
"GMC Sierra 1500 2020-21": "CHEVROLET SILVERADO 1500 2020",
"Honda Accord 4-Cylinder 2016-17": "HONDA ACCORD 4CYL 9TH GEN",
"Honda Accord 2018-22": "HONDA ACCORD 2018",
"Honda Accord Hybrid 2018-22": "HONDA ACCORD HYBRID 2018",
"Honda Civic 2016-18": "HONDA CIVIC 2016",
"Honda Civic 2019-21": "HONDA CIVIC (BOSCH) 2019",
"Honda Civic 2022-23": "HONDA CIVIC 2022",
"Honda Civic Hatchback 2017-21": "HONDA CIVIC (BOSCH) 2019",
"Honda Civic Hatchback 2022-23": "HONDA CIVIC 2022",
"Honda Clarity 2018-22": "HONDA CLARITY 2018",
"Honda CR-V 2015-16": "HONDA CR-V 2016",
"Honda CR-V 2017-22": "HONDA CR-V 2017",
"Honda CR-V Hybrid 2017-19": "HONDA CR-V HYBRID 2019",
"Honda e 2020": "HONDA E 2020",
"Honda Fit 2018-20": "HONDA FIT 2018",
"Honda Freed 2020": "HONDA FREED 2020",
"Honda HR-V 2019-22": "HONDA HRV 2019",
"Honda HR-V 2023": "HONDA HR-V 2023",
"Honda Insight 2019-22": "HONDA INSIGHT 2019",
"Honda Inspire 2018": "HONDA ACCORD 2018",
"Honda Odyssey 2018-20": "HONDA ODYSSEY 2018",
"Honda Passport 2019-23": "HONDA PILOT 2017",
"Honda Pilot 2016-22": "HONDA PILOT 2017",
"Honda Ridgeline 2017-23": "HONDA RIDGELINE 2017",
"Hyundai Azera 2022": "HYUNDAI AZERA 6TH GEN",
"Hyundai Azera Hybrid 2020": "HYUNDAI AZERA HYBRID 6TH GEN",
"Hyundai Custin 2023": "HYUNDAI CUSTIN 1ST GEN",
"Hyundai Elantra 2017-18": "HYUNDAI ELANTRA 2017",
"Hyundai Elantra 2019": "HYUNDAI ELANTRA 2017",
"Hyundai Elantra 2021-23": "HYUNDAI ELANTRA 2021",
"Hyundai Elantra GT 2017-19": "HYUNDAI I30 N LINE 2019 & GT 2018 DCT",
"Hyundai Elantra Hybrid 2021-23": "HYUNDAI ELANTRA HYBRID 2021",
"Hyundai Elantra Non-SCC 2022": "HYUNDAI ELANTRA SE 2022 NON-SCC",
"Hyundai Genesis 2015-16": "HYUNDAI GENESIS 2015-2016",
"Hyundai i30 2017-19": "HYUNDAI I30 N LINE 2019 & GT 2018 DCT",
"Hyundai Ioniq 5 (Southeast Asia only) 2022-23": "HYUNDAI IONIQ 5 2022",
"Hyundai Ioniq 5 (with HDA II) 2022-23": "HYUNDAI IONIQ 5 2022",
"Hyundai Ioniq 5 (without HDA II) 2022-23": "HYUNDAI IONIQ 5 2022",
"Hyundai Ioniq 6 (with HDA II) 2023": "HYUNDAI IONIQ 6 2023",
"Hyundai Ioniq Electric 2019": "HYUNDAI IONIQ ELECTRIC LIMITED 2019",
"Hyundai Ioniq Electric 2020": "HYUNDAI IONIQ ELECTRIC 2020",
"Hyundai Ioniq Hybrid 2017-19": "HYUNDAI IONIQ HYBRID 2017-2019",
"Hyundai Ioniq Hybrid 2020-22": "HYUNDAI IONIQ HYBRID 2020-2022",
"Hyundai Ioniq Plug-in Hybrid 2019": "HYUNDAI IONIQ PLUG-IN HYBRID 2019",
"Hyundai Ioniq Plug-in Hybrid 2020-22": "HYUNDAI IONIQ PHEV 2020",
"Hyundai Kona 2020": "HYUNDAI KONA 2020",
"Hyundai Kona Electric 2018-21": "HYUNDAI KONA ELECTRIC 2019",
"Hyundai Kona Electric 2022-23": "HYUNDAI KONA ELECTRIC 2022",
"Hyundai Kona Electric (with HDA II, Korea only) 2023": "HYUNDAI KONA ELECTRIC 2ND GEN",
"Hyundai Kona Hybrid 2020": "HYUNDAI KONA HYBRID 2020",
"Hyundai Kona Non-SCC 2019": "HYUNDAI KONA 2019 NON-SCC",
"Hyundai Palisade 2020-22": "HYUNDAI PALISADE 2020",
"Hyundai Santa Cruz 2022-23": "HYUNDAI SANTA CRUZ 1ST GEN",
"Hyundai Santa Fe 2019-20": "HYUNDAI SANTA FE 2019",
"Hyundai Santa Fe 2021-23": "HYUNDAI SANTA FE 2022",
"Hyundai Santa Fe Hybrid 2022-23": "HYUNDAI SANTA FE HYBRID 2022",
"Hyundai Santa Fe Plug-in Hybrid 2022-23": "HYUNDAI SANTA FE PlUG-IN HYBRID 2022",
"Hyundai Sonata 2018-19": "HYUNDAI SONATA 2019",
"Hyundai Sonata 2020-23": "HYUNDAI SONATA 2020",
"Hyundai Sonata Hybrid 2020-23": "HYUNDAI SONATA HYBRID 2021",
"Hyundai Tucson 2021": "HYUNDAI TUCSON 2019",
"Hyundai Tucson 2022": "HYUNDAI TUCSON 4TH GEN",
"Hyundai Tucson 2023": "HYUNDAI TUCSON 4TH GEN",
"Hyundai Tucson Diesel 2019": "HYUNDAI TUCSON 2019",
"Hyundai Tucson Hybrid 2022-24": "HYUNDAI TUCSON HYBRID 4TH GEN",
"Hyundai Veloster 2019-20": "HYUNDAI VELOSTER 2019",
"Jeep Grand Cherokee 2016-18": "JEEP GRAND CHEROKEE V6 2018",
"Jeep Grand Cherokee 2019-21": "JEEP GRAND CHEROKEE 2019",
"Kia Carnival 2023-24": "KIA CARNIVAL 4TH GEN",
"Kia Carnival (China only) 2023": "KIA CARNIVAL 4TH GEN",
"Kia Ceed 2019": "KIA CEED INTRO ED 2019",
"Kia EV6 (Southeast Asia only) 2022-23": "KIA EV6 2022",
"Kia EV6 (with HDA II) 2022-23": "KIA EV6 2022",
"Kia EV6 (without HDA II) 2022-23": "KIA EV6 2022",
"Kia Forte 2019-21": "KIA FORTE E 2018 & GT 2021",
"Kia Forte 2023": "KIA FORTE E 2018 & GT 2021",
"Kia Forte Non-SCC 2019": "KIA FORTE 2019 NON-SCC",
"Kia Forte Non-SCC 2021": "KIA FORTE LXS 2021 NON-SCC",
"Kia K5 2021-24": "KIA K5 2021",
"Kia K5 Hybrid 2020-22": "KIA K5 HYBRID 2020",
"Kia K8 Hybrid (with HDA II) 2023": "KIA K8 HYBRID 1ST GEN",
"Kia Niro EV 2019": "KIA NIRO EV 2020",
"Kia Niro EV 2020": "KIA NIRO EV 2020",
"Kia Niro EV 2021": "KIA NIRO EV 2020",
"Kia Niro EV 2022": "KIA NIRO EV 2020",
"Kia Niro EV 2023": "KIA NIRO EV 2ND GEN",
"Kia Niro Hybrid 2021-22": "KIA NIRO HYBRID 2021",
"Kia Niro Hybrid 2023": "KIA NIRO HYBRID 2ND GEN",
"Kia Niro Plug-in Hybrid 2018-19": "KIA NIRO HYBRID 2019",
"Kia Niro Plug-in Hybrid 2020": "KIA NIRO HYBRID 2019",
"Kia Optima 2017": "KIA OPTIMA 4TH GEN",
"Kia Optima 2019-20": "KIA OPTIMA 4TH GEN FACELIFT",
"Kia Optima Hybrid 2019": "KIA OPTIMA HYBRID 4TH GEN FACELIFT",
"Kia Seltos 2021": "KIA SELTOS 2021",
"Kia Seltos Non-SCC 2023-24": "KIA SELTOS 2023 NON-SCC",
"Kia Sorento 2018": "KIA SORENTO GT LINE 2018",
"Kia Sorento 2019": "KIA SORENTO GT LINE 2018",
"Kia Sorento 2021-23": "KIA SORENTO 4TH GEN",
"Kia Sorento Hybrid 2021-23": "KIA SORENTO HYBRID 4TH GEN",
"Kia Sorento Plug-in Hybrid 2022-23": "KIA SORENTO PLUG-IN HYBRID 4TH GEN",
"Kia Sportage 2023": "KIA SPORTAGE 5TH GEN",
"Kia Sportage Hybrid 2023": "KIA SPORTAGE HYBRID 5TH GEN",
"Kia Stinger 2018-20": "KIA STINGER GT2 2018",
"Kia Stinger 2022": "KIA STINGER 2022",
"Kia Telluride 2020-22": "HYUNDAI PALISADE 2020",
"Lexus CT Hybrid 2017-18": "LEXUS CT HYBRID 2018",
"Lexus ES 2017-18": "LEXUS ES 2018",
"Lexus ES 2019-24": "LEXUS ES 2019",
"Lexus ES Hybrid 2017-18": "LEXUS ES HYBRID 2018",
"Lexus ES Hybrid 2019-23": "LEXUS ES 2019",
"Lexus IS 2017-19": "LEXUS IS 2018",
"Lexus IS 2022-23": "LEXUS IS 2023",
"Lexus NX 2018-19": "LEXUS NX 2018",
"Lexus NX 2020-21": "LEXUS NX 2020",
"Lexus NX Hybrid 2018-19": "LEXUS NX 2018",
"Lexus NX Hybrid 2020-21": "LEXUS NX 2020",
"Lexus RC 2018-20": "LEXUS RC 2020",
"Lexus RX 2016": "LEXUS RX 2016",
"Lexus RX 2017-19": "LEXUS RX 2016",
"Lexus RX 2020-22": "LEXUS RX 2020",
"Lexus RX Hybrid 2016": "LEXUS RX HYBRID 2017",
"Lexus RX Hybrid 2017-19": "LEXUS RX HYBRID 2017",
"Lexus RX Hybrid 2020-22": "LEXUS RX 2020",
"Lexus UX Hybrid 2019-23": "TOYOTA COROLLA TSS2 2019",
"Lincoln Aviator 2020-21": "FORD EXPLORER 6TH GEN",
"MAN eTGE 2020-23": "VOLKSWAGEN CRAFTER 2ND GEN",
"MAN TGE 2017-23": "VOLKSWAGEN CRAFTER 2ND GEN",
"Mazda CX-5 2022-24": "MAZDA CX-5 2022",
"Mazda CX-9 2021-23": "MAZDA CX-9 2021",
"Nissan Altima 2019-20": "NISSAN ALTIMA 2020",
"Nissan Leaf 2018-23": "NISSAN LEAF 2018",
"Nissan Rogue 2018-20": "NISSAN ROGUE 2019",
"Nissan X-Trail 2017": "NISSAN X-TRAIL 2017",
"Ram 1500 2019-23": "RAM 1500 5TH GEN",
"Ram 2500 2020-22": "RAM HD 5TH GEN",
"Ram 3500 2019-22": "RAM HD 5TH GEN",
"SEAT Ateca 2018": "SEAT ATECA 1ST GEN",
"SEAT Leon 2014-20": "SEAT LEON 3RD GEN",
"Subaru Ascent 2019-21": "SUBARU ASCENT LIMITED 2019",
"Subaru Crosstrek 2018-19": "SUBARU IMPREZA LIMITED 2019",
"Subaru Crosstrek 2020-23": "SUBARU IMPREZA SPORT 2020",
"Subaru Forester 2017-18": "SUBARU FORESTER 2017 - 2018",
"Subaru Forester 2019-21": "SUBARU FORESTER 2019",
"Subaru Impreza 2017-19": "SUBARU IMPREZA LIMITED 2019",
"Subaru Impreza 2020-22": "SUBARU IMPREZA SPORT 2020",
"Subaru Legacy 2015-18": "SUBARU LEGACY 2015 - 2018",
"Subaru Legacy 2020-22": "SUBARU LEGACY 7TH GEN",
"Subaru Outback 2015-17": "SUBARU OUTBACK 2015 - 2017",
"Subaru Outback 2018-19": "SUBARU OUTBACK 2018 - 2019",
"Subaru Outback 2020-22": "SUBARU OUTBACK 6TH GEN",
"Subaru XV 2018-19": "SUBARU IMPREZA LIMITED 2019",
"Subaru XV 2020-21": "SUBARU IMPREZA SPORT 2020",
"Škoda Fabia 2022-23": "SKODA FABIA 4TH GEN",
"Škoda Kamiq 2021": "SKODA KAMIQ 1ST GEN",
"Škoda Karoq 2019-23": "SKODA KAROQ 1ST GEN",
"Škoda Kodiaq 2017-23": "SKODA KODIAQ 1ST GEN",
"Škoda Octavia 2015-19": "SKODA OCTAVIA 3RD GEN",
"Škoda Octavia RS 2016": "SKODA OCTAVIA 3RD GEN",
"Škoda Scala 2020-23": "SKODA SCALA 1ST GEN",
"Škoda Superb 2015-22": "SKODA SUPERB 3RD GEN",
"Toyota Alphard 2019-20": "TOYOTA ALPHARD 2020",
"Toyota Alphard Hybrid 2021": "TOYOTA ALPHARD 2020",
"Toyota Avalon 2016": "TOYOTA AVALON 2016",
"Toyota Avalon 2017-18": "TOYOTA AVALON 2016",
"Toyota Avalon 2019-21": "TOYOTA AVALON 2019",
"Toyota Avalon 2022": "TOYOTA AVALON 2022",
"Toyota Avalon Hybrid 2019-21": "TOYOTA AVALON 2019",
"Toyota Avalon Hybrid 2022": "TOYOTA AVALON 2022",
"Toyota C-HR 2017-20": "TOYOTA C-HR 2018",
"Toyota C-HR 2021": "TOYOTA C-HR 2021",
"Toyota C-HR Hybrid 2017-20": "TOYOTA C-HR 2018",
"Toyota C-HR Hybrid 2021-22": "TOYOTA C-HR 2021",
"Toyota Camry 2018-20": "TOYOTA CAMRY 2018",
"Toyota Camry 2021-23": "TOYOTA CAMRY 2021",
"Toyota Camry Hybrid 2018-20": "TOYOTA CAMRY 2018",
"Toyota Camry Hybrid 2021-24": "TOYOTA CAMRY 2021",
"Toyota Corolla 2017-19": "TOYOTA COROLLA 2017",
"Toyota Corolla 2020-22": "TOYOTA COROLLA TSS2 2019",
"Toyota Corolla Cross (Non-US only) 2020-23": "TOYOTA COROLLA TSS2 2019",
"Toyota Corolla Cross Hybrid (Non-US only) 2020-22": "TOYOTA COROLLA TSS2 2019",
"Toyota Corolla Hatchback 2019-22": "TOYOTA COROLLA TSS2 2019",
"Toyota Corolla Hybrid 2020-22": "TOYOTA COROLLA TSS2 2019",
"Toyota Corolla Hybrid (Non-US only) 2020-23": "TOYOTA COROLLA TSS2 2019",
"Toyota Highlander 2017-19": "TOYOTA HIGHLANDER 2017",
"Toyota Highlander 2020-23": "TOYOTA HIGHLANDER 2020",
"Toyota Highlander Hybrid 2017-19": "TOYOTA HIGHLANDER HYBRID 2018",
"Toyota Highlander Hybrid 2020-23": "TOYOTA HIGHLANDER 2020",
"Toyota Mirai 2021": "TOYOTA MIRAI 2021",
"Toyota Prius 2016": "TOYOTA PRIUS 2017",
"Toyota Prius 2017-20": "TOYOTA PRIUS 2017",
"Toyota Prius 2021-22": "TOYOTA PRIUS TSS2 2021",
"Toyota Prius Prime 2017-20": "TOYOTA PRIUS 2017",
"Toyota Prius Prime 2021-22": "TOYOTA PRIUS TSS2 2021",
"Toyota Prius v 2017": "TOYOTA PRIUS v 2017",
"Toyota RAV4 2016": "TOYOTA RAV4 2017",
"Toyota RAV4 2017-18": "TOYOTA RAV4 2017",
"Toyota RAV4 2019-21": "TOYOTA RAV4 2019",
"Toyota RAV4 2022": "TOYOTA RAV4 2022",
"Toyota RAV4 Hybrid 2016": "TOYOTA RAV4 HYBRID 2017",
"Toyota RAV4 Hybrid 2017-18": "TOYOTA RAV4 HYBRID 2017",
"Toyota RAV4 Hybrid 2019-21": "TOYOTA RAV4 2019",
"Toyota RAV4 Hybrid 2022": "TOYOTA RAV4 2022",
"Toyota Sienna 2018-20": "TOYOTA SIENNA 2018",
"Volkswagen Arteon 2018-23": "VOLKSWAGEN ARTEON 1ST GEN",
"Volkswagen Arteon eHybrid 2020-23": "VOLKSWAGEN ARTEON 1ST GEN",
"Volkswagen Arteon R 2020-23": "VOLKSWAGEN ARTEON 1ST GEN",
"Volkswagen Atlas 2018-23": "VOLKSWAGEN ATLAS 1ST GEN",
"Volkswagen Atlas Cross Sport 2020-22": "VOLKSWAGEN ATLAS 1ST GEN",
"Volkswagen California 2021-23": "VOLKSWAGEN TRANSPORTER T6.1",
"Volkswagen Caravelle 2020": "VOLKSWAGEN TRANSPORTER T6.1",
"Volkswagen CC 2018-22": "VOLKSWAGEN ARTEON 1ST GEN",
"Volkswagen Crafter 2017-23": "VOLKSWAGEN CRAFTER 2ND GEN",
"Volkswagen e-Crafter 2018-23": "VOLKSWAGEN CRAFTER 2ND GEN",
"Volkswagen e-Golf 2014-20": "VOLKSWAGEN GOLF 7TH GEN",
"Volkswagen Golf 2015-20": "VOLKSWAGEN GOLF 7TH GEN",
"Volkswagen Golf Alltrack 2015-19": "VOLKSWAGEN GOLF 7TH GEN",
"Volkswagen Golf GTD 2015-20": "VOLKSWAGEN GOLF 7TH GEN",
"Volkswagen Golf GTE 2015-20": "VOLKSWAGEN GOLF 7TH GEN",
"Volkswagen Golf GTI 2015-21": "VOLKSWAGEN GOLF 7TH GEN",
"Volkswagen Golf R 2015-19": "VOLKSWAGEN GOLF 7TH GEN",
"Volkswagen Golf SportsVan 2015-20": "VOLKSWAGEN GOLF 7TH GEN",
"Volkswagen Grand California 2019-23": "VOLKSWAGEN CRAFTER 2ND GEN",
"Volkswagen Jetta 2018-22": "VOLKSWAGEN JETTA 7TH GEN",
"Volkswagen Jetta GLI 2021-22": "VOLKSWAGEN JETTA 7TH GEN",
"Volkswagen Passat 2015-22": "VOLKSWAGEN PASSAT 8TH GEN",
"Volkswagen Passat Alltrack 2015-22": "VOLKSWAGEN PASSAT 8TH GEN",
"Volkswagen Passat GTE 2015-22": "VOLKSWAGEN PASSAT 8TH GEN",
"Volkswagen Polo 2018-23": "VOLKSWAGEN POLO 6TH GEN",
"Volkswagen Polo GTI 2018-23": "VOLKSWAGEN POLO 6TH GEN",
"Volkswagen T-Cross 2021": "VOLKSWAGEN T-CROSS 1ST GEN",
"Volkswagen T-Roc 2021": "VOLKSWAGEN T-ROC 1ST GEN",
"Volkswagen Taos 2022-23": "VOLKSWAGEN TAOS 1ST GEN",
"Volkswagen Teramont 2018-22": "VOLKSWAGEN ATLAS 1ST GEN",
"Volkswagen Teramont Cross Sport 2021-22": "VOLKSWAGEN ATLAS 1ST GEN",
"Volkswagen Teramont X 2021-22": "VOLKSWAGEN ATLAS 1ST GEN",
"Volkswagen Tiguan 2018-23": "VOLKSWAGEN TIGUAN 2ND GEN",
"Volkswagen Tiguan eHybrid 2021-23": "VOLKSWAGEN TIGUAN 2ND GEN",
"Volkswagen Touran 2016-23": "VOLKSWAGEN TOURAN 2ND GEN"
}
+2
View File
@@ -72,3 +72,5 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"]
# Manually checked
"HONDA CIVIC 2022" = [2.5, 1.2, 0.15]
"HONDA HR-V 2023" = [2.5, 1.2, 0.2]
"HONDA ACCORD 4CYL 9TH GEN" = [1.7, 0.35, 0.21]
+1
View File
@@ -15,6 +15,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"]
"HONDA ACCORD HYBRID 2018" = [1.6651615004829625, 0.30322180951193245, 0.2083000440586149]
"HONDA CIVIC (BOSCH) 2019" = [1.691708637466905, 0.40132900729454185, 0.25460295304024094]
"HONDA CIVIC 2016" = [1.6528895627785531, 0.4018518740819229, 0.25458812851328544]
"HONDA CLARITY 2018" = [1.6528895627785531, 0.4018518740819229, 0.25458812851328544]
"HONDA CR-V 2016" = [0.7667141440182675, 0.5927571534745969, 0.40909087636157127]
"HONDA CR-V 2017" = [2.01323205142022, 0.2700612209345081, 0.2238412881331528]
"HONDA CR-V HYBRID 2019" = [2.072034634644233, 0.7152085160516978, 0.20237105008376083]
+7 -2
View File
@@ -1,5 +1,6 @@
from cereal import car
from openpilot.common.numpy_fast import clip, interp
from openpilot.common.params import Params
from openpilot.selfdrive.car import apply_meas_steer_torque_limits, apply_std_steer_angle_limits, common_fault_avoidance, \
create_gas_interceptor_command, make_can_msg
from openpilot.selfdrive.car.toyota import toyotacan
@@ -41,6 +42,9 @@ class CarController:
self.gas = 0
self.accel = 0
self.param_s = Params()
self._reverse_acc_change = self.param_s.get_bool("ReverseAccChange")
def update(self, CC, CS, now_nanos):
actuators = CC.actuators
hud_control = CC.hudControl
@@ -137,15 +141,16 @@ class CarController:
# we can spam can to cancel the system even if we are using lat only control
if (self.frame % 3 == 0 and self.CP.openpilotLongitudinalControl) or pcm_cancel_cmd:
lead = hud_control.leadVisible or CS.out.vEgo < 12. # at low speed we always assume the lead is present so ACC can be engaged
reverse_acc = 2 if self._reverse_acc_change else 1
# Lexus IS uses a different cancellation message
if pcm_cancel_cmd and self.CP.carFingerprint in UNSUPPORTED_DSU_CAR:
can_sends.append(toyotacan.create_acc_cancel_command(self.packer))
elif self.CP.openpilotLongitudinalControl:
can_sends.append(toyotacan.create_accel_command(self.packer, pcm_accel_cmd, pcm_cancel_cmd, self.standstill_req, lead, CS.acc_type, fcw_alert))
can_sends.append(toyotacan.create_accel_command(self.packer, pcm_accel_cmd, pcm_cancel_cmd, self.standstill_req, lead, CS.acc_type, fcw_alert, reverse_acc))
self.accel = pcm_accel_cmd
else:
can_sends.append(toyotacan.create_accel_command(self.packer, 0, pcm_cancel_cmd, False, lead, CS.acc_type, False))
can_sends.append(toyotacan.create_accel_command(self.packer, 0, pcm_cancel_cmd, False, lead, CS.acc_type, False, reverse_acc))
if self.frame % 2 == 0 and self.CP.enableGasInterceptor and self.CP.openpilotLongitudinalControl:
# send exactly zero if gas cmd is zero. Interceptor will send the max between read value and gas cmd.
+102
View File
@@ -24,6 +24,13 @@ TEMP_STEER_FAULTS = (0, 9, 11, 21, 25)
# - prolonged high driver torque: 17 (permanent)
PERM_STEER_FAULTS = (3, 17)
_TRAFFIC_SINGAL_MAP = {
1: "kph",
36: "mph",
65: "No overtake",
66: "No overtake"
}
class CarState(CarStateBase):
def __init__(self, CP):
@@ -39,6 +46,7 @@ class CarState(CarStateBase):
# Need to apply an offset as soon as the steering angle measurements are both received
self.accurate_steer_angle_seen = False
self.angle_offset = FirstOrderFilter(None, 60.0, DT_CTRL, initialized=False)
self._init_traffic_signals()
self.low_speed_lockout = False
self.acc_type = 1
@@ -54,6 +62,7 @@ class CarState(CarStateBase):
ret.brakePressed = cp.vl["BRAKE_MODULE"]["BRAKE_PRESSED"] != 0
ret.brakeHoldActive = cp.vl["ESP_CONTROL"]["BRAKE_HOLD_ACTIVE"] == 1
ret.brakeLightsDEPRECATED = bool(cp.vl["ESP_CONTROL"]["BRAKE_LIGHTS_ACC"])
if self.CP.enableGasInterceptor:
ret.gas = (cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS"] + cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS2"]) // 2
ret.gasPressed = ret.gas > 805
@@ -134,6 +143,10 @@ class CarState(CarStateBase):
if not (self.CP.flags & ToyotaFlags.SMART_DSU.value):
self.acc_type = cp_acc.vl["ACC_CONTROL"]["ACC_TYPE"]
ret.stockFcw = bool(cp_acc.vl["PCS_HUD"]["FCW"])
self.gap_dist_button = cp_cam.vl["ACC_CONTROL"]["DISTANCE"]
if self.CP.flags & ToyotaFlags.SMART_DSU:
self.gap_dist_button = cp.vl["SDSU"]["FD_BUTTON"]
# some TSS2 cars have low speed lockout permanently set, so ignore on those cars
# these cars are identified by an ACC_TYPE value of 2.
@@ -163,8 +176,89 @@ class CarState(CarStateBase):
if self.CP.carFingerprint != CAR.PRIUS_V:
self.lkas_hud = copy.copy(cp_cam.vl["LKAS_HUD"])
self._update_traffic_signals(cp_cam)
ret.cruiseState.speedLimit = self._calculate_speed_limit()
return ret
def _init_traffic_signals(self):
self._tsgn1 = None
self._spdval1 = None
self._splsgn1 = None
self._tsgn2 = None
self._splsgn2 = None
self._tsgn3 = None
self._splsgn3 = None
self._tsgn4 = None
self._splsgn4 = None
def _update_traffic_signals(self, cp_cam):
# Print out car signals for traffic signal detection
tsgn1 = cp_cam.vl["RSA1"]['TSGN1']
spdval1 = cp_cam.vl["RSA1"]['SPDVAL1']
splsgn1 = cp_cam.vl["RSA1"]['SPLSGN1']
tsgn2 = cp_cam.vl["RSA1"]['TSGN2']
splsgn2 = cp_cam.vl["RSA1"]['SPLSGN2']
tsgn3 = cp_cam.vl["RSA2"]['TSGN3']
splsgn3 = cp_cam.vl["RSA2"]['SPLSGN3']
tsgn4 = cp_cam.vl["RSA2"]['TSGN4']
splsgn4 = cp_cam.vl["RSA2"]['SPLSGN4']
has_changed = tsgn1 != self._tsgn1 \
or spdval1 != self._spdval1 \
or splsgn1 != self._splsgn1 \
or tsgn2 != self._tsgn2 \
or splsgn2 != self._splsgn2 \
or tsgn3 != self._tsgn3 \
or splsgn3 != self._splsgn3 \
or tsgn4 != self._tsgn4 \
or splsgn4 != self._splsgn4
self._tsgn1 = tsgn1
self._spdval1 = spdval1
self._splsgn1 = splsgn1
self._tsgn2 = tsgn2
self._splsgn2 = splsgn2
self._tsgn3 = tsgn3
self._splsgn3 = splsgn3
self._tsgn4 = tsgn4
self._splsgn4 = splsgn4
if not has_changed:
return
print('---- TRAFFIC SIGNAL UPDATE -----')
if tsgn1 is not None and tsgn1 != 0:
print(f'TSGN1: {self._traffic_signal_description(tsgn1)}')
if spdval1 is not None and spdval1 != 0:
print(f'SPDVAL1: {spdval1}')
if splsgn1 is not None and splsgn1 != 0:
print(f'SPLSGN1: {splsgn1}')
if tsgn2 is not None and tsgn2 != 0:
print(f'TSGN2: {self._traffic_signal_description(tsgn2)}')
if splsgn2 is not None and splsgn2 != 0:
print(f'SPLSGN2: {splsgn2}')
if tsgn3 is not None and tsgn3 != 0:
print(f'TSGN3: {self._traffic_signal_description(tsgn3)}')
if splsgn3 is not None and splsgn3 != 0:
print(f'SPLSGN3: {splsgn3}')
if tsgn4 is not None and tsgn4 != 0:
print(f'TSGN4: {self._traffic_signal_description(tsgn4)}')
if splsgn4 is not None and splsgn4 != 0:
print(f'SPLSGN4: {splsgn4}')
print('------------------------')
def _traffic_signal_description(self, tsgn):
desc = _TRAFFIC_SINGAL_MAP.get(int(tsgn))
return f'{tsgn}: {desc}' if desc is not None else f'{tsgn}'
def _calculate_speed_limit(self):
if self._tsgn1 == 1:
return self._spdval1 * CV.KPH_TO_MS
if self._tsgn1 == 36:
return self._spdval1 * CV.MPH_TO_MS
return 0
@staticmethod
def get_can_parser(CP):
messages = [
@@ -213,12 +307,20 @@ class CarState(CarStateBase):
("PRE_COLLISION", 33),
]
if CP.flags & ToyotaFlags.SMART_DSU:
messages.append(("SDSU", 33))
return CANParser(DBC[CP.carFingerprint]["pt"], messages, 0)
@staticmethod
def get_cam_can_parser(CP):
messages = []
messages += [
("RSA1", 0),
("RSA2", 0),
]
if CP.carFingerprint != CAR.PRIUS_V:
messages += [
("LKAS_HUD", 1),
+11 -7
View File
@@ -1,5 +1,6 @@
from cereal import car
from openpilot.common.conversions import Conversions as CV
from openpilot.common.params import Params
from panda import Panda
from panda.python import uds
from openpilot.selfdrive.car.toyota.values import Ecu, CAR, DBC, ToyotaFlags, CarControllerParams, TSS2_CAR, RADAR_ACC_CAR, NO_DSU_CAR, \
@@ -261,18 +262,21 @@ class CarInterface(CarInterfaceBase):
# to a negative value, so it won't matter.
ret.minEnableSpeed = -1. if (stop_and_go or ret.enableGasInterceptor) else MIN_ACC_SPEED
sp_tss2_long_tune = Params().get_bool("ToyotaTSS2Long")
tune = ret.longitudinalTuning
tune.deadzoneBP = [0., 9.]
tune.deadzoneV = [.0, .15]
if candidate in TSS2_CAR or ret.enableGasInterceptor:
tune.kpBP = [0., 5., 20.]
tune.kpV = [1.3, 1.0, 0.7]
tune.kiBP = [0., 5., 12., 20., 27.]
tune.kiV = [.35, .23, .20, .17, .1]
tune.kpBP = [0., 5., 20., 30.] if sp_tss2_long_tune else [0., 5., 20.]
tune.kpV = [1.3, 1.0, 0.7, 0.1] if sp_tss2_long_tune else [1.3, 1.0, 0.7]
tune.kiBP = [0., 1., 2., 3., 4., 5., 12., 20., 27., 40.] if sp_tss2_long_tune else [0., 5., 12., 20., 27.]
tune.kiV = [.348, .3361, .3168, .2831, .2571, .226, .198, .17, .10, .01] if sp_tss2_long_tune else [.35, .23, .20, .17, .1]
if candidate in TSS2_CAR:
ret.vEgoStopping = 0.25
ret.vEgoStarting = 0.25
ret.stoppingDecelRate = 0.3 # reach stopping target smoothly
ret.vEgoStopping = 0.15 if sp_tss2_long_tune else 0.25
ret.vEgoStarting = 0.15 if sp_tss2_long_tune else 0.25
ret.stopAccel = -0.4 if sp_tss2_long_tune else 0
ret.stoppingDecelRate = 0.05 if sp_tss2_long_tune else 0.3 # reach stopping target smoothly
else:
tune.kpBP = [0., 5., 35.]
tune.kiBP = [0., 35.]
+2 -2
View File
@@ -33,7 +33,7 @@ def create_lta_steer_command(packer, steer_control_type, steer_angle, steer_req,
return packer.make_can_msg("STEERING_LTA", 0, values)
def create_accel_command(packer, accel, pcm_cancel, standstill_req, lead, acc_type, fcw_alert):
def create_accel_command(packer, accel, pcm_cancel, standstill_req, lead, acc_type, fcw_alert, reverse_acc):
# TODO: find the exact canceling bit that does not create a chime
values = {
"ACCEL_CMD": accel,
@@ -43,7 +43,7 @@ def create_accel_command(packer, accel, pcm_cancel, standstill_req, lead, acc_ty
"PERMIT_BRAKING": 1,
"RELEASE_STANDSTILL": not standstill_req,
"CANCEL_REQ": pcm_cancel,
"ALLOW_LONG_PRESS": 1,
"ALLOW_LONG_PRESS": reverse_acc,
"ACC_CUT_IN": fcw_alert, # only shown when ACC enabled
}
return packer.make_can_msg("ACC_CONTROL", 0, values)
+4
View File
@@ -73,6 +73,7 @@ class CarState(CarStateBase):
brake_pressure_detected = bool(pt_cp.vl["ESP_05"]["ESP_Fahrer_bremst"])
ret.brakePressed = brake_pedal_pressed or brake_pressure_detected
ret.parkingBrake = bool(pt_cp.vl["Kombi_01"]["KBI_Handbremse"]) # FIXME: need to include an EPB check as well
ret.brakeLightsDEPRECATED = bool(pt_cp.vl["ESP_05"]['ESP_Status_Bremsdruck'])
# Update gear and/or clutch position data.
if trans_type == TransmissionType.automatic:
@@ -144,6 +145,7 @@ class CarState(CarStateBase):
ret.rightBlinker = bool(pt_cp.vl["Blinkmodi_02"]["Comfort_Signal_Right"])
ret.buttonEvents = self.create_button_events(pt_cp, self.CCP.BUTTONS)
self.gra_stock_values = pt_cp.vl["GRA_ACC_01"]
self.gap_dist_button = pt_cp.vl["GRA_ACC_01"]["GRA_Verstellung_Zeitluecke"]
# Additional safety checks performed in CarInterface.
ret.espDisabled = pt_cp.vl["ESP_21"]["ESP_Tastung_passiv"] != 0
@@ -187,6 +189,7 @@ class CarState(CarStateBase):
ret.brake = pt_cp.vl["Bremse_5"]["Bremsdruck"] / 250.0 # FIXME: this is pressure in Bar, not sure what OP expects
ret.brakePressed = bool(pt_cp.vl["Motor_2"]["Bremslichtschalter"])
ret.parkingBrake = bool(pt_cp.vl["Kombi_1"]["Bremsinfo"])
ret.brakeLightsDEPRECATED = bool(pt_cp.vl["Motor_2"]['Bremstestschalter'])
# Update gear and/or clutch position data.
if trans_type == TransmissionType.automatic:
@@ -249,6 +252,7 @@ class CarState(CarStateBase):
pt_cp.vl["Gate_Komf_1"]["GK1_Blinker_re"])
ret.buttonEvents = self.create_button_events(pt_cp, self.CCP.BUTTONS)
self.gra_stock_values = pt_cp.vl["GRA_Neu"]
self.gap_dist_button = pt_cp.vl["GRA_Neu"]["GRA_Zeitluecke"]
# Additional safety checks performed in CarInterface.
ret.espDisabled = bool(pt_cp.vl["Bremse_1"]["ESP_Passiv_getastet"])
+1
View File
@@ -94,6 +94,7 @@ class CarInterface(CarInterfaceBase):
ret.minEnableSpeed = 4.5
ret.pcmCruise = not ret.openpilotLongitudinalControl
ret.customStockLongAvailable = True
ret.stoppingControl = True
ret.stopAccel = -0.55
ret.vEgoStarting = 0.1
+13 -4
View File
@@ -202,7 +202,7 @@ class Controls:
self.sm = messaging.SubMaster(['deviceState', 'pandaStates', 'peripheralState', 'modelV2', 'liveCalibration',
'driverMonitoringState', 'longitudinalPlan', 'liveLocationKalman',
'managerState', 'liveParameters', 'radarState', 'liveTorqueParameters',
'testJoystick'] + self.camera_packets + self.sensor_packets,
'testJoystick', 'longitudinalPlanSP', 'modelV2SP'] + self.camera_packets + self.sensor_packets,
ignore_alive=ignore, ignore_avg_freq=ignore+['radarState', 'testJoystick'], ignore_valid=['testJoystick', ],
frequency=int(1/DT_CTRL))
@@ -265,6 +265,8 @@ class Controls:
self.v_cruise_helper = VCruiseHelper(self.CP)
self.recalibrating_seen = False
self.reverse_acc_change = False
self.can_log_mono_time = 0
self.startup_event = get_startup_event(car_recognized, controller_available, len(self.CP.carFw) > 0)
@@ -336,6 +338,7 @@ class Controls:
if not self.CP.notCar:
self.events.add_from_msg(self.sm['driverMonitoringState'].events)
self.events.add_from_msg(self.sm['longitudinalPlanSP'].events)
# Add car events, ignore if CAN isn't valid
if CS.canValid:
@@ -378,16 +381,20 @@ class Controls:
self.events.add(EventName.calibrationInvalid)
# Handle lane change
lane_change_set_timer = int(self.params.get("AutoLaneChangeTimer", encoding="utf8"))
if self.sm['modelV2'].meta.laneChangeState == LaneChangeState.preLaneChange:
direction = self.sm['modelV2'].meta.laneChangeDirection
lc_prev = self.sm['modelV2SP'].laneChangePrev
if (CS.leftBlindspot and direction == LaneChangeDirection.left) or \
(CS.rightBlindspot and direction == LaneChangeDirection.right):
self.events.add(EventName.laneChangeBlocked)
else:
if direction == LaneChangeDirection.left:
self.events.add(EventName.preLaneChangeLeft)
self.events.add(EventName.preLaneChangeLeft) if lane_change_set_timer == 0 or lc_prev else \
self.events.add(EventName.laneChange)
else:
self.events.add(EventName.preLaneChangeRight)
self.events.add(EventName.preLaneChangeRight) if lane_change_set_timer == 0 or lc_prev else \
self.events.add(EventName.laneChange)
elif self.sm['modelV2'].meta.laneChangeState in (LaneChangeState.laneChangeStarting,
LaneChangeState.laneChangeFinishing):
self.events.add(EventName.laneChange)
@@ -562,7 +569,7 @@ class Controls:
def state_transition(self, CS):
"""Compute conditional state transitions and execute actions on state transitions"""
self.v_cruise_helper.update_v_cruise(CS, self.enabled, self.is_metric)
self.v_cruise_helper.update_v_cruise(CS, self.enabled, self.is_metric, self.reverse_acc_change)
# decrement the soft disable timer at every step, as it's reset on
# entrance in SOFT_DISABLING state
@@ -920,6 +927,8 @@ class Controls:
def step(self):
start_time = time.monotonic()
self.reverse_acc_change = self.params.get_bool("ReverseAccChange")
# Sample data from sockets and get a carState
CS = self.data_sample()
cloudlog.timestamp("Data sampled")
+18 -2
View File
@@ -1,5 +1,6 @@
from cereal import log
from openpilot.common.conversions import Conversions as CV
from openpilot.common.params import Params
from openpilot.common.realtime import DT_MDL
LaneChangeState = log.LaneChangeState
@@ -40,7 +41,15 @@ class DesireHelper:
self.prev_one_blinker = False
self.desire = log.Desire.none
self.param_s = Params()
self.lane_change_wait_timer = 0
self.prev_lane_change = False
def update(self, carstate, lateral_active, lane_change_prob):
lane_change_set_timer = int(self.param_s.get("AutoLaneChangeTimer", encoding="utf8"))
lane_change_auto_timer = 0.0 if lane_change_set_timer == 0 else 0.1 if lane_change_set_timer == 1 else \
0.5 if lane_change_set_timer == 2 else 1.0 if lane_change_set_timer == 3 else \
1.5 if lane_change_set_timer == 4 else 2.0
v_ego = carstate.vEgo
one_blinker = carstate.leftBlinker != carstate.rightBlinker
below_lane_change_speed = v_ego < LANE_CHANGE_SPEED_MIN
@@ -48,11 +57,13 @@ class DesireHelper:
if not lateral_active or self.lane_change_timer > LANE_CHANGE_TIME_MAX:
self.lane_change_state = LaneChangeState.off
self.lane_change_direction = LaneChangeDirection.none
self.prev_lane_change = False
else:
# LaneChangeState.off
if self.lane_change_state == LaneChangeState.off and one_blinker and not self.prev_one_blinker and not below_lane_change_speed:
if self.lane_change_state == LaneChangeState.off and one_blinker and not self.prev_one_blinker and not below_lane_change_speed and not carstate.brakePressed:
self.lane_change_state = LaneChangeState.preLaneChange
self.lane_change_ll_prob = 1.0
self.lane_change_wait_timer = 0
# LaneChangeState.preLaneChange
elif self.lane_change_state == LaneChangeState.preLaneChange:
@@ -67,11 +78,15 @@ class DesireHelper:
blindspot_detected = ((carstate.leftBlindspot and self.lane_change_direction == LaneChangeDirection.left) or
(carstate.rightBlindspot and self.lane_change_direction == LaneChangeDirection.right))
self.lane_change_wait_timer += DT_MDL
if not one_blinker or below_lane_change_speed:
self.lane_change_state = LaneChangeState.off
self.lane_change_direction = LaneChangeDirection.none
elif torque_applied and not blindspot_detected:
self.prev_lane_change = False
elif (torque_applied or ((lane_change_auto_timer and self.lane_change_wait_timer > lane_change_auto_timer) and not self.prev_lane_change)) and \
not blindspot_detected:
self.lane_change_state = LaneChangeState.laneChangeStarting
self.prev_lane_change = True
# LaneChangeState.laneChangeStarting
elif self.lane_change_state == LaneChangeState.laneChangeStarting:
@@ -93,6 +108,7 @@ class DesireHelper:
self.lane_change_state = LaneChangeState.preLaneChange
else:
self.lane_change_state = LaneChangeState.off
self.prev_lane_change = False
if self.lane_change_state in (LaneChangeState.off, LaneChangeState.preLaneChange):
self.lane_change_timer = 0.0
+8 -5
View File
@@ -49,13 +49,13 @@ class VCruiseHelper:
def v_cruise_initialized(self):
return self.v_cruise_kph != V_CRUISE_UNSET
def update_v_cruise(self, CS, enabled, is_metric):
def update_v_cruise(self, CS, enabled, is_metric, reverse_acc):
self.v_cruise_kph_last = self.v_cruise_kph
if CS.cruiseState.available:
if not self.CP.pcmCruise:
# if stock cruise is completely disabled, then we can use our own set speed logic
self._update_v_cruise_non_pcm(CS, enabled, is_metric)
self._update_v_cruise_non_pcm(CS, enabled, is_metric, reverse_acc)
self.v_cruise_cluster_kph = self.v_cruise_kph
self.update_button_timers(CS, enabled)
else:
@@ -65,7 +65,7 @@ class VCruiseHelper:
self.v_cruise_kph = V_CRUISE_UNSET
self.v_cruise_cluster_kph = V_CRUISE_UNSET
def _update_v_cruise_non_pcm(self, CS, enabled, is_metric):
def _update_v_cruise_non_pcm(self, CS, enabled, is_metric, reverse_acc):
# handle button presses. TODO: this should be in state_control, but a decelCruise press
# would have the effect of both enabling and changing speed is checked after the state transition
if not enabled:
@@ -75,6 +75,7 @@ class VCruiseHelper:
button_type = None
v_cruise_delta = 1. if is_metric else IMPERIAL_INCREMENT
v_cruise_delta_mltplr = 10 if is_metric else 5
for b in CS.buttonEvents:
if b.type.raw in self.button_timers and not b.pressed:
@@ -101,8 +102,10 @@ class VCruiseHelper:
if not self.button_change_states[button_type]["enabled"]:
return
v_cruise_delta = v_cruise_delta * (5 if long_press else 1)
if long_press and self.v_cruise_kph % v_cruise_delta != 0: # partial interval
pressed_value = (1 if long_press else v_cruise_delta_mltplr) if reverse_acc else (v_cruise_delta_mltplr if long_press else 1)
long_press_state = not long_press if reverse_acc else long_press
v_cruise_delta = v_cruise_delta * pressed_value
if long_press_state and self.v_cruise_kph % v_cruise_delta != 0: # partial interval
self.v_cruise_kph = CRUISE_NEAREST_FUNC[button_type](self.v_cruise_kph / v_cruise_delta) * v_cruise_delta
else:
self.v_cruise_kph += v_cruise_delta * CRUISE_INTERVAL_SIGN[button_type]
+42
View File
@@ -331,6 +331,16 @@ def joystick_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster,
vals = f"Gas: {round(gb * 100.)}%, Steer: {round(steer * 100.)}%"
return NormalPermanentAlert("Joystick Mode", vals)
def speed_limit_adjust_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert:
speedLimit = sm['longitudinalPlanSP'].speedLimit
speed = round(speedLimit * (CV.MS_TO_KPH if metric else CV.MS_TO_MPH))
message = f'Adjusting to {speed} {"km/h" if metric else "mph"} speed limit'
return Alert(
message,
"",
AlertStatus.normal, AlertSize.small,
Priority.LOW, VisualAlert.none, AudibleAlert.none, 4.)
EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
@@ -480,6 +490,26 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
Priority.HIGH, VisualAlert.steerRequired, AudibleAlert.warningImmediate, .1),
},
EventName.preKeepHandsOnWheel: {
ET.WARNING: Alert(
"No hands on steering wheel detected",
"",
AlertStatus.userPrompt, AlertSize.small,
Priority.MID, VisualAlert.steerRequired, AudibleAlert.none, .1, alert_rate=0.75),
},
EventName.promptKeepHandsOnWheel: {
ET.WARNING: Alert(
"HANDS OFF STEERING WHEEL",
"Place hands on steering wheel",
AlertStatus.critical, AlertSize.mid,
Priority.MID, VisualAlert.steerRequired, AudibleAlert.promptDistracted, .1),
},
EventName.keepHandsOnWheel: {
ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("Driver kept hands off sterring wheel"),
},
EventName.manualRestart: {
ET.WARNING: Alert(
"TAKE CONTROL",
@@ -593,6 +623,18 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
ET.PERMANENT: NormalPermanentAlert("paramsd Permanent Error"),
},
EventName.speedLimitActive: {
ET.WARNING: Alert(
"Cruise set to speed limit",
"",
AlertStatus.normal, AlertSize.small,
Priority.LOW, VisualAlert.none, AudibleAlert.none, 2.),
},
EventName.speedLimitValueChange: {
ET.WARNING: speed_limit_adjust_alert,
},
# ********** events that affect controls state transitions **********
EventName.pcmEnable: {
@@ -15,6 +15,7 @@ from openpilot.selfdrive.controls.lib.longcontrol import LongCtrlState
from openpilot.selfdrive.controls.lib.longitudinal_mpc_lib.long_mpc import LongitudinalMpc
from openpilot.selfdrive.controls.lib.longitudinal_mpc_lib.long_mpc import T_IDXS as T_IDXS_MPC
from openpilot.selfdrive.controls.lib.drive_helpers import V_CRUISE_MAX, CONTROL_N, get_speed_error
from openpilot.selfdrive.controls.lib.events import Events
from openpilot.common.swaglog import cloudlog
LON_MPC_STEP = 0.2 # first step is 0.2s
@@ -66,6 +67,8 @@ class LongitudinalPlanner:
self.read_param()
self.personality = log.LongitudinalPersonality.standard
self.events = Events()
def read_param(self):
try:
self.personality = int(self.params.get('LongitudinalPersonality'))
@@ -173,3 +176,13 @@ class LongitudinalPlanner:
longitudinalPlan.personality = self.personality
pm.send('longitudinalPlan', plan_send)
plan_sp_send = messaging.new_message('longitudinalPlanSP')
plan_sp_send.valid = sm.all_checks(service_list=['carState', 'controlsState'])
longitudinalPlanSP = plan_sp_send.longitudinalPlanSP
longitudinalPlanSP.events = self.events.to_msg()
pm.send('longitudinalPlanSP', plan_sp_send)
+1 -1
View File
@@ -27,7 +27,7 @@ def plannerd_thread():
cloudlog.info("plannerd got CarParams: %s", CP.carName)
longitudinal_planner = LongitudinalPlanner(CP)
pm = messaging.PubMaster(['longitudinalPlan', 'uiPlan'])
pm = messaging.PubMaster(['longitudinalPlan', 'uiPlan', 'longitudinalPlanSP'])
sm = messaging.SubMaster(['carControl', 'carState', 'controlsState', 'radarState', 'modelV2'],
poll='modelV2', ignore_avg_freq=['radarState'])
+1 -1
View File
@@ -55,7 +55,7 @@ def cycle_alerts(duration=200, is_metric=False):
CP = CarInterface.get_non_essential_params("HONDA CIVIC 2016")
sm = messaging.SubMaster(['deviceState', 'pandaStates', 'roadCameraState', 'modelV2', 'liveCalibration',
'driverMonitoringState', 'longitudinalPlan', 'liveLocationKalman',
'managerState'] + cameras)
'managerState', 'longitudinalPlanSP', 'driverMonitoringStateSP'] + cameras)
pm = messaging.PubMaster(['controlsState', 'pandaStates', 'deviceState'])
@@ -0,0 +1,80 @@
#!/usr/bin/env python3
# type: ignore
import os
import argparse
import signal
import sys
import cereal.messaging as messaging
from cereal import custom
from selfdrive.monitoring.hands_on_wheel_monitor import HandsOnWheelStatus
from selfdrive.controls.lib.events import Events
HandsOnWheelState = custom.DriverMonitoringStateSP.HandsOnWheelState
def sigint_handler(signal, frame):
print("handler!")
exit(0)
signal.signal(signal.SIGINT, sigint_handler)
def status_monitor():
# use driverState socker to drive timing.
driverState = messaging.sub_sock('driverState', addr=args.addr, conflate=True)
sm = messaging.SubMaster(['carState', 'dMonitoringState'], addr=args.addr)
steering_status = HandsOnWheelStatus()
v_cruise_last = 0
while messaging.recv_one(driverState):
try:
sm.update()
v_cruise = sm['carState'].cruiseState.speed
steering_wheel_engaged = len(sm['carState'].buttonEvents) > 0 or \
v_cruise != v_cruise_last or sm['carState'].steeringPressed
v_cruise_last = v_cruise
# Get status from our own instance of SteeringStatus
steering_status.update(Events(), steering_wheel_engaged, sm['carState'].cruiseState.enabled, sm['carState'].vEgo)
steering_state = steering_status.hands_on_wheel_state
state_name = "Unknown "
if steering_state == HandsOnWheelState.none:
state_name = "Not Active "
elif steering_state == HandsOnWheelState.ok:
state_name = "Hands On Wheel "
elif steering_state == HandsOnWheelState.minor:
state_name = "Hands Off Wheel - Minor "
elif steering_state == HandsOnWheelState.warning:
state_name = "Hands Off Wheel - Warning "
elif steering_state == HandsOnWheelState.critical:
state_name = "Hands Off Wheel - Critical"
elif steering_state == HandsOnWheelState.terminal:
state_name = "Hands Off Wheel - Terminal"
# Get events from `dMonitoringState`
events = sm['dMonitoringState'].events
event_name = events[0].name if len(events) else "None"
event_name = "{:<30}".format(event_name[:30])
# Print output
sys.stdout.write(f'\rSteering State: {state_name} | event: {event_name}')
sys.stdout.flush()
except Exception as e:
print(e)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Sniff a communication socket')
parser.add_argument('--addr', default='127.0.0.1')
args = parser.parse_args()
if args.addr != "127.0.0.1":
os.environ["ZMQ"] = "1"
messaging.context = messaging.Context()
status_monitor()
+61 -1
View File
@@ -21,7 +21,6 @@ from openpilot.system.version import is_dirty, get_commit, get_version, get_orig
is_tested_branch, is_release_branch, get_commit_date
def manager_init() -> None:
save_bootlog()
@@ -40,6 +39,63 @@ def manager_init() -> None:
("LanguageSetting", "main_en"),
("OpenpilotEnabledToggle", "1"),
("LongitudinalPersonality", str(log.LongitudinalPersonality.standard)),
("AccMadsCombo", "1"),
("AutoLaneChangeTimer", "0"),
("AutoLaneChangeBsmDelay", "1"),
("BelowSpeedPause", "0"),
("BrakeLights", "0"),
("BrightnessControl", "0"),
("CustomTorqueLateral", "0"),
("CameraControl", "2"),
("CameraControlToggle", "0"),
("CameraOffset", "0"),
("CarModel", ""),
("CarModelText", ""),
("ChevronInfo", "1"),
("MadsCruiseMain", "1"),
("CustomBootScreen", "0"),
("CustomOffsets", "0"),
("DevUI", "1"),
("DevUIInfo", "1"),
("DisableOnroadUploads", "0"),
("DisengageLateralOnBrake", "0"),
("DynamicLaneProfile", "1"),
("DynamicLaneProfileToggle", "0"),
("EnableMads", "1"),
("EnhancedScc", "0"),
("GapAdjustCruise", "1"),
("GapAdjustCruiseMax", "0"),
("GapAdjustCruiseMin", "0"),
("GapAdjustCruiseMode", "0"),
("GapAdjustCruiseTr", "3"),
("HandsOnWheelMonitoring", "0"),
("HideVEgoUi", "0"),
("LastSpeedLimitSignTap", "0"),
("LkasToggle", "0"),
("MadsIconToggle", "1"),
("MaxTimeOffroad", "9"),
("OnroadScreenOff", "-2"),
("OnroadScreenOffBrightness", "50"),
("OnroadScreenOffEvent", "1"),
("PathOffset", "0"),
("ReverseAccChange", "0"),
("ScreenRecorder", "1"),
("ShowDebugUI", "1"),
("SpeedLimitControl", "1"),
("SpeedLimitPercOffset", "1"),
("SpeedLimitValueOffset", "0"),
("SpeedLimitOffsetType", "0"),
("StandStillTimer", "0"),
("StockLongToyota", "0"),
("TorqueDeadzoneDeg", "0"),
("TorqueFriction", "1"),
("TorqueMaxLatAccel", "250"),
("TrueVEgoUi", "0"),
("TurnSpeedControl", "0"),
("TurnVisionControl", "0"),
("VisionCurveLaneless", "0"),
("VwAccType", "0"),
]
if not PC:
default_params.append(("LastUpdateTime", datetime.datetime.utcnow().isoformat().encode('utf8')))
@@ -52,6 +108,10 @@ def manager_init() -> None:
if params.get(k) is None:
params.put(k, v)
# parameters set by Environment Variables
if os.getenv("HANDSMONITORING") is not None:
params.put_bool("HandsOnWheelMonitoring", bool(int(os.getenv("HANDSMONITORING", "0"))))
# Create folders needed for msgq
try:
os.mkdir("/dev/shm")
+2
View File
@@ -82,6 +82,8 @@ procs = [
PythonProcess("uploader", "system.loggerd.uploader", always_run),
PythonProcess("statsd", "selfdrive.statsd", always_run),
PythonProcess("fleet_manager", "system.fleetmanager.fleet_manager", always_run), # TODO: Handle sigkill properly
# debug procs
NativeProcess("bridge", "cereal/messaging", ["./bridge"], notcar),
PythonProcess("webrtcd", "system.webrtc.webrtcd", notcar),
+5 -1
View File
@@ -152,7 +152,7 @@ def main(demo=False):
cloudlog.warning(f"connected extra cam with buffer size: {vipc_client_extra.buffer_len} ({vipc_client_extra.width} x {vipc_client_extra.height})")
# messaging
pm = PubMaster(["modelV2", "cameraOdometry"])
pm = PubMaster(["modelV2", "modelV2SP", "cameraOdometry"])
sm = SubMaster(["carState", "roadCameraState", "liveCalibration", "driverMonitoringState", "navModel", "navInstruction", "carControl"])
publish_state = PublishState()
@@ -289,6 +289,7 @@ def main(demo=False):
if model_output is not None:
modelv2_send = messaging.new_message('modelV2')
modelv2_sp_send = messaging.new_message('modelV2SP')
posenet_send = messaging.new_message('cameraOdometry')
fill_model_msg(modelv2_send, model_output, publish_state, meta_main.frame_id, meta_extra.frame_id, frame_id, frame_drop_ratio,
meta_main.timestamp_eof, timestamp_llk, model_execution_time, nav_enabled, live_calib_seen)
@@ -300,9 +301,12 @@ def main(demo=False):
DH.update(sm['carState'], sm['carControl'].latActive, lane_change_prob)
modelv2_send.modelV2.meta.laneChangeState = DH.lane_change_state
modelv2_send.modelV2.meta.laneChangeDirection = DH.lane_change_direction
modelv2_sp_send.valid = True
modelv2_sp_send.modelV2SP.laneChangePrev = DH.prev_lane_change
fill_pose_msg(posenet_send, model_output, meta_main.frame_id, vipc_dropped_frames, meta_main.timestamp_eof, live_calib_seen)
pm.send('modelV2', modelv2_send)
pm.send('modelV2SP', modelv2_sp_send)
pm.send('cameraOdometry', posenet_send)
last_vipc_frame_id = meta_main.frame_id
+21 -5
View File
@@ -7,6 +7,7 @@ from openpilot.common.params import Params
from openpilot.common.realtime import set_realtime_priority
from openpilot.selfdrive.controls.lib.events import Events
from openpilot.selfdrive.monitoring.driver_monitor import DriverStatus
from openpilot.selfdrive.monitoring.hands_on_wheel_monitor import HandsOnWheelStatus
def dmonitoringd_thread():
@@ -14,13 +15,16 @@ def dmonitoringd_thread():
set_realtime_priority(2)
params = Params()
pm = messaging.PubMaster(['driverMonitoringState'])
pm = messaging.PubMaster(['driverMonitoringState', 'driverMonitoringStateSP'])
sm = messaging.SubMaster(['driverStateV2', 'liveCalibration', 'carState', 'controlsState', 'modelV2'], poll='driverStateV2')
driver_status = DriverStatus(rhd_saved=params.get_bool("IsRhdDetected"))
hands_on_wheel_status = HandsOnWheelStatus()
v_cruise_last = 0
driver_engaged = False
steering_wheel_engaged = False
hands_on_wheel_monitoring_enabled = params.get_bool("HandsOnWheelMonitoring")
# 10Hz <- dmonitoringmodeld
while True:
@@ -31,10 +35,13 @@ def dmonitoringd_thread():
# Get interaction
if sm.updated['carState']:
v_cruise = sm['carState'].cruiseState.speed
driver_engaged = len(sm['carState'].buttonEvents) > 0 or \
v_cruise != v_cruise_last or \
sm['carState'].steeringPressed or \
sm['carState'].gasPressed
steering_wheel_engaged = len(sm['carState'].buttonEvents) > 0 or \
v_cruise != v_cruise_last or \
sm['carState'].steeringPressed
driver_engaged = steering_wheel_engaged or sm['carState'].gasPressed
# Update events and state from hands on wheel monitoring status when steering wheel in engaged
if steering_wheel_engaged and hands_on_wheel_monitoring_enabled:
hands_on_wheel_status.update(Events(), True, sm['controlsState'].enabled, sm['carState'].vEgo)
v_cruise_last = v_cruise
if sm.updated['modelV2']:
@@ -53,6 +60,9 @@ def dmonitoringd_thread():
# Update events from driver state
driver_status.update_events(events, driver_engaged, sm['controlsState'].enabled, sm['carState'].standstill)
# Update events and state from hands on wheel monitoring status
if hands_on_wheel_monitoring_enabled:
hands_on_wheel_status.update(events, steering_wheel_engaged, sm['controlsState'].enabled, sm['carState'].vEgo)
# build driverMonitoringState packet
dat = messaging.new_message('driverMonitoringState', valid=sm.all_checks())
@@ -76,6 +86,12 @@ def dmonitoringd_thread():
}
pm.send('driverMonitoringState', dat)
sp_dat = messaging.new_message('driverMonitoringStateSP')
sp_dat.driverMonitoringStateSP = {
"handsOnWheelState": hands_on_wheel_status.hands_on_wheel_state,
}
pm.send('driverMonitoringStateSP', sp_dat)
# save rhd virtual toggle every 5 mins
if (sm['driverStateV2'].frameId % 6000 == 0 and
driver_status.wheelpos_learner.filtered_stat.n > driver_status.settings._WHEELPOS_FILTER_MIN_COUNT and
@@ -0,0 +1,51 @@
from cereal import custom, car
from common.conversions import Conversions as CV
EventName = car.CarEvent.EventName
HandsOnWheelState = custom.DriverMonitoringStateSP.HandsOnWheelState
_PRE_ALERT_THRESHOLD = 150 # 15s
_PROMPT_ALERT_THRESHOLD = 300 # 30s
_TERMINAL_ALERT_THRESHOLD = 600 # 60s
_MIN_MONITORING_SPEED = 10 * CV.KPH_TO_MS # No monitoring underd 10kph
class HandsOnWheelStatus():
def __init__(self):
self.hands_on_wheel_state = HandsOnWheelState.none
self.hands_off_wheel_cnt = 0
def update(self, events, steering_wheel_engaged, ctrl_active, v_ego):
if v_ego < _MIN_MONITORING_SPEED or not ctrl_active:
self.hands_on_wheel_state = HandsOnWheelState.none
self.hands_off_wheel_cnt = 0
return
if steering_wheel_engaged:
# Driver has hands on steering wheel
self.hands_on_wheel_state = HandsOnWheelState.ok
self.hands_off_wheel_cnt = 0
return
self.hands_off_wheel_cnt += 1
alert = None
if self.hands_off_wheel_cnt >= _TERMINAL_ALERT_THRESHOLD:
# terminal red alert: disengagement required
self.hands_on_wheel_state = HandsOnWheelState.terminal
alert = EventName.keepHandsOnWheel
elif self.hands_off_wheel_cnt >= _PROMPT_ALERT_THRESHOLD:
# prompt orange alert
self.hands_on_wheel_state = HandsOnWheelState.critical
alert = EventName.promptKeepHandsOnWheel
elif self.hands_off_wheel_cnt >= _PRE_ALERT_THRESHOLD:
# pre green alert
self.hands_on_wheel_state = HandsOnWheelState.warning
alert = EventName.preKeepHandsOnWheel
else:
# hands off wheel for acceptable period of time.
self.hands_on_wheel_state = HandsOnWheelState.minor
if alert is not None:
events.add(alert)
@@ -0,0 +1,139 @@
# flake8: noqa
import unittest
import numpy as np
from cereal import car, custom
from common.realtime import DT_DMON
from selfdrive.controls.lib.events import Events
from selfdrive.monitoring.hands_on_wheel_monitor import HandsOnWheelStatus, _PRE_ALERT_THRESHOLD, \
_PROMPT_ALERT_THRESHOLD, _TERMINAL_ALERT_THRESHOLD, \
_MIN_MONITORING_SPEED
EventName = car.CarEvent.EventName
HandsOnWheelState = custom.DriverMonitoringStateSP.HandsOnWheelState
_TEST_TIMESPAN = 120 # seconds
# some common state vectors
test_samples = int(_TEST_TIMESPAN / DT_DMON)
half_test_samples = int(test_samples / 2.)
always_speed_over_threshold = [_MIN_MONITORING_SPEED + 1.] * test_samples
always_speed_under_threshold = [_MIN_MONITORING_SPEED - 1.] * test_samples
always_true = [True] * test_samples
always_false = [False] * test_samples
true_then_false = [True] * half_test_samples + [False] * (test_samples - half_test_samples)
def run_HOWState_seq(steering_wheel_interaction, openpilot_status, speed_status):
# inputs are all 10Hz
HOWS = HandsOnWheelStatus()
events_from_HOWM = []
hands_on_wheel_state_from_HOWM = []
for idx in range(len(steering_wheel_interaction)):
e = Events()
# evaluate events at 10Hz for tests
HOWS.update(e, steering_wheel_interaction[idx], openpilot_status[idx], speed_status[idx])
events_from_HOWM.append(e)
hands_on_wheel_state_from_HOWM.append(HOWS.hands_on_wheel_state)
assert len(events_from_HOWM) == len(steering_wheel_interaction), 'somethings wrong'
assert len(hands_on_wheel_state_from_HOWM) == len(steering_wheel_interaction), 'somethings wrong'
return events_from_HOWM, hands_on_wheel_state_from_HOWM
class TestHandsMonitoring(unittest.TestCase):
# 0. op engaged over monitoring speed, driver has hands on wheel all the time
def test_hands_on_all_the_time(self):
events_output, state_output = run_HOWState_seq(always_true, always_true, always_speed_over_threshold)
self.assertTrue(np.sum([len(event) for event in events_output]) == 0)
self.assertEqual(state_output, [HandsOnWheelState.ok for x in range(len(state_output))])
# 1. op engaged under monitoring speed, steering wheel interaction is irrelevant
def test_monitoring_under_threshold_speed(self):
events_output, state_output = run_HOWState_seq(true_then_false, always_true, always_speed_under_threshold)
self.assertTrue(np.sum([len(event) for event in events_output]) == 0)
self.assertEqual(state_output, [HandsOnWheelState.none for x in range(len(state_output))])
# 2. op engaged over monitoring speed, driver has no hands on wheel all the time
def test_hands_off_all_the_time(self):
events_output, state_output = run_HOWState_seq(always_false, always_true, always_speed_over_threshold)
# Assert correctness before _PRE_ALERT_THRESHOLD
self.assertTrue(np.sum([len(event) for event in events_output[:_PRE_ALERT_THRESHOLD - 1]]) == 0)
self.assertEqual(state_output[:_PRE_ALERT_THRESHOLD - 1],
[HandsOnWheelState.minor for x in range(_PRE_ALERT_THRESHOLD - 1)])
# Assert correctness before _PROMPT_ALERT_THRESHOLD
self.assertEqual([event.names[0] for event in events_output[_PRE_ALERT_THRESHOLD:_PROMPT_ALERT_THRESHOLD - 1]],
[EventName.preKeepHandsOnWheel for x in range(_PROMPT_ALERT_THRESHOLD - 1 - _PRE_ALERT_THRESHOLD)])
self.assertEqual(state_output[_PRE_ALERT_THRESHOLD:_PROMPT_ALERT_THRESHOLD - 1],
[HandsOnWheelState.warning for x in range(_PROMPT_ALERT_THRESHOLD - 1 - _PRE_ALERT_THRESHOLD)])
# Assert correctness before _TERMINAL_ALERT_THRESHOLD
self.assertEqual(
[event.names[0] for event in events_output[_PROMPT_ALERT_THRESHOLD:_TERMINAL_ALERT_THRESHOLD - 1]],
[EventName.promptKeepHandsOnWheel for x in range(_TERMINAL_ALERT_THRESHOLD - 1 - _PROMPT_ALERT_THRESHOLD)])
self.assertEqual(
state_output[_PROMPT_ALERT_THRESHOLD:_TERMINAL_ALERT_THRESHOLD - 1],
[HandsOnWheelState.critical for x in range(_TERMINAL_ALERT_THRESHOLD - 1 - _PROMPT_ALERT_THRESHOLD)])
# Assert correctness after _TERMINAL_ALERT_THRESHOLD
self.assertEqual([event.names[0] for event in events_output[_TERMINAL_ALERT_THRESHOLD:]],
[EventName.keepHandsOnWheel for x in range(test_samples - _TERMINAL_ALERT_THRESHOLD)])
self.assertEqual(state_output[_TERMINAL_ALERT_THRESHOLD:],
[HandsOnWheelState.terminal for x in range(test_samples - _TERMINAL_ALERT_THRESHOLD)])
# 3. op engaged over monitoring speed, alert status resets to none when going under monitoring speed
def test_status_none_when_speeds_goes_down(self):
speed_vector = always_speed_over_threshold[:-1] + [_MIN_MONITORING_SPEED - 1.]
events_output, state_output = run_HOWState_seq(always_false, always_true, speed_vector)
# Assert correctness after _TERMINAL_ALERT_THRESHOLD
self.assertEqual([event.names[0] for event in events_output[_TERMINAL_ALERT_THRESHOLD:test_samples - 1]],
[EventName.keepHandsOnWheel for x in range(test_samples - 1 - _TERMINAL_ALERT_THRESHOLD)])
self.assertEqual(state_output[_TERMINAL_ALERT_THRESHOLD:test_samples - 1],
[HandsOnWheelState.terminal for x in range(test_samples - 1 - _TERMINAL_ALERT_THRESHOLD)])
# Assert correctes on last sample where speed went under monitoring threshold
self.assertEqual(len(events_output[-1]), 0)
self.assertEqual(state_output[-1], HandsOnWheelState.none)
# 4. op engaged over monitoring speed, alert status resets to ok when user interacts with steering wheel,
# process repeats once hands are off wheel.
def test_status_ok_after_interaction_with_wheel(self):
interaction_vector = always_false[:_TERMINAL_ALERT_THRESHOLD] + [True
] + always_false[_TERMINAL_ALERT_THRESHOLD + 1:]
events_output, state_output = run_HOWState_seq(interaction_vector, always_true, always_speed_over_threshold)
# Assert correctness after _TERMINAL_ALERT_THRESHOLD
self.assertEqual(events_output[_TERMINAL_ALERT_THRESHOLD - 1].names[0], EventName.keepHandsOnWheel)
self.assertEqual(state_output[_TERMINAL_ALERT_THRESHOLD - 1], HandsOnWheelState.terminal)
# Assert correctness for one sample when user interacts with steering wheel
self.assertEqual(len(events_output[_TERMINAL_ALERT_THRESHOLD]), 0)
self.assertEqual(state_output[_TERMINAL_ALERT_THRESHOLD], HandsOnWheelState.ok)
# Assert process correctness on second run
offset = _TERMINAL_ALERT_THRESHOLD + 1
self.assertTrue(np.sum([len(event) for event in events_output[offset:offset + _PRE_ALERT_THRESHOLD - 1]]) == 0)
self.assertEqual(state_output[offset:offset + _PRE_ALERT_THRESHOLD - 1],
[HandsOnWheelState.minor for x in range(_PRE_ALERT_THRESHOLD - 1)])
self.assertEqual(
[event.names[0] for event in events_output[offset + _PRE_ALERT_THRESHOLD:offset + _PROMPT_ALERT_THRESHOLD - 1]],
[EventName.preKeepHandsOnWheel for x in range(_PROMPT_ALERT_THRESHOLD - 1 - _PRE_ALERT_THRESHOLD)])
self.assertEqual(state_output[offset + _PRE_ALERT_THRESHOLD:offset + _PROMPT_ALERT_THRESHOLD - 1],
[HandsOnWheelState.warning for x in range(_PROMPT_ALERT_THRESHOLD - 1 - _PRE_ALERT_THRESHOLD)])
self.assertEqual([
event.names[0]
for event in events_output[offset + _PROMPT_ALERT_THRESHOLD:offset + _TERMINAL_ALERT_THRESHOLD - 1]
], [EventName.promptKeepHandsOnWheel for x in range(_TERMINAL_ALERT_THRESHOLD - 1 - _PROMPT_ALERT_THRESHOLD)])
self.assertEqual(
state_output[offset + _PROMPT_ALERT_THRESHOLD:offset + _TERMINAL_ALERT_THRESHOLD - 1],
[HandsOnWheelState.critical for x in range(_TERMINAL_ALERT_THRESHOLD - 1 - _PROMPT_ALERT_THRESHOLD)])
self.assertEqual([event.names[0] for event in events_output[offset + _TERMINAL_ALERT_THRESHOLD:]],
[EventName.keepHandsOnWheel for x in range(test_samples - offset - _TERMINAL_ALERT_THRESHOLD)])
self.assertEqual(state_output[offset + _TERMINAL_ALERT_THRESHOLD:],
[HandsOnWheelState.terminal for x in range(test_samples - offset - _TERMINAL_ALERT_THRESHOLD)])
# 5. op not engaged, always hands off wheel
# - monitor should stay quiet when not engaged
def test_pure_dashcam_user(self):
events_output, state_output = run_HOWState_seq(always_false, always_false, always_speed_over_threshold)
self.assertTrue(np.sum([len(event) for event in events_output]) == 0)
self.assertEqual(state_output, [HandsOnWheelState.none for x in range(len(state_output))])
if __name__ == "__main__":
unittest.main()
+459
View File
@@ -0,0 +1,459 @@
#!/usr/bin/env python3.8
# The MIT License
#
# Copyright (c) 2019-, Rick Lan, dragonpilot community, and a number of other of contributors.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
from http.server import BaseHTTPRequestHandler, HTTPServer
from cgi import parse_header, parse_multipart
from urllib.parse import parse_qs, unquote
import json
import requests
import math
from common.basedir import BASEDIR
from common.params import Params
params = Params()
hostName = ""
serverPort = 8082
pi = 3.1415926535897932384626
x_pi = 3.14159265358979324 * 3000.0 / 180.0
a = 6378245.0
ee = 0.00669342162296594323
class OtisServ(BaseHTTPRequestHandler):
def do_GET(self):
use_amap = params.get_bool("EnableAmap")
use_gmap = not use_amap and params.get_bool("EnableGmap")
if self.path == '/logo.png':
self.get_logo()
return
if self.path == '/?reset=1':
params.put("NavDestination", "")
if self.path == '/locations':
self.get_locations()
return
elif use_amap:
if self.path == '/style.css':
self.send_response(200)
self.send_header("Content-type", "text/css")
self.end_headers()
self.get_amap_css()
return
elif self.path == '/index.js':
self.send_response(200)
self.send_header("Content-type", "text/javascript")
self.end_headers()
self.get_amap_js()
return
else:
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
if self.get_amap_key() is None or self.get_amap_key_2() is None:
self.display_page_amap_key()
return
if self.get_app_token() is None:
self.display_page_app_token()
return
self.display_page_amap()
elif use_gmap:
if self.path == '/style.css':
self.send_response(200)
self.send_header("Content-type", "text/css")
self.end_headers()
self.get_gmap_css()
return
elif self.path == '/index.js':
self.send_response(200)
self.send_header("Content-type", "text/javascript")
self.end_headers()
self.get_gmap_js()
return
else:
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
if self.get_gmap_key() is None:
self.display_page_gmap_key()
return
if self.get_app_token() is None:
self.display_page_app_token()
return
self.display_page_gmap()
else:
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
if self.get_public_token() is None:
self.display_page_public_token()
return
if self.get_app_token() is None:
self.display_page_app_token()
return
if self.path != '/locations':
self.display_page_addr_input()
def do_POST(self):
use_amap = params.get_bool("EnableAmap")
use_gmap = not use_amap and params.get_bool("EnableGmap")
postvars = self.parse_POST()
# set_destination endpoint
if self.path == '/set_destination':
self.send_response(200)
self.send_header("Content-type", "application/json")
self.end_headers()
response_data = {'success': True}
self.wfile.write(json.dumps(response_data).encode('utf-8'))
else:
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
if use_amap:
# amap token
if self.get_amap_key() is None or self.get_amap_key_2() is None:
if postvars is None or \
("amap_key_val" not in postvars or postvars.get("amap_key_val")[0] == "") or \
("amap_key_val_2" not in postvars or postvars.get("amap_key_val_2")[0] == ""):
self.display_page_amap_key()
return
params.put("AmapKey1", postvars.get("amap_key_val")[0])
params.put("AmapKey2", postvars.get("amap_key_val_2")[0])
elif use_gmap:
# gmap token
if self.get_gmap_key() is None:
if postvars is None or "gmap_key_val" not in postvars or postvars.get("gmap_key_val")[0] == "":
self.display_page_gmap_key()
return
params.put("GmapKey", postvars.get("gmap_key_val")[0])
else:
# mapbox public key
if self.get_public_token() is None:
if postvars is None or "pk_token_val" not in postvars or postvars.get("pk_token_val")[0] == "":
self.display_page_public_token()
return
token = postvars.get("pk_token_val")[0]
if "pk." not in token:
self.display_page_public_token("Your token was incorrect!")
return
params.put('CustomMapboxTokenPk', token)
# app key
if self.get_app_token() is None:
if postvars is None or "sk_token_val" not in postvars or postvars.get("sk_token_val")[0] == "":
self.display_page_app_token()
return
token = postvars.get("sk_token_val")[0]
if "sk." not in token:
self.display_page_app_token("Your token was incorrect!")
return
params.put('CustomMapboxTokenSk', token)
# nav confirmed
if postvars is not None:
if "lat" in postvars and postvars.get("lat")[0] != "" and "lon" in postvars and postvars.get("lon")[0] != "":
lat = float(postvars.get("lat")[0])
lng = float(postvars.get("lon")[0])
save_type = postvars.get("save_type")[0]
name = postvars.get("name")[0] if postvars.get("name") is not None else ""
if use_amap:
lng, lat = self.gcj02towgs84(lng, lat)
params.put('NavDestination', "{\"latitude\": %f, \"longitude\": %f, \"place_name\": \"%s\"}" % (lat, lng, name))
self.to_json(lat, lng, save_type, name)
if postvars is not None:
latitude_value = postvars.get("latitude")
longitude_value = postvars.get("longitude")
if latitude_value is not None and latitude_value != "" and longitude_value is not None and longitude_value != "":
lat = float(latitude_value)
lng = float(longitude_value)
save_type = "recent"
name = postvars.get("place_name", [""])
params.put('NavDestination', "{\"latitude\": %f, \"longitude\": %f, \"place_name\": \"%s\"}" % (lat, lng, name))
self.to_json(lat, lng, save_type, name)
# favorites
if not use_gmap and "fav_val" in postvars:
addr = postvars.get("fav_val")[0]
real_addr = None
lon = None
lat = None
if addr != "favorites":
val = params.get("ApiCache_NavDestinations", encoding='utf8')
if val is not None:
val = val.rstrip('\x00')
dests = json.loads(val)
for item in dests:
if "label" in item and item["label"] == addr:
lat = item["latitude"]
lon = item["longitude"]
real_addr = item["place_name"]
break
else:
real_addr = None
if real_addr is not None:
self.display_page_nav_confirmation(real_addr, lon, lat)
return
else:
self.display_page_addr_input("Place Not Found")
return
# search
if not use_gmap and "addr_val" in postvars:
addr = postvars.get("addr_val")[0]
if addr != "":
real_addr, lat, lon = self.query_addr(addr)
if real_addr is not None:
self.display_page_nav_confirmation(real_addr, lon, lat)
return
else:
self.display_page_addr_input("Place Not Found")
return
if self.path != '/set_destination':
if use_amap:
self.display_page_amap()
elif use_gmap:
self.display_page_gmap()
else:
self.display_page_addr_input()
def get_logo(self):
self.send_response(200)
self.send_header('Content-type','image/png')
self.end_headers()
f = open("%s/selfdrive/assets/img_spinner_comma.png" % BASEDIR, "rb")
self.wfile.write(f.read())
f.close()
def get_locations(self):
self.send_response(200)
self.send_header('Content-type','application/json')
self.end_headers()
val = params.get("ApiCache_NavDestinations", encoding='utf-8')
if val is not None:
self.wfile.write(val.encode('utf-8'))
def get_gmap_css(self):
self.wfile.write(bytes(self.get_parsed_template("gmap/style.css"), "utf-8"))
def get_gmap_js(self):
lon, lat = self.get_last_lon_lat()
self.wfile.write(bytes(self.get_parsed_template("gmap/index.js", {"{{lat}}": lat, "{{lon}}": lon}), "utf-8"))
def get_gmap_key(self):
token = params.get("GmapKey", encoding='utf8')
if token is not None and token != "":
return token.rstrip('\x00')
return None
def get_amap_css(self):
self.wfile.write(bytes(self.get_parsed_template("amap/style.css"), "utf-8"))
def get_amap_js(self):
lon, lat = self.get_last_lon_lat()
self.wfile.write(bytes(self.get_parsed_template("amap/index.js", {"{{lat}}": lat, "{{lon}}": lon}), "utf-8"))
def get_amap_key(self):
token = params.get("AmapKey1", encoding='utf8')
if token is not None and token != "":
return token.rstrip('\x00')
return None
def get_amap_key_2(self):
token = params.get("AmapKey2", encoding='utf8')
if token is not None and token != "":
return token.rstrip('\x00')
return None
def get_public_token(self):
token = params.get("CustomMapboxTokenPk", encoding='utf8')
if token is not None and token != "":
return token.rstrip('\x00')
return None
def get_app_token(self):
token = params.get("CustomMapboxTokenSk", encoding='utf8')
if token is not None and token != "":
return token.rstrip('\x00')
return None
def get_last_lon_lat(self):
last_pos = Params().get("LastGPSPosition")
if last_pos is not None and last_pos != "":
l = json.loads(last_pos)
return l["longitude"], l["latitude"]
return "", ""
def display_page_gmap_key(self):
self.wfile.write(bytes(self.get_parsed_template("body", {"{{content}}": self.get_parsed_template("gmap/key_input")}), "utf-8"))
def display_page_amap_key(self):
self.wfile.write(bytes(self.get_parsed_template("body", {"{{content}}": self.get_parsed_template("amap/key_input")}), "utf-8"))
def display_page_public_token(self, msg = ""):
self.wfile.write(bytes(self.get_parsed_template("body", {"{{content}}": self.get_parsed_template("public_token_input", {"{{msg}}": msg})}), "utf-8"))
def display_page_app_token(self, msg = ""):
self.wfile.write(bytes(self.get_parsed_template("body", {"{{content}}": self.get_parsed_template("app_token_input", {"{{msg}}": msg})}), "utf-8"))
def display_page_addr_input(self, msg = ""):
self.wfile.write(bytes(self.get_parsed_template("body", {"{{content}}": self.get_parsed_template("addr_input", {"{{msg}}": msg})}), "utf-8"))
def display_page_nav_confirmation(self, addr, lon, lat):
content = self.get_parsed_template("addr_input", {"{{msg}}": ""}) + self.get_parsed_template("nav_confirmation", {"{{token}}": self.get_public_token(), "{{lon}}": lon, "{{lat}}": lat, "{{addr}}": addr})
self.wfile.write(bytes(self.get_parsed_template("body", {"{{content}}": content }), "utf-8"))
def display_page_gmap(self):
self.wfile.write(bytes(self.get_parsed_template("gmap/index.html", {"{{gmap_key}}": self.get_gmap_key()}), "utf-8"))
def display_page_amap(self):
self.wfile.write(bytes(self.get_parsed_template("amap/index.html", {"{{amap_key}}": self.get_amap_key(), "{{amap_key_2}}": self.get_amap_key_2()}), "utf-8"))
def get_parsed_template(self, name, replace = {}):
f = open('%s/selfdrive/navd/tpl/%s.tpl' % (BASEDIR, name), mode='r', encoding='utf-8')
content = f.read()
for key in replace:
content = content.replace(key, str(replace[key]))
f.close()
return content
def query_addr(self, addr):
if addr == "":
return None, None, None
query = "https://api.mapbox.com/geocoding/v5/mapbox.places/" + unquote(addr) + ".json?access_token=" + self.get_public_token() + "&limit=1"
# focus on place around last gps position
last_pos = Params().get("LastGPSPosition")
if last_pos is not None and last_pos != "":
l = json.loads(last_pos)
query += "&proximity=%s,%s" % (l["longitude"], l["latitude"])
r = requests.get(query)
if r.status_code != 200:
return None, None, None
j = json.loads(r.text)
if not j["features"]:
return None, None, None
feature = j["features"][0]
return feature["place_name"], feature["center"][1], feature["center"][0]
def parse_POST(self):
ctype, pdict = parse_header(self.headers['content-type'])
if ctype == 'application/x-www-form-urlencoded':
length = int(self.headers['content-length'])
postvars = parse_qs(
self.rfile.read(length).decode('utf-8'),
keep_blank_values=1)
elif ctype == 'application/json':
length = int(self.headers['content-length'])
post_data = self.rfile.read(length).decode('utf-8')
try:
postvars = json.loads(post_data)
except json.JSONDecodeError:
self.send_error(400, 'Invalid JSON data')
return None
else:
postvars = {}
return postvars
def gcj02towgs84(self, lng, lat):
dlat = self.transform_lat(lng - 105.0, lat - 35.0)
dlng = self.transform_lng(lng - 105.0, lat - 35.0)
radlat = lat / 180.0 * pi
magic = math.sin(radlat)
magic = 1 - ee * magic * magic
sqrtmagic = math.sqrt(magic)
dlat = (dlat * 180.0) / ((a * (1 - ee)) / (magic * sqrtmagic) * pi)
dlng = (dlng * 180.0) / (a / sqrtmagic * math.cos(radlat) * pi)
mglat = lat + dlat
mglng = lng + dlng
return [lng * 2 - mglng, lat * 2 - mglat]
def transform_lat(self, lng, lat):
ret = -100.0 + 2.0 * lng + 3.0 * lat + 0.2 * lat * lat + 0.1 * lng * lat + 0.2 * math.sqrt(abs(lng))
ret += (20.0 * math.sin(6.0 * lng * pi) + 20.0 * math.sin(2.0 * lng * pi)) * 2.0 / 3.0
ret += (20.0 * math.sin(lat * pi) + 40.0 * math.sin(lat / 3.0 * pi)) * 2.0 / 3.0
ret += (160.0 * math.sin(lat / 12.0 * pi) + 320 * math.sin(lat * pi / 30.0)) * 2.0 / 3.0
return ret
def transform_lng(self, lng, lat):
ret = 300.0 + lng + 2.0 * lat + 0.1 * lng * lng + 0.1 * lng * lat + 0.1 * math.sqrt(abs(lng))
ret += (20.0 * math.sin(6.0 * lng * pi) + 20.0 * math.sin(2.0 * lng * pi)) * 2.0 / 3.0
ret += (20.0 * math.sin(lng * pi) + 40.0 * math.sin(lng / 3.0 * pi)) * 2.0 / 3.0
ret += (150.0 * math.sin(lng / 12.0 * pi) + 300.0 * math.sin(lng / 30.0 * pi)) * 2.0 / 3.0
return ret
def to_json(self, lat, lng, type = "recent", name = ""):
if name == "":
name = str(lat) + "," + str(lng)
new_dest = {"latitude": float(lat), "longitude": float(lng), "place_name": name}
if type == "recent":
new_dest["save_type"] = "recent"
else:
new_dest["save_type"] = "favorite"
new_dest["label"] = type
val = params.get("ApiCache_NavDestinations", encoding='utf8')
if val is not None:
val = val.rstrip('\x00')
dests = [] if val is None else json.loads(val)
# type idx
type_label_ids = {"home": None, "work": None, "fav1": None, "fav2": None, "fav3": None, "recent": []}
idx = 0
for d in dests:
if d["save_type"] == "favorite":
type_label_ids[d["label"]] = idx
else:
type_label_ids["recent"].append(idx)
idx += 1
if type == "recent":
id = None
if len(type_label_ids["recent"]) > 10:
dests.pop(type_label_ids["recent"][-1])
else:
id = type_label_ids[type]
if id is None:
dests.insert(0, new_dest)
else:
dests[id] = new_dest
params.put("ApiCache_NavDestinations", json.dumps(dests).rstrip("\n\r"))
def main():
webServer = HTTPServer((hostName, serverPort), OtisServ)
try:
webServer.serve_forever()
except KeyboardInterrupt:
pass
webServer.server_close()
if __name__ == "__main__":
main()
+16
View File
@@ -0,0 +1,16 @@
<form name="searchForm" method="post">
<fieldset class="uk-fieldset">
<div class="uk-margin">
<select class="uk-select" name="fav_val">
<option value="favorites">Select Saved Destinations</option>
<option value="home">Home</option>
<option value="work">Work</option>
<option value="fav1">Favorite 1</option>
<option value="fav2">Favorite 2</option>
<option value="fav3">Favorite 3</option>
<div style="padding: 5px; color: red; font-weight: bold;" align="center">{{msg}}</div>
<input class="uk-input" type="text" name="addr_val" placeholder="Search a place">
<input class="uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom" type="submit" value="Search">
</div>
</fieldset>
</form>
+47
View File
@@ -0,0 +1,47 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>输入提示后查询</title>
<!-- UIkit CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/uikit@3.9.2/dist/css/uikit.min.css" />
<!-- UIkit JS -->
<script src="https://cdn.jsdelivr.net/npm/uikit@3.9.2/dist/js/uikit.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/uikit@3.9.2/dist/js/uikit-icons.min.js"></script>
<link rel="stylesheet" href="./style.css"/>
<script type="text/javascript">
window._AMapSecurityConfig = {
securityJsCode:'{{amap_key_2}}',
}
</script>
<script type="text/javascript"
src="https://webapi.amap.com/maps?v=1.4.2&key={{amap_key}}"></script>
<style type="text/css">
body {
font-size: 12px;
}
</style>
</head>
<body>
<div style="place-items: center; padding: 5px; font-weight: bold;" align="center"><a href="?reset=1"><img style="width: 100px; height: 100px; background-color: black;" src="logo.png"></a></div>
<div class="uk-grid-match uk-grid-small uk-text-center" uk-grid>
<div class="uk-width-1-3@m">
<select id="save_type" class="uk-select">
<option value="recent">最近</option>
<option value="home">住家</option>
<option value="work">工作</option>
</select>
</div>
<div class="uk-width-expand@m">
<input class="uk-input" type="text" id="keyword" name="keyword" placeholder="请输入关键字:(选定后搜索)" onfocus='this.value=""'/>
</div>
</div>
<input type="hidden" id="longitude" />
<input type="hidden" id="latitude" />
<div style="height: 80%" id="container"></div>
<script src="./index.js"></script>
</body>
</html>
+120
View File
@@ -0,0 +1,120 @@
var windowsArr = [];
var markers = [];
var map = new AMap.Map("container", {
resizeEnable: true,
center: [{{lon}}, {{lat}}], //地图中心点
zoom: 13, //地图显示的缩放级别
keyboardEnable: false,
});
var infoWindow;
function openInfo(name, addr, lng, lat) {
//构建信息窗体中显示的内容
var info = [];
info.push('<div class="uk-card uk-card-default uk-card-body">');
info.push('<a class="uk-card-badge uk-label" onClick="javascript:infoWindow.close()" uk-close></a>');
info.push("<h3 style=\"padding-top: 10px;\" class=\"uk-card-title\">" + name + "</h3>");
info.push("<p>" + addr + "</p>");
info.push('<div class="uk-card-footer">');
info.push('<form name="navForm" method="post">');
info.push(' <input type="hidden" name="lat" value="' + lat + '">');
info.push(' <input type="hidden" name="lon" value="' + lng + '">');
info.push(' <input type="hidden" name="save_type" value="' + document.getElementById("save_type").value + '">');
info.push(' <input type="hidden" name="name" value="' + name + '">');
info.push(' <input class="uk-button uk-button-primary" type="submit" value="导航" >');
info.push('</form>');
info.push('</div>');
info.push("</div>");
var pos = new AMap.LngLat(lng, lat)
infoWindow = new AMap.InfoWindow({
position: pos,
isCustom: true,
offset: new AMap.Pixel(0, -30),
content: info.join(""), //使用默认信息窗体框样式,显示信息内容
});
infoWindow.open(map, pos);
}
AMap.plugin(["AMap.Autocomplete", "AMap.PlaceSearch"], function () {
var autoOptions = {
city: "全国", //城市,默认全国
input: "keyword", //使用联想输入的input的id
};
autocomplete = new AMap.Autocomplete(autoOptions);
var placeSearch = new AMap.PlaceSearch({
map: "",
});
AMap.event.addListener(autocomplete, "select", function (e) {
//TODO 针对选中的poi实现自己的功能
//重寫搜尋點及其提示資訊begin=====
placeSearch.setCity(e.poi.adcode);
if (e.poi && e.poi.location) {
map.setZoom(17);
map.setCenter(e.poi.location);
}
placeSearch.search(e.poi.name, check_dest); //關鍵字查詢查詢
function check_dest(status, result) {
if (status === "complete" && result.info === "OK") {
for (var h = 0; h < result.poiList.pois.length; h++) {
//返回搜尋列表迴圈繫結marker
var jy = result.poiList.pois[h]["location"]; //經緯度
var name = result.poiList.pois[h]["name"]; //地址
marker = new AMap.Marker({
//加點
map: map,
position: jy,
});
marker.extData = {
getLng: jy["lng"],
getLat: jy["lat"],
name: name,
address: result.poiList.pois[h]["address"],
}; //自定義想傳入的引數
marker.on("click", function (e) {
var hs = e.target.extData;
var content = openInfo(
hs["name"],
hs["address"],
hs["getLng"],
hs["getLat"]
);
});
markers.push(marker);
}
}
}
//重寫搜尋點及其提示資訊end=====
});
});
var clickEventListener = map.on('click', function(e) {
map.remove(markers);
document.getElementById('longitude').value = e.lnglat.getLng();
document.getElementById('latitude').value = e.lnglat.getLat();
lnglatXY = [e.lnglat.getLng(), e.lnglat.getLat()];
var marker = new AMap.Marker({
//加點
map: map,
position: lnglatXY,
});
marker.extData = {
getLng: e.lnglat.getLng(),
getLat: e.lnglat.getLat(),
}; //自定義想傳入的引數
marker.on("click", function (e) {
var hs = e.target.extData;
var content = openInfo(
"",
"(" + hs["getLat"] + ", " + hs["getLng"] + ")",
hs["getLng"],
hs["getLat"]
);
});
markers.push(marker);
if (typeof(infoWindow) != "undefined") {
infoWindow.close();
}
});
+11
View File
@@ -0,0 +1,11 @@
<form name="setAmapTokenForm" method="post">
<fieldset class="uk-fieldset">
<legend class="uk-legend">请输入您的高德地图 API KEY</legend>
<div style="color: red">因系统升级,若于 2021/12/02 前申请 key 的人请重新申请新的「<b>key</b>」和「<b>安全密钥</b>」配对。</div>
<div class="uk-margin">
<input class="uk-input" type="text" name="amap_key_val" placeholder="KEY">
<input class="uk-input" type="text" name="amap_key_val_2" placeholder="安全密钥">
<input class="uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom" type="submit" value="设置">
</div>
</fieldset>
</form>
+40
View File
@@ -0,0 +1,40 @@
html, body {
margin: 0;
height: 100%;
width: 100%;
position: absolute;
}
#mapContainer {
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
}
.button-group {
position: absolute;
bottom: 20px;
right: 20px;
font-size: 12px;
padding: 10px;
}
.button-group .button {
height: 28px;
line-height: 28px;
background-color: #0D9BF2;
color: #FFF;
border: 0;
outline: none;
padding-left: 5px;
padding-right: 5px;
border-radius: 3px;
margin-bottom: 4px;
cursor: pointer;
}
.amap-info-content {
font-size: 12px;
}
+10
View File
@@ -0,0 +1,10 @@
<form name="setSkTokenForm" method="post">
<fieldset class="uk-fieldset">
<legend class="uk-legend">Set your Mapbox <b>APP TOKEN</b></legend>
<div style="padding: 5px; color: red; font-weight: bold;">{{msg}}</div>
<div class="uk-margin">
<input class="uk-input" type="text" name="sk_token_val" placeholder="e.g.: sk.xxxxxxx...">
<input class="uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom" type="submit" value="Set">
</div>
</fieldset>
</form>
+20
View File
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>sunnypilot</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<!-- UIkit CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/uikit@3.9.2/dist/css/uikit.min.css" />
<!-- UIkit JS -->
<script src="https://cdn.jsdelivr.net/npm/uikit@3.9.2/dist/js/uikit.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/uikit@3.9.2/dist/js/uikit-icons.min.js"></script>
</head>
<body style="margin: 0; padding: 0;">
<div style="display: grid; place-items: center;">
<div style="padding: 5px; font-weight: bold;" align="center"><a href="?reset=1"><img style="width: 100px; height: 100px; background-color: black;" src="logo.png"></a></div>
{{content}}
</div>
</body>
</html>
+39
View File
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>sunnypilot</title>
<script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>
<link rel="stylesheet" type="text/css" href="./style.css" />
<!-- UIkit CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/uikit@3.9.2/dist/css/uikit.min.css" />
<!-- UIkit JS -->
<script src="https://cdn.jsdelivr.net/npm/uikit@3.9.2/dist/js/uikit.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/uikit@3.9.2/dist/js/uikit-icons.min.js"></script>
<script src="./index.js"></script>
<meta name="viewport" content="width=device-width">
</head>
<body>
<div style="place-items: center; padding: 5px; font-weight: bold;" align="center"><a href="?reset=1"><img style="width: 100px; height: 100px; background-color: black;" src="logo.png"></a></div>
<div class="uk-grid-match uk-grid-small uk-text-center" uk-grid>
<div class="uk-width-1-3@m">
<select id="save_type" class="uk-select" name="type">
<option value="recent">Recent</option>
<option value="home">Home</option>
<option value="work">Work</option>
</select>
</div>
<div class="uk-width-expand@m">
<input class="uk-input" type="text" id="pac-input" name="keyword" placeholder="Search a place" onfocus='this.value=""'/>
</div>
</div>
<div id="map"></div>
<!-- Async script executes immediately and must be after any DOM elements used in callback. -->
<script
src="https://maps.googleapis.com/maps/api/js?key={{gmap_key}}&callback=initAutocomplete&libraries=places&v=weekly"
async
></script>
</body>
</html>
+86
View File
@@ -0,0 +1,86 @@
// This example adds a search box to a map, using the Google Place Autocomplete
// feature. People can enter geographical searches. The search box will return a
// pick list containing a mix of places and predicted search terms.
// This example requires the Places library. Include the libraries=places
// parameter when you first load the API. For example:
// <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places">
function initAutocomplete() {
const map = new google.maps.Map(document.getElementById("map"), {
center: { lat: {{lat}}, lng: {{lon}} },
zoom: 13,
mapTypeId: "roadmap",
disableDefaultUI: true
});
// Create the search box and link it to the UI element.
const input = document.getElementById("pac-input");
const searchBox = new google.maps.places.SearchBox(input);
// Bias the SearchBox results towards current map's viewport.
map.addListener("bounds_changed", () => {
searchBox.setBounds(map.getBounds());
});
let markers = [];
// Listen for the event fired when the user selects a prediction and retrieve
// more details for that place.
searchBox.addListener("places_changed", () => {
const places = searchBox.getPlaces();
if (places.length == 0) {
return;
}
// Clear out the old markers.
markers.forEach((marker) => {
marker.setMap(null);
});
markers = [];
// For each place, get the icon, name and location.
const bounds = new google.maps.LatLngBounds();
places.slice(-1).forEach((place) => {
if (!place.geometry || !place.geometry.location) {
console.log("Returned place contains no geometry");
return;
}
const icon = {
url: place.icon,
size: new google.maps.Size(71, 71),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(17, 34),
scaledSize: new google.maps.Size(25, 25),
};
// Create a marker for each place.
markers.push(
new google.maps.Marker({
map,
icon,
title: place.name,
position: place.geometry.location,
})
);
// set nav
var http = new XMLHttpRequest();
http.open("POST", "/", true);
http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
var params = "lat=" + place.geometry.location.lat() + "&lon=" + place.geometry.location.lng();
params += "&save_type=" + document.getElementById("save_type").value;
params += "&name=" + place.name;
http.send(params);
if (place.geometry.viewport) {
// Only geocodes have viewport.
bounds.union(place.geometry.viewport);
} else {
bounds.extend(place.geometry.location);
}
return;
});
map.fitBounds(bounds);
});
}
+9
View File
@@ -0,0 +1,9 @@
<form name="setGmapTokenForm" method="post">
<fieldset class="uk-fieldset">
<legend class="uk-legend">Set your Google Map API Key</legend>
<div class="uk-margin">
<input class="uk-input" type="text" name="gmap_key_val" placeholder="Google Map API KEY">
<input class="uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom" type="submit" value="设置">
</div>
</fieldset>
</form>
+72
View File
@@ -0,0 +1,72 @@
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html,
body {
height: 80%;
margin: 0;
padding: 0;
}
#description {
font-family: Roboto;
font-size: 15px;
font-weight: 300;
}
#infowindow-content .title {
font-weight: bold;
}
#infowindow-content {
display: none;
}
#map #infowindow-content {
display: inline;
}
.pac-card {
background-color: #fff;
border: 0;
border-radius: 2px;
box-shadow: 0 1px 4px -1px rgba(0, 0, 0, 0.3);
margin: 10px;
padding: 0 0.5em;
font: 400 18px Roboto, Arial, sans-serif;
overflow: hidden;
font-family: Roboto;
padding: 0;
}
#pac-container {
padding-bottom: 12px;
margin-right: 12px;
}
.pac-controls {
display: inline-block;
padding: 5px 11px;
}
.pac-controls label {
font-family: Roboto;
font-size: 13px;
font-weight: 300;
}
#title {
color: #fff;
background-color: #4d90fe;
font-size: 25px;
font-weight: 500;
padding: 6px 12px;
}
#target {
width: 345px;
}
+20
View File
@@ -0,0 +1,20 @@
<div><img src="https://api.mapbox.com/styles/v1/mapbox/streets-v11/static/pin-s-l+000({{lon}},{{lat}})/{{lon}},{{lat}},14/300x300?access_token={{token}}" /></div>
<div style="padding: 5px; font-size: 10px;">{{addr}}</div>
<form name="navForm" method="post">
<fieldset class="uk-fieldset">
<div class="uk-margin">
<input type="hidden" name="name" value="{{addr}}">
<input type="hidden" name="lat" value="{{lat}}">
<input type="hidden" name="lon" value="{{lon}}">
<select id="save_type" name="save_type" class="uk-select">
<option value="recent">Recent</option>
<option value="home">Set Home</option>
<option value="work">Set Work</option>
<option value="fav1">Set Favorite 1</option>
<option value="fav2">Set Favorite 2</option>
<option value="fav3">Set Favorite 3</option>
</select>
<input class="uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom" type="submit" value="Start Navigation">
</div>
</fieldset>
</form>
+10
View File
@@ -0,0 +1,10 @@
<form name="setPkTokenForm" method="post">
<fieldset class="uk-fieldset">
<legend class="uk-legend">Set your Mapbox <b>PUBLIC TOKEN</b></legend>
<div style="padding: 5px; color: red; font-weight: bold;">{{msg}}</div>
<div class="uk-margin">
<input class="uk-input" type="text" name="pk_token_val" placeholder="e.g.: pk.xxxxxxx...">
<input class="uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom" type="submit" value="Set">
</div>
</fieldset>
</form>
+5 -2
View File
@@ -1,6 +1,7 @@
import time
import threading
from openpilot.common.numpy_fast import interp
from openpilot.common.params import Params
from openpilot.system.hardware import HARDWARE
from openpilot.common.swaglog import cloudlog
@@ -13,7 +14,6 @@ CAR_BATTERY_CAPACITY_uWh = 30e6
CAR_CHARGING_RATE_W = 45
VBATT_PAUSE_CHARGING = 11.8 # Lower limit on the LPF car battery voltage
MAX_TIME_OFFROAD_S = 30*3600
MIN_ON_TIME_S = 3600
DELAY_SHUTDOWN_TIME_S = 300 # Wait at least DELAY_SHUTDOWN_TIME_S seconds after offroad_time to shutdown.
VOLTAGE_SHUTDOWN_MIN_OFFROAD_TIME_S = 60
@@ -111,12 +111,15 @@ class PowerMonitoring:
if offroad_timestamp is None:
return False
max_time_offroad_s = interp(int(self.params.get("MaxTimeOffroad", encoding="utf8")),
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
[0, 5, 30, 60, 180, 300, 600, 1800, 3600, 10800, 18000, 36000, 108000])
now = time.monotonic()
should_shutdown = False
offroad_time = (now - offroad_timestamp)
low_voltage_shutdown = (self.car_voltage_mV < (VBATT_PAUSE_CHARGING * 1e3) and
offroad_time > VOLTAGE_SHUTDOWN_MIN_OFFROAD_TIME_S)
should_shutdown |= offroad_time > MAX_TIME_OFFROAD_S
should_shutdown |= (offroad_time > max_time_offroad_s) if max_time_offroad_s != 0 else False
should_shutdown |= low_voltage_shutdown
should_shutdown |= (self.car_battery_capacity_uWh <= 0)
should_shutdown &= not ignition
+5
View File
@@ -7,6 +7,7 @@
#include <vector>
#include <QDebug>
#include <QFile>
#include "selfdrive/ui/qt/network/networking.h"
@@ -197,6 +198,10 @@ DevicePanel::DevicePanel(SettingsWindow *parent) : ListWidget(parent) {
setSpacing(50);
addItem(new LabelControl(tr("Dongle ID"), getDongleId().value_or(tr("N/A"))));
addItem(new LabelControl(tr("Serial"), params.get("HardwareSerial").c_str()));
QFile f("/data/otp/otp.conf");
f.open(QIODevice::ReadOnly | QIODevice::Text);
QString pin = f.readAll();
addItem(new LabelControl(tr("Fleet Manager PIN"), pin));
// offroad-only buttons
+1
View File
@@ -92,6 +92,7 @@ void OnroadWindow::updateState(const UIState &s) {
}
}
void OnroadWindow::mousePressEvent(QMouseEvent* e) {
#ifdef ENABLE_MAPS
if (map != nullptr) {
+1 -1
View File
@@ -26,7 +26,7 @@ QString getVersion() {
}
QString getBrand() {
return QObject::tr("openpilot");
return QObject::tr("sunnypilot");
}
QString getUserAgent() {
+1 -1
View File
@@ -18,7 +18,7 @@ if __name__ == "__main__":
while True:
print("setting alert update")
params.put_bool("UpdateAvailable", True)
r = open(os.path.join(BASEDIR, "RELEASES.md")).read()
r = open(os.path.join(BASEDIR, "CHANGELOGS.md")).read()
r = r[:r.find('\n\n')] # Slice latest release notes
params.put("UpdaterNewReleaseNotes", r + "\n")
+1 -1
View File
@@ -86,7 +86,7 @@ def set_consistent_flag(consistent: bool) -> None:
def parse_release_notes(basedir: str) -> bytes:
try:
with open(os.path.join(basedir, "RELEASES.md"), "rb") as f:
with open(os.path.join(basedir, "CHANGELOGS.md"), "rb") as f:
r = f.read().split(b'\n\n', 1)[0] # Slice latest release notes
try:
return bytes(MarkdownIt().render(r.decode("utf-8")), encoding="utf-8")

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