Compare commits

..

955 Commits

Author SHA1 Message Date
dragonpilot 86e7c5d5b6 Merge branch 'devel-en' into 0.6.5-en 2019-11-06 12:02:26 +10:00
dragonpilot 9062391a9c Merge branch 'devel-unsupported-cars' into devel-en 2019-11-05 13:44:57 +10:00
dragonpilot 6f7bf752cd add 2017 Lexus GS450H 2019-11-05 12:08:24 +10:00
dragonpilot 450e6001a7 add aegis speed camera app 2019-11-04 16:43:40 +10:00
dragonpilot 92c4111bdd update APK 2019-11-01 13:39:11 +10:00
dragonpilot 2c11113671 remove miui fonts to reduce package size 2019-11-01 13:34:28 +10:00
dragonpilot 5e341385cb update offroad to multilangual version 2019-11-01 11:10:54 +10:00
dragonpilot 4adf4d138e Merge branch 'devel-unsupported-cars' into devel-en 2019-10-31 11:24:09 +10:00
dragonpilot 995af1de45 fix merge conflict 2019-10-31 11:23:50 +10:00
dragonpilot 399cdf4e4a Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-10-31 11:22:02 +10:00
dragonpilot e8c7da8f4e Merge branch 'devel-en' into 0.6.5-en 2019-10-31 11:16:10 +10:00
Riccardo fe0ed57f45 Update README with now supported Subaru Harness 2019-10-30 15:15:05 -07:00
Ted Slesinski affe1c3d2c Adds 2019 Lexus ES (non hybrid) (#866)
* Adds 2019 Lexus ES (non hybrid)

* Updated test route
2019-10-30 10:38:10 -07:00
dragonpilot 8a816ea8e1 update carcontroller.py for honda 2019-10-30 11:56:17 +10:00
dragonpilot b2c0070a7b update safety_honda 2019-10-30 10:37:32 +10:00
dragonpilot a2d6b0241f fix allow_gas for honda and slightly adjust lead car moving alert value 2019-10-30 09:31:51 +10:00
xBJx 98d2907a35 Added fingerprint from Sienna XLE AWD (#848)
* Added fingerprint from Sienna XLE AWD

* Update driver_monitor.py

* Update driver_monitor.py

* Update driver_monitor.py
2019-10-28 19:26:50 -07:00
dragonpilot 70e315f14a add SnG Mod support 2019-10-29 10:02:46 +10:00
dekerr 2a77b02bd8 remove unnecessary comprehensions (#863) 2019-10-28 15:16:37 -07:00
dragonpilot dc8d7e3939 Adjust dragon_allow_gas logic 2019-10-28 14:12:50 +10:00
dragonpilot 53f3688e4a Merge branch 'devel-unsupported-cars' into devel-en 2019-10-28 12:33:51 +10:00
dragonpilot 9ec47b48bd remove fp 2019-10-28 12:33:27 +10:00
dragonpilot d44e8b5d3b Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-10-28 12:33:16 +10:00
dragonpilot 48edf7f7d7 do not send canError if dragon_toyota_stock_dsu is on 2019-10-28 12:30:04 +10:00
dragonpilot cf0e7d4a92 rename variable 2019-10-28 11:13:27 +10:00
dragonpilot 70df20f749 Revert "remove gas/brake value modification when allow_gas is enabled"
This reverts commit 56742acbd4.
2019-10-27 09:50:24 +10:00
u8511049 d2a92fcbe3 Add supported car for 2019 Toyota Altis Hybrid (#859)
* add supported car for 2019 Toyota Altis Hybird / Corolla hybrid 2020 (US market)
2019-10-25 10:28:06 -07:00
dragonpilot 9e1db5ee4a update lead car alert logic 2019-10-25 09:17:54 +10:00
dragonpilot c9a3e8f8bc remove canbus freq checking 2019-10-24 13:44:03 +10:00
dragonpilot 45399cc201 remove chmod bs 2019-10-22 16:53:36 +10:00
dragonpilot 12df763d61 disable force internet connectivity 2019-10-22 14:51:45 +10:00
dragonpilot c065bc1a01 slightly adjust es_tss2 port 2019-10-22 11:22:02 +10:00
dragonpilot df40837f48 ES_TSS2 should be stop_and_go = True 2019-10-21 19:56:32 +10:00
dragonpilot 8db3fa8caf completely remove params.put for connectivity check for performance purpose 2019-10-21 19:04:27 +10:00
dragonpilot aba77b1163 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-10-21 16:20:46 +10:00
dragonpilot 4097231dcb add 2019 Lexus ES200 port from Shell 2019-10-21 16:20:04 +10:00
dragonpilot 56742acbd4 remove gas/brake value modification when allow_gas is enabled 2019-10-21 11:18:17 +10:00
dragonpilot 72ba044226 disable internet connection checking 2019-10-21 11:11:51 +10:00
Riccardo 7a2addf782 Remove unneded use of replace, causing json to fail loading the alert 2019-10-18 11:29:59 -07:00
dragonpilot 63cee44949 Add Lead Car Moving Alert 2019-10-18 17:58:12 +10:00
dragonpilot b1e698ee82 Make sure always use unsigned panda firmware 2019-10-18 09:47:14 +10:00
dragonpilot c6f324d407 adjust STEER_ANGLE to 0.0573 instead of 0.573 2019-10-18 09:41:09 +10:00
dragonpilot 23250ba37f Merge branch 'devel-unsupported-cars' into devel-en 2019-10-18 09:39:33 +10:00
dragonpilot aa89df14b8 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-10-18 09:39:19 +10:00
dragonpilot 969c3c1e05 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-10-18 09:38:09 +10:00
Riccardo 23dfde1ce7 Update ref to process_replay regression test 2019-10-17 14:47:38 -07:00
Jason Young d953b6a7aa Add core OP support for CRC validation, with extra support for Volkswagen MQB (#836)
* Generalized core OP CRC support plus extra bits for Volkswagen MQB.
2019-10-17 13:58:32 -07:00
Riccardo 26dd7e27c8 Revert to using the sum of the lane line probabilities instead of the the product 2019-10-17 13:31:28 -07:00
dragonpilot 1447a3b458 Add slow on curve toggle 2019-10-17 14:22:28 +10:00
dragonpilot 0dc120f4d8 fix unable to display release note issue 2019-10-17 13:35:10 +10:00
dragonpilot 8db70980fa update APK 2019-10-17 10:30:50 +10:00
dragonpilot 91bbd7c28f Fix STEER_ANGLE in STEER_TORQUE_SENSOR factor to 0.573 (was 0.056) 2019-10-17 10:21:00 +10:00
dragonpilot df432c5e2e Merge branch 'devel-unsupported-cars' into devel-en 2019-10-17 10:19:50 +10:00
dragonpilot 02d6549fa7 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-10-17 10:19:13 +10:00
dragonpilot 0302835853 Fix charging_ctrl max/min value param reader 2019-10-17 09:59:13 +10:00
dragonpilot 5581835f79 Add DragonCarModel/DragonCarVIN params 2019-10-17 09:58:47 +10:00
dragonpilot 7030de2a82 delete bs (branch switcher) 2019-10-16 17:22:21 +10:00
dragonpilot 4065e9360c upgrade autonavi app to v4.3.0 2019-10-16 16:10:01 +10:00
dragonpilot 0d02fbe2ec Add no-cache header when download changelog 2019-10-16 11:57:49 +10:00
dragonpilot 33386b6365 Add reboot to flash panda script 2019-10-16 10:36:17 +10:00
dragonpilot 8fd9ff49f4 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-10-15 11:57:02 +10:00
dragonpilot 5a2bc4f616 Update APK 2019-10-14 17:12:13 +10:00
dragonpilot 50d8771c29 Update APK 2019-10-14 16:59:49 +10:00
dragonpilot fd839b7614 fix reset_update.sh script again 2019-10-14 16:56:08 +10:00
dragonpilot 33393412f8 Fix update_panda_firmware.sh 2019-10-14 16:29:13 +10:00
dragonpilot bfd61871d4 add a script for update panda firmware 2019-10-14 16:03:44 +10:00
dragonpilot 45bb3350e1 fix reset_update script 2019-10-14 16:03:31 +10:00
dragonpilot 8ab6b4313b update APK 2019-10-14 13:59:20 +10:00
dragonpilot 853c1c24fb Create a custom script for update feature 2019-10-14 13:44:06 +10:00
dragonpilot 7b4602907e update APK 2019-10-14 12:32:01 +10:00
dragonpilot 6291d6c31a fix charging ctrl toggle 2019-10-14 12:27:39 +10:00
rbiasini 70d17cd69b Force subaru to assume the stock camera is connected (#849) 2019-10-13 18:25:09 -07:00
dragonpilot be9e6fa698 Display dp's changelog instead of dp's release notes 2019-10-14 11:02:12 +10:00
dragonpilot d21b783199 remove deprecated dragon params 2019-10-13 10:58:03 +10:00
dragonpilot e450d8a4fb re-enable updated 2019-10-13 10:36:21 +10:00
dragonpilot 07c8465c2b Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-10-13 10:17:34 +10:00
rbiasini 069e337bea Allow to lock safety mode to keep gm/tesla cars supported (#844) 2019-10-11 17:35:07 -07:00
illumiN8i 6b62dd2308 2019 Highlander Hybrid Limited Platinum (#843)
fingerprint from ogdragonzypher on Discord
2019-10-11 13:46:48 -07:00
dekerr 4ff7da61e0 simplify encode/decode in dbc (#840)
* simplify encode/decode
2019-10-11 13:22:16 -07:00
dekerr 686d4bbdc2 use list comprehension (#839)
* use list comprehension

* oops index range fix
2019-10-11 00:09:59 -07:00
eFini 08d86aa7d7 Increase LEXUS_IS safetyParam to 77 (#841) 2019-10-10 23:31:05 -07:00
dragonpilot 8b3aa6f561 Merge branch 'devel-unsupported-cars' into devel-en 2019-10-11 14:24:04 +10:00
dragonpilot 973bdc4318 Add Taiwan 2019 RAV4 FP from Max Duan / CloudJ 2019-10-11 14:23:43 +10:00
dragonpilot 1d38e040c9 Merge branch 'devel-unsupported-cars' into devel-en 2019-10-11 14:17:06 +10:00
dragonpilot aa58f52db3 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-10-11 14:14:35 +10:00
dragonpilot 62fbb6302a Fix fp cache issue 2019-10-11 13:44:16 +10:00
dragonpilot be1376ecd2 Fix FP cache 2019-10-11 12:16:18 +10:00
dragonpilot 38a9cf9489 Revert "Fixing up fp cache"
This reverts commit adf8e823b9.
2019-10-11 10:23:37 +10:00
dragonpilot a7602eae5e Improve honda dp_allow_gas logic 2019-10-11 09:57:07 +10:00
dragonpilot adf8e823b9 Fixing up fp cache 2019-10-11 09:47:26 +10:00
dragonpilot 9636661da4 Fix python3 params.get issue in appd 2019-10-10 22:07:05 +10:00
dragonpilot 071457dc9e Fix python3 params.get issue 2019-10-10 21:43:55 +10:00
dragonpilot dc77d4a88e use dp spinner 2019-10-10 15:08:01 +10:00
dragonpilot f1e26b346f Fix unavailable variable issue 2019-10-10 14:34:18 +10:00
dragonpilot 6c1fa5dc3a Fix unable to display ip address issue 2019-10-10 14:09:09 +10:00
dragonpilot 7b8bd9e3ff Update APK 2019-10-10 13:58:03 +10:00
dragonpilot b8557616dd Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-10-10 10:44:43 +10:00
Vehicle Researcher cf80f7a28b openpilot v0.6.5 release 2019-10-09 18:43:53 +00:00
Vehicle Researcher 3a04a69cbe Merge opendbc subtree 2019-10-09 18:31:57 +00:00
Vehicle Researcher f2de9784f8 Merge panda subtree 2019-10-09 18:31:56 +00:00
Vehicle Researcher d17745fb5e Merge cereal subtree 2019-10-09 18:31:55 +00:00
dragonpilot 3a006aa99e Merge branch 'devel-unsupported-cars' into devel-en 2019-10-09 14:46:13 +10:00
dragonpilot e8084fd9dd Revert "Move Max's FP to TSS RAV4H instead of TSS2 variant"
This reverts commit 236a05f2ad.
2019-10-09 14:45:13 +10:00
dragonpilot e5281a98fa Add warning when LatCtrl is off 2019-10-09 14:43:24 +10:00
dragonpilot 99fdd691a3 Add branch switch tool 2019-10-08 14:43:12 +10:00
dragonpilot 037727cd62 Update APK 2019-10-08 10:49:49 +10:00
dragonpilot 22b5eb0e06 Merge branch 'devel-unsupported-cars' into devel-en 2019-10-08 10:25:37 +10:00
dragonpilot 236a05f2ad Move Max's FP to TSS RAV4H instead of TSS2 variant 2019-10-08 10:25:11 +10:00
dragonpilot 8ef944eceb Merge branch 'devel-unsupported-cars' of https://github.com/dragonpilot-community/dragonpilot into devel-unsupported-cars 2019-10-08 10:24:08 +10:00
dragonpilot 01e62f49dc Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-10-08 10:23:31 +10:00
dragonpilot 5c4701d035 Remove checks = [] from devel-unsupported-cars branch 2019-10-07 21:11:20 +10:00
dragonpilot 38ce7dae51 Merge branch 'devel-unsupported-cars' into devel-en 2019-10-07 21:10:21 +10:00
dragonpilot 7d8ba56cda Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-10-07 21:09:11 +10:00
dragonpilot 9c7e8aa391 move new rav4h fp to tss2 2019-10-07 21:06:11 +10:00
dragonpilot ca1903a3c0 Add Taiwan RAV4H FP 2019-10-06 21:44:50 +10:00
dragonpilot d20b63c909 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-10-06 20:16:21 +10:00
dragonpilot ef4b2d32d2 Remove zorrobyte's curvature learner, it decreases turning ability 2019-10-06 20:15:21 +10:00
Chris Souers 1bc51d6b47 Add 2018 Civic Hatchback 1.0l CVT (European) support (#823)
* Add 2018 Civic Hatchback 1.0l CVT support

test_fingerprints returns fine
2019-10-03 14:18:30 -07:00
dragonpilot f875296a4a Merge branch 'devel-unsupported-cars' into devel-en 2019-10-01 12:16:40 +10:00
dragonpilot fbb5860e9f Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-10-01 12:16:20 +10:00
dragonpilot 2074e530e0 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-10-01 12:15:16 +10:00
illumiN8i 6edc36181a Add 2020 Corolla XSE AFS option (#821)
Frank McTank on Discord has XSE with Connectivity Package with Adaptive Front Lighting System option
2019-09-30 13:39:27 -07:00
Kishan Karunaratne a0b41e6cf9 Update thermald to set ignition_seen back to False if Panda disconnected (#820) 2019-09-30 13:06:38 -07:00
dragonpilot d1923f7dc6 Fix missing curvature_factor val 2019-09-30 12:47:25 +10:00
dragonpilot 03589f71e5 re-activate curvature learner and upgrade it to v4 2019-09-30 11:44:20 +10:00
dragonpilot b47ca2543e ISH to use better steer angle sensor 2019-09-30 11:42:06 +10:00
dragonpilot 5a8bff7f56 Disable curvature learner 2019-09-28 16:36:39 +10:00
dragonpilot 701bdf0b4a ISH to use better angle sensor 2019-09-28 16:35:04 +10:00
dragonpilot c1c40321b6 Add zorrobyte's curvature learner 2019-09-27 15:11:29 +10:00
dragonpilot f165fed722 Add ability to toggle driver monitoring 2019-09-27 15:03:22 +10:00
dragonpilot 145319bcd3 disable cut steering for 2s after fault 2019-09-27 14:46:12 +10:00
dragonpilot c7b9d28232 Make steering wheel transparent 2019-09-27 14:32:35 +10:00
dragonpilot 2e73e55e97 Better way to fix loggerd crash issue 2019-09-26 16:59:09 +10:00
dragonpilot 2e0dc8cdc0 fix boot issue if DragonEnableLogger is disabled 2019-09-26 16:50:41 +10:00
dragonpilot 26b063f60f Update APK 2019-09-25 10:29:33 +10:00
dragonpilot 0ebdd0731f Add blinker ui/param 2019-09-24 16:29:50 +10:00
dragonpilot 6573a67742 Make steering wheel transparent 2019-09-24 16:21:30 +10:00
dragonpilot 32adcf1591 Add params to turn on/off ui lead/path/lane 2019-09-24 14:56:14 +10:00
dragonpilot 7b7be6975a Reduce var checking to 5 secs 2019-09-23 14:52:57 +10:00
dragonpilot 377038642c Move ip mod back to it's old location 2019-09-23 14:44:16 +10:00
dragonpilot dc76fb165e Update APK 2019-09-23 14:12:02 +10:00
dragonpilot 951b5c695a Add toyota lane departure warning toggle 2019-09-23 13:34:31 +10:00
dragonpilot 01542c4a19 Fix charging ctrl logic 2019-09-23 13:23:40 +10:00
dragonpilot b88362d508 Merge branch 'devel-unsupported-cars' into devel-en 2019-09-23 12:36:16 +10:00
dragonpilot 2463873b14 Add Taiwan Prius 4.5 FP, by Lin Hsin Hung 2019-09-23 12:35:44 +10:00
dragonpilot 39d527fa5b Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-09-23 12:30:45 +10:00
dragonpilot 7bfdd09dc1 Fix battery ctrl logic 2019-09-23 12:29:51 +10:00
dragonpilot 8a392c7c2e Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-09-20 15:50:21 +10:00
dragonpilot da8706ec07 Add charging control 2019-09-20 15:49:58 +10:00
dragonpilot 066d88e754 Create a new service to handle greypanda gps mode 2019-09-20 15:24:33 +10:00
illumiN8i 47e87baa60 2020 Toyota Prius Prime Limited (#813)
* 2020 Prius Prime Limited

Fingerprint for 2020 Prius Prime Limited from garglo. 86a0adcb192c9424

* Update README.md

2020 supported
2019-09-19 12:08:23 -07:00
dragonpilot 36924194ad Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-09-19 16:39:35 +10:00
dragonpilot 99149ebfb1 Remove greypanda mode GPS signal adjustment 2019-09-19 16:39:23 +10:00
Willem Melching 5cfc0be5cb Add spinner source files (#812) 2019-09-17 12:47:30 -07:00
Riccardo 41d0a8957a Mistakenly removed Honda Fit support from README.md 2019-09-17 11:15:34 -07:00
dragonpilot 67d3494b30 Merge branch 'devel-unsupported-cars' into devel-en 2019-09-16 14:17:22 +10:00
dragonpilot 881178d542 Merge branch 'devel-unsupported-cars' of https://github.com/dragonpilot-community/dragonpilot into devel-unsupported-cars 2019-09-16 14:16:04 +10:00
dragonpilot 0042b3d64e Taiwan CT200h FP from CloudJ, CT200h port from thomaspich 2019-09-16 14:14:53 +10:00
dragonpilot cd87c50753 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-09-16 13:56:56 +10:00
dragonpilot 35666b24f3 Fix incorrect light_stalk assignment 2019-09-14 18:16:45 +10:00
dragonpilot 259e6ecf49 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-09-14 18:15:41 +10:00
Willem Melching 58f376002e Revert dPoly computation to 0.6.3 behavior (#809)
* Revert dPoly computation to 0.6.3 behavior

* update test reference
2019-09-13 17:01:54 -07:00
dragonpilot eb3cd1efc5 Fix ISH error 2019-09-13 22:31:20 +10:00
dragonpilot 284fe1f2b1 kernel call optimization 2019-09-13 16:34:18 +10:00
dragonpilot baf9ab37c2 Update APK 2019-09-13 15:04:24 +10:00
dragonpilot 82160eb2e4 update UI to adapt dragon_driving_ui switch 2019-09-13 14:50:11 +10:00
dragonpilot f4546ba8d4 Add missing init value 2019-09-13 13:02:10 +10:00
dragonpilot 2509a1e753 Add ability to display/hide speed in UI 2019-09-13 12:58:09 +10:00
dragonpilot 71886e2be6 Update APK 2019-09-13 12:50:48 +10:00
dragonpilot 10d3b8aa90 Still allow header to be displayed when dragon_driving_ui is disabled 2019-09-13 12:48:39 +10:00
dragonpilot 0441cf139c Update logic so if DragonSteeringMonitorTimer set to <= 0, it will disable steering monitor by increase the value to 86400 (a day) 2019-09-13 12:35:50 +10:00
dragonpilot 4eb316c291 Update APK 2019-09-13 12:34:39 +10:00
dragonpilot a75abd788b Add ability to disable steering limit alert 2019-09-13 11:51:58 +10:00
dragonpilot 436640c108 Update shutdownd logic - reported by loveloveses@wechat 2019-09-13 11:31:48 +10:00
dragonpilot 11d6583b62 clean up and fix a couple errors that stop honda cars running 2019-09-13 10:05:11 +10:00
dragonpilot a71307229f Fix ISH light_stalk message location 2019-09-13 09:15:23 +10:00
dragonpilot b318162e6a Merge branch 'devel-en' of https://github.com/dragonpilot-community/dragonpilot into devel-en 2019-09-12 23:02:02 +10:00
dragonpilot 3826cf23d2 Merge branch 'devel-unsupported-cars' into devel-en 2019-09-12 22:59:57 +10:00
dragonpilot 8a6dfb05ab Add back Shell's odyssey 2019-09-12 22:58:43 +10:00
Comma Device d3becbacdd ish confirmed working 2019-09-12 21:51:53 +10:00
dragonpilot 7700b6aa59 supercharge ish 2019-09-12 16:19:05 +10:00
dragonpilot 634ee8746a Merge branch 'devel-unsupported-cars' into devel-en 2019-09-12 16:14:32 +10:00
dragonpilot 8a2b649f22 Add ISH into interface.py 2019-09-12 16:13:56 +10:00
dragonpilot a5c9f571ce Merge branch 'devel-en' of https://github.com/dragonpilot-community/dragonpilot into devel-en 2019-09-12 15:54:16 +10:00
dragonpilot cd00c32dbc Fix up driver_monitor mod so change requires restart (less query to kernel) 2019-09-12 15:54:07 +10:00
dragonpilot f5113edc50 Fix up driver_monitor mod so change requires restart (less query to kernel) 2019-09-12 15:48:56 +10:00
dragonpilot a65f57fac5 Merge branch 'devel-unsupported-cars' into devel-en 2019-09-12 15:32:57 +10:00
dragonpilot 995cd1aa65 Keep ISH dbc for future reference 2019-09-12 15:32:34 +10:00
dragonpilot dd9e649296 Merge branch 'devel-unsupported-cars' into devel-en 2019-09-12 15:27:07 +10:00
dragonpilot 5e7cb5de3c Update 2017 Lexus IS300h port 2019-09-12 15:26:41 +10:00
dragonpilot afb5d372fd Fix up dragon_enable_driver_safety_check mod 2019-09-12 11:43:09 +10:00
dragonpilot ee28ef1ae4 Remove matched fingerprint logs 2019-09-11 16:20:37 +10:00
dragonpilot e7b2a98fe3 Merge branch 'devel-en' of https://github.com/dragonpilot-community/dragonpilot into devel-en 2019-09-11 16:14:19 +10:00
dragonpilot 6813559bbe Fix local variable "dragon_lat_control" error 2019-09-11 16:13:30 +10:00
dragonpilot 33926ee432 Fix local variable error 2019-09-11 16:12:55 +10:00
dragonpilot 04fd1f4e6c DP spinner 2019-09-11 12:21:34 +10:00
dragonpilot ebfd786af0 Add unsupported cars 2019-09-11 12:00:09 +10:00
dragonpilot 9c7ae433ec use put_nonblocking instead of params.put 2019-09-11 11:46:31 +10:00
dragonpilot 10cd4c0bd2 更新APK 2019-09-11 11:25:19 +10:00
dragonpilot 7e8618dc9d Merge branch 'devel-unsupported-cars' into devel-en 2019-09-11 11:17:03 +10:00
dragonpilot c68503d8a1 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars
# Conflicts:
#	opendbc/generator/toyota/lexus_is_hybrid_2017_pt.dbc
#	opendbc/lexus_is_hybrid_2017_pt_generated.dbc
#	selfdrive/car/toyota/carstate.py
#	selfdrive/car/toyota/interface.py
#	selfdrive/car/toyota/values.py
2019-09-11 11:16:41 +10:00
dragonpilot 14b0c9427d Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en
# Conflicts:
#	apk/ai.comma.plus.offroad.apk
#	cereal/car.capnp
#	opendbc/generator/toyota/lexus_is_hybrid_2017_pt.dbc
#	opendbc/lexus_is_hybrid_2017_pt_generated.dbc
#	panda/board/safety/safety_honda.h
#	selfdrive/car/car_helpers.py
#	selfdrive/car/honda/values.py
#	selfdrive/car/toyota/carstate.py
#	selfdrive/car/toyota/interface.py
#	selfdrive/car/toyota/values.py
#	selfdrive/controls/lib/driver_monitor.py
#	selfdrive/controls/lib/lane_planner.py
#	selfdrive/locationd/paramsd.cc
#	selfdrive/ui/ui.c
2019-09-11 11:08:35 +10:00
Willem Melching b0563a5968 Driver monitoring fix when face is visible briefly during nighttime (#806) 2019-09-10 17:35:40 -07:00
dragonpilot 44fc1767fd Add ability to disable driving UI 2019-09-11 10:33:52 +10:00
Vehicle Researcher 61229779e4 openpilot v0.6.4 release 2019-09-09 23:03:02 +00:00
Vehicle Researcher af4f9f1f31 Merge opendbc subtree 2019-09-09 23:00:24 +00:00
Vehicle Researcher 4dc51cfea6 Merge panda subtree 2019-09-09 23:00:23 +00:00
Vehicle Researcher f274a8e3b0 Merge cereal subtree 2019-09-09 23:00:20 +00:00
dragonpilot 97ed349d04 Fix GreyPandaMode logic 2019-09-09 14:25:07 +10:00
dragonpilot 9affab1f27 Add DragonGreyPandaMode logic 2019-09-09 14:17:24 +10:00
dragonpilot b14f39b2c8 更新APK 2019-09-09 12:56:48 +10:00
dragonpilot 69780971aa 加入 GreyPandaMode 2019-09-05 15:33:12 +10:00
dragonpilot 0105342caf Merge branch 'devel-unsupported-cars' into devel-en
# Conflicts:
#	selfdrive/car/honda/values.py
2019-09-05 11:16:11 +10:00
dragonpilot 8c442ec989 加入 Honda Accord Hybrid China 2019-09-05 11:15:07 +10:00
dragonpilot c29f96069e Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-09-05 11:12:00 +10:00
dragonpilot 781c392a22 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-09-05 11:11:39 +10:00
dragonpilot 23f142bcf0 加入 Honda Inspire Hybrid 2019-09-05 11:09:38 +10:00
heitikender da42760e55 Update values.py (#797)
changed Lexus ES DBC scheme to hybrid_tss2, since this is the correct one. Tested on car, works.
2019-09-04 13:38:52 -07:00
dragonpilot fd86f04e82 打開 GPS 高精確度定位模式 2019-09-04 15:37:40 +10:00
dragonpilot df85e66a6d Merge branch 'devel-unsupported-cars' into devel-en 2019-09-04 14:40:13 +10:00
dragonpilot 49eec4cab3 加入 2019 Taiwan Altis Hybrid (需確認) 2019-09-04 14:39:52 +10:00
dragonpilot f2648fd12f Merge branch 'devel-unsupported-cars' into devel-en 2019-09-04 14:28:51 +10:00
dragonpilot d50811859a use PR values 2019-09-04 14:28:14 +10:00
dragonpilot c1f03ce883 restore files deleted accidentally 2019-09-04 14:26:39 +10:00
dragonpilot 7ce952e165 Merge branch 'devel-lexus-ish-ave30r' of https://github.com/efinilan/openpilot into devel-unsupported-cars
# Conflicts:
#	selfdrive/car/toyota/values.py
2019-09-04 14:22:11 +10:00
dragonpilot d1e95be073 Merge branch 'devel-unsupported-cars' into devel-en 2019-09-04 14:17:59 +10:00
dragonpilot 04a7dd2633 加入台灣 2019 Altis 指紋 2019-09-04 14:16:56 +10:00
dragonpilot 6168ce1ef9 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-09-04 14:09:33 +10:00
dragonpilot 836a836f0d Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-09-04 12:23:21 +10:00
dragonpilot 50d5e988e8 increase sensor_data_age and posenet_invalid_count in paramsd.cc to reduce errors (perhaps caused by additional loads?) 2019-09-02 15:35:01 +10:00
dragonpilot f5a7e06770 修正 logic 2019-09-02 14:45:25 +10:00
dragonpilot f6322f0262 加入延遲開啟/關閉 APP 2019-09-02 13:24:07 +10:00
dragonpilot 91be9e9fa9 顯示WIFI IP 位置 2019-09-02 11:47:57 +10:00
dragonpilot 49c488a79e 優化 2019-08-30 17:20:07 +10:00
dragonpilot 34b85671d1 Revert "加入電池充電保護"
This reverts commit 4151d152
2019-08-30 15:17:45 +10:00
dragonpilot be5366787b Revert "更新APK"
This reverts commit 80a88170
2019-08-30 15:17:34 +10:00
dragonpilot 4ac4dd57e9 Revert "修正"
This reverts commit 80e24f20
2019-08-30 15:17:27 +10:00
dragonpilot 3b66e6a9c4 Revert "update logic"
This reverts commit d45a88d5
2019-08-30 15:17:17 +10:00
dragonpilot d45a88d5cd update logic 2019-08-30 14:13:52 +10:00
dragonpilot 80e24f2051 修正 2019-08-30 13:56:36 +10:00
dragonpilot 80a8817048 更新APK 2019-08-30 13:35:34 +10:00
dragonpilot 4151d1526e 加入電池充電保護 2019-08-30 13:24:07 +10:00
dragonpilot 0de789a7cb 更新APK 2019-08-30 12:01:17 +10:00
dragonpilot 38ab273163 優化服務 2019-08-30 12:00:36 +10:00
Ted Slesinski f6531a9d08 Update README.md (#795)
Honda Fit can be removed from community-maintained branches now.
2019-08-28 12:51:31 -07:00
dragonpilot 0f571e8a4e 更新APK 2019-08-28 16:19:35 +10:00
dragonpilot 9567d75d1c 修正錯誤 2019-08-28 16:08:21 +10:00
dragonpilot bb182edec0 修正錯誤 2019-08-28 16:04:49 +10:00
dragonpilot 6d76ef3ef0 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-08-28 11:15:42 +10:00
dragonpilot 4365be9056 Merge branch 'devel-en' of https://github.com/dragonpilot-community/dragonpilot into devel-en
# Conflicts:
#	selfdrive/ui/ui.c
2019-08-28 11:15:33 +10:00
dragonpilot b5c5e04d4b 修改音量調整 logic 2019-08-28 11:10:47 +10:00
dragonpilot f61add3913 修改音量調整 logic 2019-08-28 09:50:16 +10:00
Ted Slesinski c73464f67f Adds 2018 Honda Fit support (#266)
* Fit rebased on latest devel

* Added new objects for fit to values.py

* Update readme

* Updated formatting of fingerprint to match others

* Update cargo variable

Co-Authored-By: Pramuditha Aravinda <pramudithaa@zone24x7.com>

* Added tire stiffness, renamed PID kp/ki variables

Co-Authored-By: Pramuditha Aravinda <pramudithaa@zone24x7.com>

* Renamed longitudinal KpBP

Co-Authored-By: Pramuditha Aravinda <pramudithaa@zone24x7.com>

* Renamed longitudinal kpV

Co-Authored-By: Pramuditha Aravinda <pramudithaa@zone24x7.com>

* Renamed longitudinal KiBP variable

Co-Authored-By: Pramuditha Aravinda <pramudithaa@zone24x7.com>

* Renamed longitudinal KiV

Co-Authored-By: Pramuditha Aravinda <pramudithaa@zone24x7.com>

* Set more realistic value for tire stiffness

* CR-V Hybrid doc duplicate
2019-08-27 15:19:25 -07:00
dragonpilot 9050903cee 修正錯誤 2019-08-27 17:24:48 +10:00
dragonpilot 85bc608675 修正錯誤 2019-08-27 17:21:45 +10:00
dragonpilot 2ccdc68ca9 加入可調警示音量 2019-08-27 17:13:12 +10:00
dragonpilot 24ca97d828 自動關機改為可調時長 2019-08-27 11:49:00 +10:00
Rick Lan 751aa5cf7e Adjust SafetyParam to 100 as it can do 130 2019-08-26 13:47:02 +10:00
Rick Lan e05df8f0fc Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r
# Conflicts:
#	selfdrive/car/toyota/carstate.py
#	selfdrive/car/toyota/interface.py
#	selfdrive/car/toyota/values.py
2019-08-26 13:42:00 +10:00
dragonpilot 5c059504ed Revert "Add support to 2017 Lexus is300h (AVE30R)"
This reverts commit c187ea59
2019-08-26 13:34:46 +10:00
dragonpilot c187ea5986 Add support to 2017 Lexus is300h (AVE30R) 2019-08-26 13:33:30 +10:00
wocsor 4d5d709bea Update Readme - Avalon and Sienna are now supported (#789)
and 2020 CorollaH and 2020Rav4H are on the way with VINPrinting!
2019-08-22 08:49:38 -07:00
dragonpilot 9833c901e6 permission 2019-08-23 01:25:31 +10:00
dragonpilot 194081b0f1 修正 appd 2019-08-23 01:22:18 +10:00
dragonpilot 5af0f2748c 修正permission 2019-08-23 01:10:07 +10:00
dragonpilot 29d25df7a6 優化appd 2019-08-23 00:59:57 +10:00
dragonpilot ca0fd6fe8a 優化appd 2019-08-23 00:55:49 +10:00
dragonpilot 151e45c9cd 更新APK 2019-08-23 00:36:55 +10:00
dragonpilot 33ff1c9783 調整camera_offset 單位 2019-08-22 18:05:16 +10:00
dragonpilot c7c29cac6f 加入調整相機偏移距離 2019-08-22 16:25:23 +10:00
dragonpilot f6d402c1e7 更新APK 2019-08-22 15:56:00 +10:00
dragonpilot 96041f0dbe 調整appd logic 2019-08-21 23:57:29 +10:00
dragonpilot c1cf70fd3a 調整appd logic 2019-08-21 23:30:53 +10:00
dragonpilot 9fc0107636 更新3rd Party APP 管理 2019-08-21 17:42:40 +10:00
dragonpilot e3a19a2458 讓第三方APK 不要每次開機都重新安裝 2019-08-21 13:01:27 +10:00
dragonpilot 001f45b3a9 更新APK 2019-08-21 12:35:38 +10:00
dragonpilot 472f55faa8 車子啟動後強迫關閉 mixplorer 2019-08-21 12:32:42 +10:00
dragonpilot 4315386cfe 加入 mixplorer 2019-08-21 12:18:17 +10:00
dragonpilot 00caf953fa 修正DragonSteeringMonitorTimer 錯誤 2019-08-20 16:21:17 +10:00
dragonpilot 7fd9e33cb4 修正DragonSteeringMonitorTimer 錯誤 2019-08-20 15:56:06 +10:00
dragonpilot 1b09ac739e Merge branch 'devel-en' of https://github.com/dragonpilot-community/dragonpilot into devel-en 2019-08-20 15:53:51 +10:00
dragonpilot 252c0fd86d 加入可設定的 steering monitor timer 2019-08-20 12:46:07 +10:00
dragonpilot f4e4ae6508 駕駛監控改至30 分鐘 2019-08-19 21:30:42 +10:00
dragonpilot cc203dc17e 阻止tomtom/autonavi 過熱時使用 2019-08-19 16:45:12 +10:00
dragonpilot 2765a7fadc 讓tomtom/autonavi 在起動時自動啟動,熄火時自動關閉 2019-08-19 15:26:21 +10:00
dragonpilot be9736c796 修正 honda lat ctrl 關閉時會 trigger steerSaturated 錯誤 2019-08-19 14:26:03 +10:00
dragonpilot 59686c07db semibold 字型改 medium 2019-08-19 12:48:49 +10:00
dragonpilot 8ec9cdf607 semibold 字型改 medium 2019-08-19 12:48:32 +10:00
dragonpilot 4bed6f6bfc 把loading dragonpilot 改成網址 2019-08-19 12:25:34 +10:00
dragonpilot 7eb487ae30 revert 刪除字型 2019-08-19 12:11:38 +10:00
dragonpilot b6a00be9f1 UI 移除MIUI 字型 2019-08-19 12:09:39 +10:00
dragonpilot 868078fe36 更新APK 2019-08-19 11:49:48 +10:00
dragonpilot 043ed96294 spinner 改用 dp 圖示 2019-08-19 11:20:47 +10:00
dragonpilot 7b9a314093 關閉 tooDistracted 錯誤,以防 dp 無法啟動 2019-08-19 10:30:03 +10:00
dragonpilot 4221d3b985 行車介面改用NotoSansCJK 字型 2019-08-15 17:15:51 +10:00
dragonpilot 73d345cd24 BBUI 轉向顯示至小數點第一位 2019-08-15 15:55:00 +10:00
dragonpilot bb9e4cb7c2 加入 persist.sys.local 設置 2019-08-15 15:37:39 +10:00
dragonpilot 9865597b4a 每次開機後都會把 locale 設定成指定的語系 2019-08-15 15:15:09 +10:00
dragonpilot 6c167f5ef9 Revert "加入特斯拉音效"
This reverts commit 5772b681
2019-08-14 13:57:54 +10:00
dragonpilot c18067d705 修正開機啟動 autonavi 的錯誤 2019-08-14 12:06:42 +10:00
dragonpilot a5dc451697 在 frame 之後再開啟 tomtom/autonavi 2019-08-14 12:03:45 +10:00
dragonpilot cdfb4101be 加入開機啟動TOMTOM/AUTONAVI 功能 2019-08-14 11:53:59 +10:00
dragonpilot 0dc8b03f07 關閉 updated 2019-08-14 11:14:59 +10:00
dragonpilot 504f43ea4b 延遲 params check 至3秒以減少 kernel calls 2019-08-14 10:31:51 +10:00
dragonpilot d0deb8d9d2 調整 DragonEnableDriverSafetyCheck Logic 2019-08-14 10:28:58 +10:00
dragonpilot 5772b681d0 加入特斯拉音效 2019-08-14 10:26:50 +10:00
dragonpilot 5f394317b5 更新APK 2019-08-13 16:56:26 +10:00
dragonpilot 5b296967eb Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en
# Conflicts:
#	apk/ai.comma.plus.offroad.apk
#	cereal/car.capnp
#	selfdrive/car/honda/carcontroller.py
#	selfdrive/car/honda/hondacan.py
#	selfdrive/car/toyota/carcontroller.py
#	selfdrive/controls/lib/driver_monitor.py
#	selfdrive/controls/lib/model_parser.py
#	selfdrive/ui/ui.c
2019-08-13 14:15:05 +10:00
Vehicle Researcher d5f9caa82d openpilot v0.6.3 release 2019-08-13 01:36:45 +00:00
Vehicle Researcher 6a61788682 Merge opendbc subtree 2019-08-13 01:34:24 +00:00
Vehicle Researcher ead59a5a61 Merge panda subtree 2019-08-13 01:34:23 +00:00
Vehicle Researcher a1f069c6d8 Merge cereal subtree 2019-08-13 01:34:22 +00:00
dragonpilot 6d8174e89f 更新 APK 2019-08-12 22:58:08 +10:00
dragonpilot f4946a9e9d 加入導航 2019-08-12 22:00:05 +10:00
dragonpilot fd79368f3b Merge branch 'devel-en' into devel-en-unsupported-cars 2019-08-11 02:01:13 +10:00
dragonpilot d2cfd239d5 加入新的指紋 2019-08-11 01:58:11 +10:00
dragonpilot 2861467183 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-08-06 15:43:06 +10:00
Dragonpilot d478d6a931 回傳指紋到 sentry.io 2019-08-02 09:18:07 +10:00
Dragonpilot dc77655e2a 修改指紋暫存 logic 2019-08-02 09:17:14 +10:00
Dragonpilot f5d88c5813 嘗試更新指紋暫存 2019-08-02 08:53:24 +10:00
Riccardo 095ef5f9f6 Revert "Revert "Update hyundaican for Correct Message ID on LKAS11 (#746)" (#775)"
This reverts commit d5242c5b82.
2019-08-01 12:44:41 -07:00
TK211X fd71fe698c Correct Message ID on LKAS11 under Openpilot .dbc (#747)
https://github.com/commaai/opendbc/pull/172
2019-08-01 12:43:49 -07:00
rbiasini d5242c5b82 Revert "Update hyundaican for Correct Message ID on LKAS11 (#746)" (#775)
This reverts commit 1f1893a170.
2019-08-01 12:35:24 -07:00
TK211X 1f1893a170 Update hyundaican for Correct Message ID on LKAS11 (#746)
This is the only trace of CF_Lkas_Icon found under /car/hyundai relative to open .dbc

https://github.com/commaai/opendbc/pull/172
2019-08-01 12:34:19 -07:00
Dragonpilot 043d2e9f36 Merge branch 'devel-en' of https://github.com/dragonpilot-community/dragonpilot into devel-en 2019-08-01 11:30:03 +10:00
Dragonpilot 3f78957ccc 更新 APK 2019-08-01 11:29:38 +10:00
Dragonpilot 8bcb9331fd 加入 UI 設定 2019-08-01 11:28:59 +10:00
Willem Melching 5808958fb2 Fix timeout in longitudinal test (#772)
* Fix timeout in longitudinal test
2019-07-31 18:17:19 -07:00
Dragonpilot af3234f1d7 加回指紋暫存 2019-08-01 09:25:46 +10:00
Dragonpilot e2ff61da9b Revert "移除指紋暫存"
This reverts commit 11229fc9c0.

Conflicts:
	apk/ai.comma.plus.offroad.apk
2019-08-01 09:14:19 +10:00
dragonpilot 80e87ee0ae dragon_toyota_stock_dsu 模式下只在適當的情況下 pcm_acc_active 才設成 True 2019-07-31 22:34:29 +10:00
dragonpilot bcb3f6077c 原廠 LKAS 只在關閉下觸發,不然會有 steering error 2019-07-31 22:31:52 +10:00
Dragonpilot 87679a75b8 更新 APK 2019-07-31 15:44:27 +10:00
Dragonpilot c6c41f1a29 加入 Lat 控制開關,Toyota/Lexus 原廠 LKAS 模式 2019-07-31 15:27:16 +10:00
Dragonpilot 5d57078474 更新 APK 2019-07-31 11:25:35 +10:00
Dragonpilot 11229fc9c0 移除指紋暫存 2019-07-31 11:25:15 +10:00
Dragonpilot 1727b59882 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en
# Conflicts:
#	apk/ai.comma.plus.offroad.apk
#	selfdrive/car/car_helpers.py
2019-07-31 11:02:42 +10:00
Vehicle Researcher e90c41c576 openpilot v0.6.2 release 2019-07-30 02:27:48 +00:00
Vehicle Researcher aa1b61eb8e Merge opendbc subtree 2019-07-30 02:25:29 +00:00
Vehicle Researcher 98cd6147c3 Merge panda subtree 2019-07-30 02:25:28 +00:00
Vehicle Researcher d22636b194 Merge cereal subtree 2019-07-30 02:25:27 +00:00
Chris Souers a440425ef8 Update README.md (#766) 2019-07-29 15:06:34 -07:00
Dragonpilot 0ecaf72ed4 優化 params.get 讀取次數,最快每秒讀一次 2019-07-29 15:03:53 +10:00
Dragonpilot 3300143b1b fix logic 2019-07-29 14:09:39 +10:00
Dragonpilot 902413200a 更新 APK 2019-07-29 13:57:30 +10:00
Dragonpilot ce57ac073b 加入 Toyota/Lexus 原廠 DSU 模式 2019-07-29 13:26:30 +10:00
Dragonpilot 91bf49bdd4 Merge branch 'devel-en' of https://github.com/dragonpilot-community/dragonpilot into devel-en 2019-07-29 10:39:19 +10:00
Dragonpilot 017cbbfa51 更新 crash.py 讓它能回傳更多訊息 2019-07-29 10:39:06 +10:00
dragonpilot 8773fbf7d9 Merge branch 'devel-en' of https://github.com/dragonpilot-community/dragonpilot into devel-en 2019-07-28 10:22:20 +10:00
Rick Lan 8d4ff30c60 comment out unused var (causing panda flash error?) 2019-07-28 10:17:31 +10:00
Dragonpilot be2ba93ca0 更新 APK 2019-07-26 15:02:00 +10:00
Dragonpilot 48425a1fc1 更新變數名 2019-07-26 14:50:45 +10:00
Dragonpilot 84c8790192 Merge branch 'devel-en' of https://github.com/dragonpilot-community/dragonpilot into devel-en 2019-07-26 12:01:48 +10:00
Dragonpilot 25681a31e5 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-07-26 12:01:06 +10:00
Gernby 61bbb52172 Remove offset from curvature (#761) 2019-07-25 15:00:50 -07:00
dragonpilot c9270bfa2f 更新 APK 2019-07-25 22:22:06 +10:00
dragonpilot 0a7d2f4343 更新 APK 2019-07-25 21:59:11 +10:00
dragonpilot dc6107dac3 Merge pull request #7 from eFiniLan/dp-bbui
加入 BBUI
2019-07-25 21:40:59 +10:00
Rick Lan 5eacdcee9d Merge branch 'devel-en' of https://github.com/dragonpilot-community/dragonpilot into dp-bbui
# Conflicts:
#	common/params.py
#	selfdrive/dragonpilot/dragonconf/__init__.py
2019-07-25 21:13:59 +10:00
Rick Lan 978839a861 finalise BBUI 2019-07-25 21:03:47 +10:00
Rick Lan fbc243aa94 bbui mod 2019-07-25 17:27:58 +10:00
Arne Schwarck cf5c4aeacb self.poller not used (#759)
I do not see the need for zmq and the poller being initialized and not used.
2019-07-24 11:45:53 -07:00
dragonpilot 194d4d7f71 Make it always write new cache fp 2019-07-24 00:28:31 +10:00
Dragonpilot 5b596aec6f 加入 DragonAllowGas 功能 2019-07-23 15:51:45 +10:00
Dragonpilot 09533fee0c 加入 DragonAllowGas 功能 2019-07-23 15:40:30 +10:00
Dragonpilot 6ee6161d23 取消自動更新 2019-07-23 12:10:46 +10:00
Dragonpilot 4e16a1454d 更新 APK 2019-07-23 12:07:34 +10:00
Dragonpilot d0bdd513cd 更新 APK 2019-07-23 10:56:10 +10:00
Dragonpilot 54b920eb79 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en
# Conflicts:
#	apk/ai.comma.plus.offroad.apk
#	cereal/car.capnp
#	selfdrive/car/car_helpers.py
#	selfdrive/car/toyota/interface.py
#	selfdrive/controls/lib/driver_monitor.py
#	selfdrive/manager.py
2019-07-23 10:55:28 +10:00
Vehicle Researcher 94053536b4 openpilot v0.6.1 release 2019-07-22 19:17:47 +00:00
Vehicle Researcher cd98235644 Merge opendbc subtree 2019-07-22 19:15:28 +00:00
Vehicle Researcher c8b4633cd1 Merge panda subtree 2019-07-22 19:15:27 +00:00
Vehicle Researcher 53413fa019 Merge cereal subtree 2019-07-22 19:15:25 +00:00
Dragonpilot e453e79bc8 fix missing variables 2019-07-22 16:37:41 +10:00
Dragonpilot b02e848395 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-07-22 16:10:24 +10:00
Dragonpilot ed9d5615ba 更新 APK 2019-07-22 16:10:06 +10:00
Dragonpilot 8264fd8b93 Merge branch 'devel-disable-uploader' into devel-en 2019-07-22 15:39:01 +10:00
Dragonpilot 532e7710f3 加入取消上傳comma ai記錄功能 2019-07-22 15:28:43 +10:00
rbiasini 63da1abe2c Use standard steer angle sensor in DSU-less pre-TSS2 Toyota. (#751) 2019-07-20 23:21:50 -07:00
Dragonpilot 62bd6cee67 Revert "把accordh 的指紋往上移"
This reverts commit e8af5d6364.
2019-07-16 15:43:35 +10:00
Dragonpilot e8af5d6364 把accordh 的指紋往上移 2019-07-16 15:22:52 +10:00
Dragonpilot 386ec39885 更新 ACCORDH 指紋,支援 2019 版 2019-07-16 14:28:20 +10:00
Dragonpilot 2a99c660c3 移除 safeguardd 服務 2019-07-16 11:26:59 +10:00
ErichMoraga be28530ee4 Added 2019 Toyota Highlander (#739)
Tested latest commit on ICE version, and it worked flawlessly out of box.  Fantastic experience.
2019-07-15 09:55:51 -07:00
Dragonpilot 15cb2f05c7 更新 APK 2019-07-15 11:42:24 +10:00
Dragonpilot 3595162d1a Merge branch 'devel-en' of https://github.com/dragonpilot/dragonpilot-dev into devel-en
# Conflicts:
#	apk/ai.comma.plus.offroad.apk
2019-07-15 11:18:37 +10:00
Dragonpilot 8e97f70b92 更新 APK 2019-07-15 11:17:23 +10:00
dragonpilot a9a35894ad 加入 pickle.loads 讀取暫存資料 2019-07-13 22:45:34 +10:00
dragonpilot c3a1a438d8 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en
# Conflicts:
#	selfdrive/controls/lib/model_parser.py
2019-07-13 22:37:57 +10:00
Riccardo 13bdfcdd95 Improve Toyota Highlander tuning from https://github.com/commaai/openpilot/pull/690 2019-07-12 19:24:35 -07:00
eFini 9675794969 add loggered, gpsd, sensord to gitignore (#735) 2019-07-12 11:02:23 -07:00
Gernby 151a504507 Fix lane centering with single lane line (#737) 2019-07-12 10:55:34 -07:00
dragonpilot 99da7077ab 更新APK 2019-07-12 20:56:17 +10:00
dragonpilot 3d941253a5 修正暫存指紋錯誤 2019-07-12 20:22:23 +10:00
eFini 03e764bcb3 fix spacing in toyota/carstate.py (#736) 2019-07-11 21:22:02 -07:00
Dragonpilot 0d41146fa8 更新 APK 2019-07-12 13:54:24 +10:00
Dragonpilot 7f04682b4c 更新 APK 2019-07-12 13:22:59 +10:00
Dragonpilot a6545b1604 方向燈取消方向盤控制開啟時顯示提示訊息 2019-07-12 12:08:16 +10:00
dragonpilot 2db4cb0e8c Merge pull request #5 from eFiniLan/dragonpilot-cache-fp
加入暫存指紋功能
2019-07-12 09:47:38 +10:00
dragonpilot 26d0b8d4ee Merge pull request #4 from eFiniLan/dragonpilot-dev-lkmod
加入 honda 的 Lane Keeping 模式開關
2019-07-12 09:47:07 +10:00
Rick Lan 323660961f 更新參數名 2019-07-12 09:35:05 +10:00
Rick Lan 88966b488a 將數值分開儲存 2019-07-12 09:16:49 +10:00
Rick Lan 41fc9c55a0 use pickle instead of repr 2019-07-11 16:30:06 +10:00
Rick Lan 8c2b3d5e37 Merge branch 'dragonpilot-dev-en' of https://github.com/dragonpilot/dragonpilot into dragonpilot-cache-fp
# Conflicts:
#	common/params.py
#	selfdrive/dragonpilot/dragonconf/__init__.py
2019-07-11 16:28:52 +10:00
Rick Lan 22fc7e9dae make car fingerprint cacheable 2019-07-11 15:40:12 +10:00
Rick Lan 9f53e446d9 remove unnecessary changes 2019-07-11 11:21:46 +10:00
Dragonpilot 7e0ba31ceb Merge branch 'devel' into dragonpilot-dev-en 2019-07-11 10:52:24 +10:00
Rick Lan fe46b24be5 add alerts for lkmode 2019-07-11 10:16:46 +10:00
Rick Lan a9e94ef9bb add alerts for lkmode 2019-07-11 10:11:16 +10:00
Rick Lan c9db3ef937 Merge branch 'dragonpilot-dev' of https://github.com/dragonpilot/dragonpilot into dragonpilot-dev-lkmod 2019-07-11 09:35:00 +10:00
Rick Lan 9a3dc91b35 修正打方向燈取消方向盤控制結束後產生的錯誤 2019-07-11 09:14:26 +10:00
Rick Lan c5e71d2f37 更新 APK 2019-07-10 16:26:35 +10:00
Rick Lan 61ce864e28 修正Noctua模式 2019-07-10 15:26:14 +10:00
Rick Lan 36d0a70b69 修正Noctua模式 2019-07-10 15:22:25 +10:00
Rick Lan 20a2007d10 加入Noctua模式 2019-07-10 15:11:09 +10:00
Rick Lan 64701acb68 修正關閉記錄功能 2019-07-10 14:10:53 +10:00
Rick Lan 17922bd096 加入關閉記錄選項 2019-07-10 11:25:44 +10:00
Rick Lan f85055a19c fix issue after merge 2019-07-10 09:59:51 +10:00
Rick Lan 28ebecdbc5 update to 0.6 2019-07-10 09:51:52 +10:00
Nick Brown 16eb74250c 2019 Rav4 Limited AWD (#732)
* Fingerprint

* Merge Limited and XLE fingerprint because they're the same
2019-07-08 17:02:59 -07:00
dekerr 4a48ef8dbc Refactor default Civic params (#720)
* move civic params out

* fix variable name

* simplify ford scaling

* cleanup

* remove import dependency

* requested changes

* keep hyundai
2019-07-08 16:59:32 -07:00
Rick Lan 5eda5fc81b lkmod from honda 2019-07-04 15:02:27 +10:00
Willem Melching 76ab558ca6 Fix run_docker_tests.sh (#730) 2019-07-03 15:53:49 -07:00
Willem Melching 60a20537c5 Make build deterministic and do not rebuild on release2 (#729)
* sort dbc files to make linking deterministic

* touch all files on release2 checkout to prevent rebuild
2019-07-03 12:25:35 -07:00
Rick Lan 71e65750d1 Merge branch 'dragonpilot-dev' of https://github.com/dragonpilot/dragonpilot into dragonpilot-dev 2019-07-03 15:21:35 +10:00
dragonpilot 2ce741275b Merge pull request #1 from eFiniLan/dragonpilot-dev
Dragonpilot 客制功能
2019-07-03 14:04:24 +10:00
Rick Lan 8cb09e1329 啟動畫面文字改為 dragonpilot 2019-07-03 13:50:00 +10:00
Rick Lan 17f21c5b6f Revert "啟動畫面文字改成 dragonpilot"
This reverts commit 0992311f
2019-07-03 13:49:18 +10:00
Rick Lan 0992311f83 啟動畫面文字改成 dragonpilot 2019-07-03 13:48:32 +10:00
Rick Lan a42fea2041 調整UI 顯示 N/A 時使用的字數 2019-07-03 13:44:07 +10:00
Rick Lan 4aaf4f437b 加入 dragonpilot offroad apk 2019-07-03 13:41:43 +10:00
Rick Lan 610bb58845 修正錯誤 2019-07-03 13:35:08 +10:00
Rick Lan 4c77b9162e 當轉向燈暫停方向控制功能開啟時,我們在方向燈關閉後一秒取回控制 2019-07-03 13:27:37 +10:00
Rick Lan cd096d1c2e Merge branch 'dragonpilot-dev' of https://github.com/eFiniLan/openpilot into dragonpilot-dev 2019-07-03 12:43:21 +10:00
Rick Lan 11a7b2d9bf 修正 dashcamd 和 safetyguard 邏輯 2019-07-03 12:41:53 +10:00
Riccardo be020bdedb Chrysler Pacifica 2018 Hybrid: fix fingerprint 2019-07-02 15:24:51 -07:00
Riccardo 1e77f2482c Chrysler Pacifica 2018 Hybrid: add fingerprint 2019-07-02 11:45:24 -07:00
Rick Lan 7fa09edc03 修正 dashcamd 和 safeguardd 無法啟動的錯誤 2019-07-02 22:50:24 +10:00
Rick Lan 13ae651f46 更改 safetycheck 預設值 2019-07-02 16:25:46 +10:00
Rick Lan c345bb1d8f dragonconf 改至 apk 2019-07-02 16:19:22 +10:00
Rick Lan a2b00731cb 修正參數名,將自動關機設定單位換成分鐘,修正dragonconf logic 2019-07-02 16:17:01 +10:00
Rick Lan d36b78e273 重新命名變數,apk 不支援 underscore 2019-07-02 12:57:22 +10:00
Rick Lan 6ab7c27d9b remove unneeded changes 2019-07-02 11:21:56 +10:00
Rick Lan a90c3bc8be remove unneeded changes 2019-07-02 11:18:21 +10:00
Rick Lan 8b3c922cf0 remove unneeded changes 2019-07-02 11:15:51 +10:00
Rick Lan d460e0e735 revert safety_toyota.h change 2019-07-02 11:11:37 +10:00
Rick Lan a52b947ce2 移除油門不取消 OP 選項 2019-07-02 11:04:36 +10:00
Rick Lan c75137b262 Merge branch 'devel' of https://github.com/commaai/openpilot into dragonpilot-dev
# Conflicts:
#	panda/board/safety/safety_toyota.h
#	selfdrive/car/honda/interface.py
#	selfdrive/controls/lib/model_parser.py
#	selfdrive/ui/ui.c
2019-07-02 10:13:33 +10:00
Rick Lan 6fd3f9bad8 修正 toyota d_allowGasOnOP,移除 panda 檢測 gas/brake 2019-07-02 10:02:52 +10:00
George Hotz d8da18ed54 Merge pull request #716 from dekerr/readme
Update README
2019-07-01 14:15:34 -07:00
Willem Melching 6abd80f116 Exclude tools from linter (#718)
* exclude tools from linter

* Exclude tools from pylint too
2019-07-01 13:14:16 -07:00
Willem Melching f4b258a082 Install fastcluster in CI for controls tests 2019-07-01 12:16:16 -07:00
Vehicle Researcher 8a9ed94f5f openpilot v0.6 release 2019-06-28 21:11:30 +00:00
Vehicle Researcher ae44a57565 Merge pyextra subtree 2019-06-28 21:09:14 +00:00
Vehicle Researcher b93f77ea0e Merge opendbc subtree 2019-06-28 21:09:13 +00:00
Vehicle Researcher 983120bfed Merge commit 'dba8e01e540f8b6b231be082ee6d36304aa1997d' as 'panda' 2019-06-28 21:09:12 +00:00
Vehicle Researcher 27803e787b Remove old panda subtree 2019-06-28 21:09:11 +00:00
Vehicle Researcher 6651d50c81 Merge commit '24e096d9f0f424c22b616b43957a5fd310f4ee83' as 'cereal' 2019-06-28 21:09:10 +00:00
Vehicle Researcher f64c4df8c8 Remove old cereal subtree 2019-06-28 21:09:09 +00:00
Rick Lan 00c48f0ba3 將 dragonconf 移至系統的 params, 方便將來移植到 APK 2019-06-28 15:22:34 +10:00
Rick Lan f78b6fdd17 加入油門不取消 OP 選項 2019-06-27 15:11:18 +10:00
Rick Lan 7c537ee201 加入轉向燈暫時取消 OP 方向盤控制選項 2019-06-27 15:11:18 +10:00
Rick Lan e2d77db22a 加入 minimal UI 2019-06-27 15:11:18 +10:00
Rick Lan bf5e361b26 加入斷電自動關機功能 2019-06-27 15:11:18 +10:00
Rick Lan a7ad4488b9 加入安全檢測功能 (提示駕駛以防止 OP 在使用中突然斷開 USB) 2019-06-27 15:11:18 +10:00
Rick Lan f7fbcfe59d 加入 mediaplayer (播放音效) 2019-06-27 15:11:18 +10:00
Rick Lan 1efed2ed00 加入完全取消駕駛監控選項 2019-06-27 15:11:18 +10:00
Rick Lan 15c43ad722 調降模型路寬至 3.5m 2019-06-27 13:33:15 +10:00
Rick Lan 5fcbfcc359 加入 dashcam (行車記錄) 2019-06-27 13:30:33 +10:00
Rick Lan 672d80735f 加入 dragonconf 讀取 /data/dragonpilot.json 設定 2019-06-27 13:27:58 +10:00
Rick Lan 2f5e35035d 讓 UI 能夠顯示中文 2019-06-27 12:00:52 +10:00
Rick Lan 1aafc5b0ef 自動安裝中文字型 2019-06-27 11:56:49 +10:00
Rick Lan 9f66b533e2 修改 sentry.io 相關程式碼
* 提供更多的資訊
* 將錯誤轉發至 dragonpilot 帳號
2019-06-27 11:36:32 +10:00
dekerr 1883bd6135 remove 17 odyssey 2019-06-26 15:20:11 -04:00
eFini 1ba6b0004d Updating existing fingerprint to support both China 2017 & 2019 CRV-H (#689)
* Fingerprint works on both China 2017 & 2019 CRV-H

* update readme
2019-06-25 14:15:38 -07:00
TrackZero 68b86c7ca8 Added fingerprint for 2019 Toyota Prius LE (#694)
* Adding fingerprint for 2019 Prius LE
2019-06-25 14:04:39 -07:00
Rick Lan 65a8f13d98 Merge branch 'devel' of https://github.com/eFiniLan/openpilot into devel-lexus-ish-ave30r 2019-06-25 13:44:06 +10:00
Rick Lan 9a4eb3e0b0 Merge branch 'devel' of https://github.com/eFiniLan/openpilot into devel-lexus-ish-ave30r 2019-06-25 13:42:38 +10:00
Rick Lan 3148499f69 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-06-24 16:24:32 +10:00
dekerr 36881b6410 update vals (#705) 2019-06-20 12:22:30 -07:00
Willem Melching fe7e5cf5df Deterministic boardd build (#702) 2019-06-17 15:23:03 -07:00
rbiasini d8b1588937 Reconcile panda pedal cancel logic for Toyota with controls (#698) 2019-06-13 17:51:12 -07:00
rbiasini a2f4d6b5ad Subaru re-added to the list of supported cars with with DIY giraffe (#691)
* Subaru re-added to the list of supported cars with with DIY giraffe

* Minor line break fixes
2019-06-07 18:09:29 -07:00
George Hotz 16d0c4a3e7 Merge pull request #679 from njbrown09/entunehotspot
Add Toyota Entune Wifi hotspot to hotspot check.
2019-06-06 23:11:43 -07:00
Rick Lan dca99bea38 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-06-07 08:11:31 +10:00
Rick Lan 392cf59937 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-06-07 08:10:39 +10:00
Vehicle Researcher dd34ccfe28 openpilot v0.5.13 release 2019-06-06 04:38:45 +00:00
Vehicle Researcher 59bd6b8837 Merge pyextra subtree 2019-06-06 04:31:54 +00:00
Vehicle Researcher f91df07d3f Merge opendbc subtree 2019-06-06 04:31:49 +00:00
Vehicle Researcher 0829b0a767 Merge panda subtree 2019-06-06 04:31:46 +00:00
Nick Brown 1e8098c140 Camry Fingerprint (#647) 2019-06-05 17:56:21 -07:00
CAmaninacan1 b5a88f5700 Update values.py (#687)
Added fingerprint for 2019 Highlander XLE
2019-06-05 16:35:48 -07:00
Rick Lan 0bf4dbc3b0 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-06-05 16:31:13 +10:00
Nick Brown c0a3e48d94 Detect toyota connected car wifi as a hotspot and not a normal home wifi network. 2019-06-02 00:18:00 -04:00
Joel Natividad 65e1342e41 Correct typos (#677)
“thansk” to “thanks”
2019-06-01 17:03:10 -07:00
Willem Melching 7ada2abca0 Revert "Fix registration's params get_git_remote()" (#674) 2019-05-31 17:32:43 -07:00
ChaseCares 9278fad15c Add 2019 RAV4 XLE fingerprints (#671)
* Add 2019 RAV4 XLE fingerprints
2019-05-31 16:47:07 -07:00
George Hotz 0aa41e348e Merge pull request #673 from rafcabezas/devel
Fix registration's params get_git_remote()
2019-05-31 16:44:08 -07:00
Willem Melching 64a6e9776c Merge pull request #669 from martinl/feature_subaru_lane_lines
Add lane lines visible indicators to Subaru dash display
2019-05-31 14:06:34 -07:00
raf 56b2945de4 Fix registration's params get_git_remote() 2019-05-31 12:10:37 -04:00
Riccardo b686ca87d3 Fingeprint script: better instructions 2019-05-28 17:12:49 -07:00
Arne Schwarck 1b3b260b4d Update mapd.py (#672) 2019-05-28 16:16:32 -07:00
Martin Lillepuu 25d43fe15e Add subaru dash lane lines 2019-05-26 11:13:39 +03:00
Martin Lillepuu cbc73e55a2 add Openpilot lane line indicators to Subaru LKAS HUD 2019-05-26 11:08:17 +03:00
Rick Lan 0a94454812 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-05-22 20:01:38 +10:00
Chris Souers 9b31da0985 add 19 crv to readme (#657) 2019-05-21 22:41:06 -07:00
Rick Lan 2a698bf73e Fix values.py 2019-05-22 10:09:01 +10:00
Rick Lan 64e6706a0b Update variable name 2019-05-22 10:07:31 +10:00
Rick Lan 18e80ea755 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r
# Conflicts:
#	selfdrive/car/toyota/interface.py
#	selfdrive/car/toyota/values.py
2019-05-21 10:30:42 +10:00
Rick Lan af7e33bae8 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-05-21 10:16:31 +10:00
Rick Lan 484fa1ac63 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-05-17 22:11:58 +10:00
Vehicle Researcher 3f9059fea8 openpilot v0.5.12 release 2019-05-16 13:20:29 -07:00
Vehicle Researcher 52e55eb244 Merge opendbc subtree 2019-05-16 13:13:38 -07:00
Vehicle Researcher ec36bc3a39 Merge panda subtree 2019-05-16 13:13:38 -07:00
Rick Lan 603af161fd Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-05-16 15:05:10 +10:00
Arne Schwarck 98797fb24e 1263: 8 for highlander hybrid (#642) 2019-05-14 00:26:16 -07:00
Rick Lan 42906ef1ae Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-05-14 12:30:46 +10:00
Nigel Armstrong 127998ca8b Add changes to 0.5.11 release notes 2019-05-09 16:42:14 -07:00
Willem Melching 1da59216b0 Cleanup Toyota LDW 2019-05-07 22:42:04 -07:00
Willem Melching 184ba93833 Install newer pip version in CI (#627)
* Update pip in CI

* Longer timeout for docker build

* Increase travis timeout

* revert changes to travis file
2019-05-07 21:56:45 +02:00
Rick Lan c9a9d8bd97 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-05-07 10:39:21 +10:00
Willem Melching a321836788 add minimum score to consider a way valid (#292) 2019-05-06 13:21:34 -07:00
Arne Schwarck f5044670fa Add lane departure warning on dashboard for Toyota (#605)
* Add lane departure alert in controlsd

* Need init values for LDA

* Add lane departure in interface.py

* Include LDA in CarControler

* Add logic for LDA in toyotacan

* Add speed condition and comments for LDA

* Correct right CS.vEgo

* Correct rPoly spelling

* Add left and rightLaneDepart to HUDControl in car.capnp

* Add left and rightLane_Depart in UI function

* set controlsd priority

* revert

* There must be a line to depart from

* Include changes from @pd0wm

* Remove redundant False allocation

leftLaneDepart and rightLaneDepart as False by default according to @pd0wm

* Modify variable names

right_lane_depart and left_lane_depart to conform with python naming convention

* Modify variable names

right_lane_depart and left_lane_depart to conform with python naming convention

* Wrap lane departure warning in one bool
2019-05-06 22:19:00 +02:00
ErichMoraga 340e0f4a4c Updated Prius & Prius Prime to include 2019 (#629) 2019-05-05 20:32:05 -07:00
marcbou d8b1e99d77 correct some spelling errors (#628) 2019-05-05 03:23:32 -07:00
Riccardo 2eebe49940 Maintain Python 2-3 compatibility but use six.iteritems(). 2019-05-04 19:01:46 -07:00
Rick Lan 91f0b5c6cd revert unneeded change 2019-05-04 11:40:41 +10:00
Rick Lan e0eccb87b5 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-05-04 11:36:50 +10:00
Drew Hintz 9dae0bfac4 getting ready for Python 3 (#619)
* tabs to spaces
python 2 to 3: https://portingguide.readthedocs.io/en/latest/syntax.html#tabs-and-spaces

* use the new except syntax
python 2 to 3: https://portingguide.readthedocs.io/en/latest/exceptions.html#the-new-except-syntax

* make relative imports absolute
python 2 to 3: https://portingguide.readthedocs.io/en/latest/imports.html#absolute-imports

* Queue renamed to queue in python 3
Use the six compatibility library to support both python 2 and 3: https://portingguide.readthedocs.io/en/latest/stdlib-reorg.html#renamed-modules

* replace dict.has_key() with in
python 2 to 3: https://portingguide.readthedocs.io/en/latest/dicts.html#removed-dict-has-key

* make dict views compatible with python 3
python 2 to 3: https://portingguide.readthedocs.io/en/latest/dicts.html#dict-views-and-iterators
Where needed, wrapping things that will be a view in python 3 with a list(). For example, if it's accessed with []
Python 3 has no iter*() methods, so just using the values() instead of itervalues() as long as it's not too performance intensive. Note that any minor performance hit of using a list instead of a view will go away when switching to python 3. If it is intensive, we could use the six version.

* Explicitly use truncating division
python 2 to 3: https://portingguide.readthedocs.io/en/latest/numbers.html#division
python 3 treats / as float division. When we want the result to be an integer, use //

* replace map() with list comprehension where a list result is needed.
In python 3, map() returns an iterator.
python 2 to 3: https://portingguide.readthedocs.io/en/latest/iterators.html#new-behavior-of-map-and-filter

* replace filter() with list comprehension
In python 3, filter() returns an interatoooooooooooor.
python 2 to 3: https://portingguide.readthedocs.io/en/latest/iterators.html#new-behavior-of-map-and-filter

* wrap zip() in list() where we need the result to be a list
python 2 to 3: https://portingguide.readthedocs.io/en/latest/iterators.html#new-behavior-of-zip

* clean out some lint
Removes these pylint warnings:
************* Module selfdrive.car.chrysler.chryslercan
W: 15, 0: Unnecessary semicolon (unnecessary-semicolon)
W: 16, 0: Unnecessary semicolon (unnecessary-semicolon)
W: 25, 0: Unnecessary semicolon (unnecessary-semicolon)
************* Module common.dbc
W:101, 0: Anomalous backslash in string: '\?'. String constant might be missing an r prefix. (anomalous-backslash-in-string)
************* Module selfdrive.car.gm.interface
R:102, 6: Redefinition of ret.minEnableSpeed type from float to int (redefined-variable-type)
R:103, 6: Redefinition of ret.mass type from int to float (redefined-variable-type)
************* Module selfdrive.updated
R: 20, 6: Redefinition of r type from int to str (redefined-variable-type)
2019-05-02 11:08:59 -07:00
Rick Lan 5b8976af61 * change steering torque to 1600 2019-04-24 21:59:03 +10:00
Vehicle Researcher 2f92d577f9 openpilot v0.5.11 release 2019-04-23 01:41:19 +00:00
Vehicle Researcher 790732bea3 Merge opendbc subtree 2019-04-23 01:34:20 +00:00
Vehicle Researcher 7834995df4 Merge panda subtree 2019-04-23 01:34:19 +00:00
Nigel Armstrong 0a7fed9437 Fix dirty flag
Git diff-index doesn't rebuild index, so files with modified dates or touched
are marked as modified with a SHA1 of all 0.

To fix this, we run update-index --refresh before diff index. Any touched
files are updated in the index.

https://stackoverflow.com/questions/36367190/git-diff-files-output-changes-after-git-status
2019-04-17 00:33:13 -07:00
Nigel Armstrong a201322160 Better logging of dirty files 2019-04-16 20:22:38 -07:00
Nigel Armstrong d64025cca4 Log dirty files 2019-04-16 13:50:38 -07:00
wocsor 58d645cd18 add pedal IDs to a Lexus RXH and Rav4 China (#604) 2019-04-15 18:10:13 -07:00
Nigel Armstrong 76dfb135ca Add pylint to travis-ci (#595)
* Add pylint to travis-ci

* Change travis build order

* Fix missing pylint

* Add pylint to dockerfile

* Test with fixed linter for chrysler changes

* Fix linter issues in OP

* fixed linter on ford

* Fix Riccardo's comments
2019-04-12 23:12:34 -07:00
Nigel Armstrong 185375ed64 Merge panda subtree 2019-04-12 16:57:32 -07:00
Rick Lan a7cf5c2cbb Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-04-10 10:40:31 +10:00
eFini 7978afabe5 Add port for 2019 Honda CRV Hybrid (China ver) (#596)
* 2019 honda crv hybrid port (china version)

* adjust mass based on spec

* update mass based on spec

* add 2019 Honda CRV Hybrid
2019-04-09 17:35:57 -07:00
eFini e89fd1236f Add Port for 2019 Honda Odyssey Exclusive (China version) (#592)
* Port for 2019 Honda Odyssey China ver

* update as per comments
2019-04-08 17:58:56 -07:00
dekerr bdf6585650 remove transpose (#588) 2019-04-05 22:59:38 -07:00
Riccardo 4662cfc8d7 Chrysler: matching file in panda repo 2019-04-05 00:27:39 -07:00
Drew Hintz dd32343342 Add Chrysler Pacifica Hybrid 2019 (#591)
Add Chrysler Pacifica Hybrid 2019 to list of supported cars.
Clarify Jeep 2019 minimum steering speed.
2019-04-04 23:45:57 -07:00
Drew Hintz 1efa3f0eba 📋📷 2019 Chrysler Pacifica and 2019 Jeep Grand Cherokee support (#590)
* 2019 Chrysler Pacfica and 2019 Jeep Grand Cherokee support, along with likely support for arbitrary models.
This is done by copying most values from the stock LKAS camera which is active with https://github.com/commaai/panda/pull/177

* No longer send LKAS_HEARTBIT because Panda now forwards it for us.

* Pacifica Hybrid 2018 combine fingerprints, add 808: 8

* panda chrysler: forward bus 0 to bus 2
copy of Panda commit: https://github.com/commaai/panda/commit/104950264473274e0012a39b7ea2d1468ef46d8d
2019-04-04 22:48:37 -07:00
Rick Lan 5fe6367d08 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-04-03 14:08:39 +10:00
Gernby ca2f30989d Eliminate unnecessary temporary disengagements (#584)
This status was defined as a bump error, but it isn't actually due to bumps.  It's also triggered by driver overrides that are somewhat higher than the "steer_override" threshold.  By removing this temporary disengagement, the car is much more predictable on bumpy roads AND in turns that require assistance from the driver.
2019-04-02 00:21:23 -07:00
Nigel Armstrong 03f09105c6 Update 0.5.10 Release Notes 2019-03-28 22:17:12 -07:00
Douglas Schilling Landgraf 5a9d89ed42 patches (#582)
* selfdrive: add sys module to exit call

exit() is a helper for interactive shell. Let's explicit
use the module sys.

* selfdrive: tomstoned.py use constant for /data/tombstones/

Instead of use multiple times a string for
the data dir, use a variable.
2019-03-26 20:50:37 -07:00
Rick Lan 99ba8c8cc8 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-03-27 09:02:39 +10:00
Rick Lan 88213d0cfd Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-03-27 09:01:26 +10:00
Vehicle Researcher f74a201edc openpilot v0.5.10 release 2019-03-26 01:09:18 -07:00
Vehicle Researcher be5c2aef3a Merge pyextra subtree 2019-03-26 01:03:51 -07:00
Vehicle Researcher ede869e34a Merge opendbc subtree 2019-03-26 01:03:50 -07:00
Vehicle Researcher 113d4c1b70 Merge panda subtree 2019-03-26 01:03:49 -07:00
Rick Lan 66f2a6fe01 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-03-20 10:18:51 +10:00
Rick Lan 365f3bd4dc Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-03-15 11:41:20 +10:00
Rick Lan a85488fbb8 move dbc files PR to opendbc repo. 2019-03-12 11:21:43 +10:00
Rick Lan c5933c9d8d fix symbol issue on checks array 2019-03-12 11:09:23 +10:00
Nigel Armstrong 27e0adc434 Add better volt fingerprint detection (#564)
Missing 578:8 causing unsupported car exception
2019-03-11 12:13:18 -07:00
Sumit Binnani 4697568e67 Added new fingerprint for 2018 Camry Hybrid LE (#560)
* Updated Fingerprint for Camry Hybrid LE

The updated fingerprint is a superset of the previous fingerprint (maybe due to blindspot monitors).
2019-03-11 12:08:52 -07:00
arne182 21a24446db Add better volt fingerprint detection
Missing 578:8 causing unsupported car exception
2019-03-11 11:00:06 +01:00
srpape 26cc816c1b Fix 2018 volt fingerprint (#561)
Update fingerprint and remove offending PACIFICA_2018 match
2019-03-09 18:17:20 -08:00
arne182 6c1f516bb3 update @Kumar fingerprint for better recognition (#554) 2019-03-08 17:26:08 -08:00
Rick Lan de0ea4820c Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-03-06 14:56:51 +10:00
Rick Lan 26e60a6b4b Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-03-04 09:57:44 +10:00
jfrux 737f2ace69 Updates splash image with newer UI for README (#543) 2019-02-28 20:13:07 +01:00
Rick Lan e7d4197a08 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-02-27 13:58:59 +10:00
Rick Lan 0db8d26c12 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-02-27 12:57:17 +10:00
Nigel Armstrong f0203614ee .gitignore visiond (#539) 2019-02-25 10:43:56 -08:00
Drew Hintz 8b7dfb647f remove Pacifica 2019 from supported car list (#538)
Although there's a fingerprint and LKAS constant for the 2019 Pacifica, it doesn't work well enough that I'd consider it supported.

P.S. I have an idea for how to support all Chrysler with one code base, even those I've never looked at. Forward can0 to the stock LKAS (can2) so that the stock LKAS is active. Then read the stock LKAS messages on can2 to both get the vehicle's LKAS constant, any status messages, and perhaps a more reliable counter. I'll try to code it up this weekend.
2019-02-22 12:48:33 -08:00
Nigel Armstrong 15fa6664c0 Chrysler updates (#537)
* Chrysler updates

* Update openDBC
2019-02-21 23:23:40 -08:00
Rick Lan 26c583b5c4 Merge branch 'devel-lexus-ish-ave30r' of https://github.com/eFiniLan/openpilot into devel-lexus-ish-ave30r
# Conflicts:
#	selfdrive/car/toyota/carstate.py
2019-02-22 16:13:27 +10:00
Rick Lan 181dba4514 * refactor carstate 2019-02-22 16:12:38 +10:00
Rick Lan 5f5698900c * refactor carstate 2019-02-22 16:08:33 +10:00
Rick Lan 1d0dc50f98 update safetyParam to 66 2019-02-22 12:40:36 +10:00
Nigel Armstrong 5c8aa7295d Update Panda 2019-02-21 13:44:39 -08:00
Rick Lan 2890a4ede8 add stop_and_go and update retParam value 2019-02-21 23:35:32 +10:00
Rick Lan 882eaf15bf Remove invalid signals/checks 2019-02-21 22:14:08 +10:00
Rick Lan 6fba167ef9 remove duplicated definition 2019-02-21 20:15:45 +10:00
Rick Lan 65b8466f22 Update dbc 2019-02-21 19:57:54 +10:00
Rick Lan 9c3ec2fd2d Merge branch 'devel' of https://github.com/eFiniLan/openpilot into devel-lexus-ish-ave30r 2019-02-21 16:46:29 +10:00
Rick Lan a1d96b4d8a fix indentation 2019-02-21 16:38:48 +10:00
Rick Lan 57bca3c658 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r
# Conflicts:
#	selfdrive/car/toyota/interface.py
2019-02-21 16:36:17 +10:00
Rick Lan 40422ea5d6 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-02-21 16:14:15 +10:00
Vehicle Researcher 0207a97040 openpilot v0.5.9 release 2019-02-20 01:39:02 +00:00
Vehicle Researcher fdb04d9f69 Merge pyextra subtree 2019-02-20 01:32:52 +00:00
Vehicle Researcher 27f405bb6f Merge opendbc subtree 2019-02-20 01:32:51 +00:00
Vehicle Researcher 26da755a1e Merge panda subtree 2019-02-20 01:32:50 +00:00
Rick Lan 7017f8ebf0 apply quillford's value again 2019-02-17 12:36:49 +10:00
Rick Lan 19660515b5 Revert "remove unnecessary changes in carstate.py"
This reverts commit b9cf00f4ce.
2019-02-17 12:36:11 +10:00
Rick Lan d1fe6a9667 getting error from last change, revert a couple back. 2019-02-17 10:46:07 +10:00
Rick Lan c227f977e6 apply quillford's KpV and KiV value. 2019-02-17 10:30:38 +10:00
Rick Lan b9cf00f4ce remove unnecessary changes in carstate.py 2019-02-17 10:28:20 +10:00
Rick Lan d192b4fa8f Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-02-15 15:00:34 +10:00
Rick Lan f760fa00ae Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-02-15 14:59:28 +10:00
eFini 88246af4c7 Allow uploader.py to compress rlog without upload permission (#471)
* Always Compress - Make sure uploader to bzip2 rlog once it's completed without any upload permission.
2019-02-13 20:39:24 -08:00
eFini 03f13e614b Add "Accept-Encoding: gzip" header to mapd.py to reduce data consumption (#525) 2019-02-13 18:19:17 +01:00
Rick Lan 83cbf29588 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-02-07 12:11:55 +10:00
Rick Lan 022b058bc5 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-02-07 12:10:23 +10:00
Riccardo 23512ba932 Readme: FCA giraffe added 2019-02-06 16:40:08 -08:00
Rick Lan f789be8485 * add matched canbus message descriptions from 2017_toyota_master.dbc 2019-02-05 15:52:17 +10:00
kegman ee35b905d7 Eliminate brake oscillations and grinding / crunching / ripping sound when using Pedal (Honda Pilot Only) (#475)
* Eliminate brake oscillations when using Pedal

* Simplified code

* syntax error fix

* Grinding code as applied to Honda Pilot only 

Each model may need its own setting due to USER_BRAKE noise disengagements

* correction: self.CP.carFingerprint instead of CP.carFingerprint

* Add Ridgeline to Pedal Grinding fix

Confirmed to work also on Ridgeline
2019-02-04 20:30:19 -08:00
Rick Lan 8310b01530 update dbc file add a couple more definitions 2019-02-01 16:44:59 +10:00
Rick Lan d2f755286c Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-01-30 16:20:19 +10:00
Rick Lan 8fbcaf423e Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-01-30 16:18:35 +10:00
rbiasini 2c9d5afd75 removal of snpe libs (#517)
Removal of unnecessary snpe shared libs
2019-01-28 21:10:39 -08:00
Roma Sokolkov 860623f157 Add missing mapd and orbd dirs into README.md (#515) 2019-01-26 15:08:10 -08:00
Drew Hintz 73c1df714d fix typos, Jeep tuning (#511) 2019-01-25 22:41:08 -08:00
Rick Lan 6ff384ba3f Update dbc file to support mini car and left/right line indicator on display 2019-01-25 12:28:04 +10:00
Rick Lan 9e2be16440 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-01-25 12:07:38 +10:00
Rick Lan 5dfc758d33 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-01-25 11:51:16 +10:00
Vehicle Researcher b967da5fc1 openpilot v0.5.8 release 2019-01-23 15:34:52 -08:00
Vehicle Researcher f364a3ee8f Merge opendbc subtree 2019-01-23 15:28:22 -08:00
Vehicle Researcher ece9cf9480 Merge panda subtree 2019-01-23 15:28:16 -08:00
Chris Souers d5f8643e7c Increment hatchback year (#508)
Confirmed working by user. Same steer dropout as before.
2019-01-21 18:01:16 -08:00
Riccardo 9cf542d7f7 Updated links from Slack to Discord 2019-01-14 14:32:43 -08:00
Chris Souers 9eb1666a52 Merge new 2019 Civic and existing 2017-18 Civic Hatch (#446)
* fingerprint and new car

* you know the drill

* fix

* mod civic hatch to work for now

* try to merge hatch and other bosch

* fix

* fixed spaces

* comma (heh)

* make mass civic

* Add to readme. Need to confirm speed

* steering dropout at ~3.3 kph

* Remove additional fingerprint

* combined comment. fixed formatting to match
2019-01-11 17:13:57 -08:00
Kylan b78ed77f1d Adding GM Steering Rate (#495)
* adding steering rate

* adding steering rate
2019-01-08 19:40:09 -08:00
Ted Slesinski d84e64b315 Fixed TOC anchor links (#492) 2019-01-02 20:33:37 -08:00
ErichMoraga 0fded2c08b Added EX-L subsection for the existing 2019 Pilot (#489)
*  Added EX-L subsection for the existing 2019 Pilot

Verified working with @Hitmantw25 12/20... and again 12/27 (VG w/ "Josh").

* Update selfdrive/car/honda/values.py

@energee wants to revert a change he made in a previous PR.

Co-Authored-By: ErichMoraga <33645296+ErichMoraga@users.noreply.github.com>

* Removed an extra space @energee included.
2018-12-30 18:23:10 -08:00
arne182 67e7f6dc3d Update 0x365 for Rav4H from @squall and my observations (#490)
on stock 00000080fc0008 is the inital value then it changes to a static 00000080fd0008
2018-12-29 11:12:28 -08:00
Andrew Frahn 4d2ff103d6 Clean Up hyundai (#481)
* Update fingerprints.py

Taiwanese Prius Prime fingerprint was identical to the regular prime (107 msgs.), but should really have 110.  I have the correct one in there now.

* openpilot 0.4.3.1 (#220)

* Honda Pilot 2017 Port (#161)

* Update README.md

* Update fingerprints.py

* Update carstate.py

* Update hondacan.py

* Update interface.py

* Update interface.py

* Update interface.py

* Update README.md

* Update README.md

* Update README.md

* Update fingerprints.py

* Update carstate.py

* Update hondacan.py

* Update interface.py

* Update carstate.py

* Update hondacan.py

* Update README.md

* Update fingerprints.py

* Update carstate.py

* Update carstate.py

* Update carstate.py

* Update hondacan.py

* Update interface.py

* Update carstate.py

* Update carstate.py

* Update Pilot Fingerprint

* Update fingerprints.py

* Give pilot its own definition and not use ILX

* add pilot argument

* Add Pilot interface

* Add pilot argument

* Update interface.py

* Parse Different gear on pilot

* Add steer max

* Fixed duplication of steer max value

* Adjust PID's for steering

* Update carcontroller.py

* Change Steer Ratio and wheelbase

* Update Steer fault values

Steer fault value of 3, does not seem to effect anything

* Update Kp,Ki Ratio

* Update interface.py

* Update readme for Pilot

* add pilot

* Update fingerprints.py

* Update carstate.py

* add signals

* add signal

* fix restricting video upload to wifi

* Dibs on SAFETY_GM numerical value

To match Panda repo.

* Safety Reference for Honda Bosch

* Update fingerprints.py (#210)

Consolidated my fingerprint and removed duplicates and ordered the fingerprint for the RAV4H. Double Checked.

* Interpolate ki/kp for steering PID loop (#200)

* Interpolate ki/kp for steering PID loop

Very much needed for the Volt port: car ping-pongs with low kp
on high speeeds, and the loop is unstable with high kp on
low speeds.

Also, removes "number or array?" logic from PIController,
now that all the callers use interpolation ofr ki/kp.

* Pass speed to steering PID loop for ki/kp interpolation

* Remove unused numbers import

* Slight changes to UI and Fingerprint for Odyssey Elite (#196)

* Adding back drive time to UI

* Add fingerprint for Odyssey Elite

* Removed extended fingerprint for Elite

* Revert "Adding back drive time to UI"

This reverts commit b9b02f7ff2511f28922f0bea47cd8c70bb9f4010.

* Squashed 'panda/' changes from 98f29a4..67d5208

67d5208 fix signedness issue in toyota safety
fe15d3f bump pandacan
11c2b08 add fault invalid
2c26e45 add sleep
27c7637 forgot the counter
3a6d7db don't hang
bfa7d2e canloader works
b259e2a can flasher is close to working
83f2edf isotp can support in softloader
7ae7c79 typo
e85cc47 forgot the selfs
190b4f6 start work on canflasher
5c655c9 add recover support
ae3457f usbflash is reliable
f7a0ab0 pedal usbflash works
585d0f9 add way to call isotp
be82899 despite it being bad code, move isotp
000715b start work on pedal canloader
626e312 pedal has a bootstub now
3662d1e redundant check
81e6b0d fix bug
083cd12 should have bounty to refactor that ish
b65d30c bad asserts
b2e6c3f isotp untested support for subaddr
30fd66a Merge pull request #93 from vntarasov/volt
06f5109 Merge pull request #94 from gregjhogan/can-printer-hex
c7d098c Merge pull request #95 from gregjhogan/setup-script
22fe250 Merge pull request #99 from gregjhogan/bit-transition-example
ba16ba3 Merge pull request #100 from gregjhogan/j2534-troubleshooting-instructions
ad08ea4 Merge pull request #90 from gregjhogan/can-forwarding
f3b6f5d added j2534 troubleshooting instructions
858d150 added script to find bits that transition from 0 to 1
c6acac8 added checking pedal interceptor message length
f7226ff added brake safety checks
d0c2634 added gas safety checks
d378e4a removed bosch safety forwarding restriction on 29 bit addresses
5c7ef9e added bosch safety hooks and forwarding
90c64b6 add note
23de8d4 Merge pull request #97 from commaai/pedal_improvements
0261641 added missing python packages
b92b235 fix bytearray encode issue
2434f1c Tweak Volt's brake pedal stickiness
e2f73d2 enable has a whole byte to itself
d5a9e1e correct checksum
f8ed9fa better names
986a14c don't alias pointers
9b8472e add watchdog support
8f0add9 handle faults
1d917f8 split gas set into 2 values, and have a fault state
1b77026 j2534 isn't alpha anymore
fbcc872 Merge pull request #92 from commaai/pedal
8a6f44b pedal is sending messages
08f464c python 3 bro is bad bro
9390961 kline checksum algo was broken...
3b7c33b add kline debug support
aa622bc init values
631ea9f better refactor
eb1fd75 add PEDAL adc sets
ccaa310 don't build with usb
8d4d763 debug console works
bd09883 comma pedal is building
75a29d5 Merge pull request #84 from gregjhogan/j2534-hds
eece37d only the panda has gmlan
9f43abe Merge pull request #89 from vntarasov/volt
5364d43 Merge pull request #88 from vntarasov/smaller-firmware
377a1ec bump version for descriptor fix
4fabdf0 Merge pull request #87 from gregjhogan/usb-multi-packet-control
8580773 fix sending WinUSB Extended Properties Feature Descriptor
6908feb Chevy Volt safety
786a004 Enable optimization to reduce firmware size
d70f43b hack to fix thinkpad
95ab1ae fixed flow control message padding
bbd04d1 updated installer
62216d0 single standalone DLL for J2534 driver
5c9138d fixed 11 bit address issue
f3b0ad2 fix LOOPBACK getting set when DATA_RATE is set
b750d36 updated README
a9a097f lowered CPU utilization
7c26a70 TIS needs unsupported protocols to return an error
42692b4 TIS doesn't like ChannelID being zero
cf126bb SET_CONFIG return error for reserved parameters
2e99dbf fix HDS issues
8203cc8 add is_grey
e946a54 add insecure_okay flag
4363b3e check webpage
4f59ded add secure mode note
6b11fb5 add autosecuring to tests
b27d185 Merge pull request #86 from commaai/better_pairing
4b53b42 elm wifi isn't an automated test
99f85cb Merge pull request #85 from gregjhogan/usb-wcid
0d38060 auto-install WinUSB device driver
c6653ca from python import
38cc0ee add wifi_secure_mode, boots in insecure mode

git-subtree-dir: panda
git-subtree-split: 67d52089a1300b86800d897f2b271e0a24cf6dd6

* Squashed 'opendbc/' changes from 81d9871..aa067f7

aa067f7 Chevy Volt tweaks (#83)
a60c6c4 Toyota: change signal name in EPS_STATUS msg
ce70b1a extra setme field toyota LKAS_HUD
df2a552 toyota missing ACC_CONTROL checksum
48bb293 Revert "Toyota Prius: added a comma specific message to control the speed sent to the EPS"
5f42439 Toyota Prius: added a comma specific message to control the speed sent to the EPS
6f5e8b6 Pedal Interceptor: fault state VAL moved to _comma
efd5f5c add setme to honda ACC_HUD
97fc335 add interceptor to civic
6f40f16 update generator script to allow for multiple imports
9ca956b add setme to toyota STEERING_IPAS
e5afa57 run generator for ipas scaling
8bd1182 Toyota IPAS: proper steer angle unit
f57511e acceleration pedal for gasPressed
c8d1dbc high beams also. likely dashboard message.
9f1c78b high beams for genericToggle
f037d42 turn signal lights (and thus hazard lights)
b35bb08 turn signals
78986cf Revert "turn signals"
ba946c9 turn signals
2af3ecc Speed, braking, and distance signals
f40ab87 Set packet lengths, adding steering rate, adjusted speed
cd59bfa units for speed_right
c2fcce2 speed of right vs left side of car
4ef5fae value table for gear status
97c48e2 tighten up speed bits. brake pressue max comment.
a0cbfd1 add gear status PRNDL
0c82865 initial signals for chrysler pacifica 2017 hybrid
5ed0540 add set me to toyota LKAS_HUD
aecac5d add set me fields to toyota ACC_HUD
5417013 update toyota ACC_CONTROL fields
e91e967 Comma Pedal: made GAS_COMMAND 6 bytes
d04434a Comma Pedal: added state byte and enable bit
c30b2cd Comma Pedal: sending 2 tracks on 0x200
8f72467 Volt doors and belts status (#70)
60f8b6c add set me to lkas hud honda
3c9e335 fix honda pcm gas message size
7ca471d Add 2018 Toyota CHR dbc (#78)
637fe00 set scaling to 1 for brake and gas which have no real unit
62a88d4 Volt: switch to parsing ACC buttons from powertrain CAN (#74)
3fdd47b Volt's gas pedal only and combined gas/acc (#76)
45ec9c9 Add 2017 Honda Ridgeline (#77)
cbd186a Add 2018 Camry Hybrid DBC's (#73)
974eeaf Toyota: re-generated the files after cfbc9ae363f98ef
19ea195 Toyota: more vals for LKA_STATE
cfbc9ae fixed inconsistent factor for speed in Honda dbc files
e7db803 convert all line endings to unix style

git-subtree-dir: opendbc
git-subtree-split: aa067f7079aa12617f7a37d85233e51af44e1bb2

* openpilot v0.4.3 release

* Squashed 'panda/' changes from 67d5208..3125232

3125232 bump version
703c0b4 Gas Interceptor: another fix to gas pressed logic
196d383 Interceptor: fixed gas pressed logic

git-subtree-dir: panda
git-subtree-split: 31252324d98e701c33cb6aeda20af6b549175764

* Squashed 'opendbc/' changes from aa067f7..91e882d

91e882d Updating bosch dbcs to use new format and bringing in new honda changes (#82)
9b32e2e Fix Checksum errors for CH-R (#86)

git-subtree-dir: opendbc
git-subtree-split: 91e882d4a04c129e12d39bcff0bbe56b75166e0f

* openpilot v0.4.3 release

* openpilot v0.4.3.1 release

* fix bug in canpacker for Toyotas with DSU connected (#221)

* update year on civic

* Revert "openpilot 0.4.3.1 (#220)"

This reverts commit 640ab12c72.

* Revert the changes to GM in 0.5.4 (#380) (#386)

* Revert 0.5.4 changes for GM for 18ers

* Redo the refactor of stock control msgs

* Fixed missing CONTROL_MSGS -> STOCK_CONTROL_MSGS

* Remove spacing

* Need candidate array idx

* Cleanup

Uses generic dbc
All car names in alphabetical order
All fingerprints in alphabetical order
Acknowledgement to users who have made each vehicle possible

* no unecessary comments

* Match dbc to opendbc
2018-12-26 21:43:04 -08:00
Braden 58e716ff48 Read from usb/present instead of usb/online (#484) 2018-12-25 09:51:07 -08:00
ErichMoraga f41cb3b4ec Replaced 60 msg. C-HR print w/ 73 msg. C-HR print (#467)
Confirmed working, and necessary with @wackojacko Toyota CHR's Kiwi (New Zealand) ICE C-HR.
2018-12-21 01:43:18 -06:00
arne182 b5d8230c3d add self.CP = CP as with other carstate files (#459) 2018-12-21 01:40:26 -06:00
Ted Slesinski 853bcda352 Adds 2019 Ridgeline fingerprint (#473)
* Adds 2019 Ridgeline fingerprint

* Add readme
2018-12-21 01:21:05 -06:00
rbiasini 4610a6e4d4 Faster NEOS download and auto removal of NEOS image after installation (#478) 2018-12-21 01:17:27 -06:00
Rick Lan 14894b4b66 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-12-17 17:11:43 +10:00
Rick Lan fdccc48bf7 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-12-17 17:10:45 +10:00
rbiasini 067f1bfe9e hotfix: wait longer in CDP mode before switching to fast charge, so EON can boot (#469) 2018-12-16 19:54:29 -07:00
Rick Lan 8e491aaf58 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-12-14 10:42:46 +10:00
Rick Lan c46d931f40 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-12-14 10:25:05 +10:00
Riccardo e3c934bcc1 0.5.7 hotfixes 2018-12-13 20:49:44 +01:00
Rick Lan 6c3468b02f Move ave30r related changes to only this branch 2018-12-12 11:52:31 +10:00
Rick Lan d398ba2c62 Merge branch 'devel' of https://github.com/EternityLan/openpilot into devel-lexus-ish-ave30r 2018-12-12 11:51:16 +10:00
Rick Lan 8e346aa668 revert changes. 2018-12-12 11:50:06 +10:00
Rick Lan 989f3c5ecc Merge branch 'devel' of https://github.com/EternityLan/openpilot into devel 2018-12-12 11:47:37 +10:00
Rick Lan 5806c90a3e revert devel back to stock devel 2018-12-12 11:47:31 +10:00
Rick Lan 2c081208eb revert devel back to stock devel 2018-12-12 11:45:51 +10:00
Rick Lan ef64a1bf5f Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-12-11 18:39:00 +10:00
Rick Lan 278ce557da Merge branch 'devel' of https://github.com/EternityLan/openpilot into devel 2018-12-11 18:36:40 +10:00
Vehicle Researcher 210db686bb openpilot v0.5.7 release 2018-12-10 14:13:12 -08:00
Vehicle Researcher 573a6915fc Merge pyextra subtree 2018-12-10 14:06:10 -08:00
Vehicle Researcher dc331df1fc Merge opendbc subtree 2018-12-10 14:06:07 -08:00
chassdesk 5c4ae7a2fc Add Lexus RX450HL as sub to RX450H (#458)
Add Lexus RX450HL as sub to RX450H
2018-12-08 13:13:09 -08:00
Chris McCammon 29bea62ac1 Fixed Capitalization + Made CT6 Comment Cleaner (#456)
* Update README.md

* Updated CT6 comment
2018-12-07 17:32:41 -08:00
Vasily Tarasov 024870d16a GM: Cadillac ATS Coupe 2018 support (#445)
* GM: Cadillac ATS Coupe 2018 support

* Missed adding Cadillac ATS
2018-12-06 21:22:21 -08:00
Rick Lan 5ff4ff176b Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-12-05 12:54:42 +10:00
Kylan 68e56c8017 Adding support for 2018 GMC Acadia Denali (#453)
* added acadia

* adding acadia

* adding acadia

* Update radar_interface.py

* adding acadia

* refactored

* fixed tuning

* Adding acadia

* Update interface.py

* fixed whitespace

* fixed whitespace
2018-12-04 08:35:36 -08:00
rbiasini 9d76070ab7 Honda Nidec: avoid giraffe setting alert when car is turned off (#449) 2018-11-29 20:36:34 -08:00
Rick Lan 87b02db857 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-11-23 11:03:32 +10:00
rbiasini 6ec0d23b7a Added Astra support to README and RELEASE notes (#443) 2018-11-21 00:01:04 -08:00
Rick Lan c0929d6954 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-11-21 15:38:07 +10:00
Alex Hill c9dd7fe0e6 Add initial support for Holden/Opel Astra BK (#431) 2018-11-20 20:12:50 -08:00
Rick Lan 8ca37f5d44 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-11-20 16:02:26 +10:00
Vasily Tarasov e32463ee96 Keep steering on radar fault (#442) 2018-11-19 20:25:33 -08:00
Rick Lan f43e347fbf revert if else statement so it doesn't cause error. 2018-11-19 21:10:50 +10:00
Rick Lan 32003bd048 remove else statements 2018-11-19 12:27:34 +10:00
Rick Lan a326b4b4cd Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-11-19 12:19:56 +10:00
Rick Lan bf1368b4cf ignore standstill in lexus ish 2018-11-19 12:19:27 +10:00
dekerr 53c6ca6589 Move calibration values (#441)
* initial commit

* moved constants
2018-11-18 17:18:29 -08:00
Vasily Tarasov e4ed48928b GM: remove refactor leftovers (#440) 2018-11-18 16:13:44 -08:00
Rick Lan c3d5b9d62e fix dbc to adapt 0.5.6 2018-11-18 15:55:06 +10:00
Rick Lan d5916b92d5 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-11-18 14:13:32 +10:00
Abdul Hagi b94d598c2d Added 2016 Honda pilot (#438)
I am able to validate that openpilot works on a 2016 Honda Pilot.
2018-11-17 09:34:48 -08:00
Vehicle Researcher 860a48765d openpilot v0.5.6 release 2018-11-17 02:08:34 -08:00
Vehicle Researcher 92c596544d Merge pyextra subtree 2018-11-17 01:58:38 -08:00
Vehicle Researcher 3e78efacca Merge opendbc subtree 2018-11-17 01:58:36 -08:00
Vehicle Researcher 3b744f4fba Merge panda subtree 2018-11-17 01:58:34 -08:00
Rick Lan 91dd484c27 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-11-16 09:06:10 +10:00
rbiasini b4dd562c43 Revert "Honda Pilot tuning / lane centering fixes (#408)" (#433)
This reverts commit fdbf1c5938.
2018-11-13 14:36:29 -08:00
Rick Lan bfaf9e6f66 use downloaded file 2018-11-12 16:06:12 +10:00
Rick Lan 30eb131980 more changes 2018-11-12 16:05:26 +10:00
Rick Lan 24d0084938 remove changes 2018-11-12 16:04:42 +10:00
Rick Lan a7cadcc390 fix 2018-11-12 16:03:55 +10:00
Rick Lan 8cfdc1cbc2 revert changes 2018-11-12 15:55:01 +10:00
Rick Lan 88dd52414f removed all customd stuff 2018-11-12 15:51:55 +10:00
Rick Lan 0b21c835a4 some minor code update. 2018-11-12 15:44:33 +10:00
Rick Lan 81f3709a9f Use os.system instead of subprocess. 2018-11-12 13:10:16 +10:00
Rick Lan f6214eb932 * init -- customd 2018-11-12 11:51:53 +10:00
arne182 892e14aa92 0x470 for RAV4H (#428)
@squall and me have checked the dsu static values for our RAV4H and found that this is similar to the highlander message.
2018-11-09 13:36:34 -08:00
Rick Lan de3e265b36 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-11-09 15:31:44 +10:00
rbiasini 8b7c726bea more stable calibration (#427)
* more stable calibration

* no commented print
2018-11-08 19:48:21 -08:00
Rick Lan 3239f78e69 Merge branch 'devel' of https://github.com/EternityLan/openpilot into devel 2018-11-09 13:35:53 +10:00
Rick Lan d27257bbbb more changes for removing lexus specific safety. 2018-11-09 13:35:39 +10:00
Rick Lan 4631a7e81f more changes for removing lexus specific safety. 2018-11-09 13:34:36 +10:00
Rick Lan 53f2722a3d Cruise state on lexus and toyota are both in 0:1D2 @ 0x20, so we can mergee lexus specific safety check with toyota. 2018-11-09 13:31:33 +10:00
Rick Lan 0d62ee7598 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-11-09 09:59:36 +10:00
ErichMoraga db24b1e838 Expanded the previously added Chinese RAV4 (#425)
This came after testing a different trim level.  This fingerprint is confirmed working on both.
2018-11-08 09:56:05 -08:00
Rick Lan 1efeded724 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-11-07 16:56:35 +10:00
dekerr 7db592d3b8 Faster calibration filtering (#421)
* separable filter

* add missing args

* formatting

* fix casing
2018-11-06 13:51:37 -08:00
ErichMoraga b7c029c92c Added fingerprint for Chinese RAV4 (#422)
Confirmed working on 2017-2018 Chinese RAV4 by @Fiftycentsjj
2018-11-05 18:43:50 -08:00
kegman fdbf1c5938 Honda Pilot tuning / lane centering fixes (#408)
Tuned kP and kI and Tire Stiffness Factor settings.
Fixes lane centering issues in the following situations:
1.  Hugging of left lane line during fast left curving roads
2.  Hugging of right lane line during fast right curving roads
3.  Left bias in fast lane on crowned roads (sloping down to the left)
4.  Right bias in slow lane on crowned roads (sloping down to the right)
Works better when lane_width = 2.85 (vs 3.7 default) in pathplanner.py
2018-10-31 11:09:48 -07:00
Rick Lan 29aaade7ab added missing line break 2018-10-31 12:44:21 +10:00
Rick Lan f7f91aec22 Merge branch 'devel' of https://github.com/commaai/openpilot into devel
# Conflicts:
#	selfdrive/boardd/boardd.cc
2018-10-31 12:41:16 +10:00
dekerr 00429e6bbb Improve VM dynamic sol accuracy (#391)
* use solve and eye func

* remove uneeded import from vehicle model
2018-10-30 22:30:09 +01:00
Jafar Al-Gharaibeh 2f8034b2ec boardd: keep defined safety models in sync with panda repo (#412)
This is a noop for most users, but for those of us working on new
car ports where we have our own additional defines, having
those defines out of sync creates merge conflicts in one place
(good so we can fix it) but not the other ( not good becasue
they will go unnoticed). I learned this the hardway!.

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>
2018-10-30 22:13:18 +01:00
Rick Lan 1d4c811611 min enable speed set to -1. 2018-10-29 08:54:27 +10:00
Willem Melching 5501541aa2 Improve Toyota radar filtering (#409) 2018-10-26 17:26:00 +02:00
Rick Lan 421fe728f1 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-10-26 10:57:45 +10:00
Rick Lan 9683bccaf6 * revert unnecessary changes 2018-10-26 10:24:57 +10:00
Rick Lan 666826198f * added missing values in checks[] 2018-10-26 10:23:39 +10:00
Rick Lan fcbb07b1a0 * clean up changes, rename PCM_CRUISE_LEXUS_ISH in dbc to PCM_CRUISE_2 to reduce changes required in carstate.py 2018-10-26 10:19:49 +10:00
Vasily Tarasov 3d05cca678 GM: disengage on radar fault (#396)
* GM: copy cadillac's radar header DBC

* Remove unused interface imports

* Rename num targets message to radar header

* Catch various radar faults
2018-10-23 18:59:34 -07:00
James-T1 195139999b Update Genesis fingerprint for longer version from Saeed (#406) 2018-10-23 18:57:51 -07:00
Rick Lan 9e067e91ee making sure every SAFETY_LEXUS_ISH defined as 9 2018-10-24 10:12:04 +10:00
Rick Lan c675c28356 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-10-24 10:05:58 +10:00
Rick Lan f2f7e8d516 update lexus ish defined value to match the value in safety.h in panda/ 2018-10-24 10:03:52 +10:00
rbiasini c9fa92b377 remove badly named file (#404) 2018-10-23 12:05:11 -07:00
Rick Lan 8237b60749 removed extra defined 2018-10-23 14:36:27 +10:00
Rick Lan 7405041b42 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-10-23 13:45:42 +10:00
Willem Melching dfa7757c40 Fix Visiond (#402) 2018-10-22 21:59:18 +02:00
Rick Lan 4bc57a9792 * merged with 0.5.5 2018-10-22 10:42:22 +10:00
Vehicle Researcher 8f3539a27b openpilot v0.5.5 release 2018-10-21 15:00:31 -07:00
Vehicle Researcher e8ae37e36e Merge opendbc subtree 2018-10-21 14:52:59 -07:00
Vehicle Researcher a2c76acf3b Merge panda subtree 2018-10-21 14:52:58 -07:00
Ted Slesinski 7ed5c6554d Added new fingerprint for EX-L (#401) 2018-10-20 11:02:00 -07:00
Rick Lan 851d6f1b96 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-10-19 12:02:17 +10:00
Rick Lan 4eeaaf1b08 * update auto high beam dbc address. 2018-10-19 12:02:00 +10:00
Andrew Frahn 5641fc986d Revert to using CLU15 message for Gear Selection for Compatability Reasons (#362)
* hyundai WIP

* steer_driver_factor is 1

* removed unnecessary file

* removed unnecessary code

* Update carcontroller.py

bug fix

* safety tuning and fixed interface stiffness

* better lateral tuning, some fixes

* Fix set speed

* added camera state reading, autoresume from stop, cancel on accel, hud alerts

* WIP

* Updated for Kia Sorento *WIP*

* Cleanup

* clean2

* Bug Fixes

* pre-merge

* Add all the cars!

* Panda to auto-detect Camera Bus

* Move Checksum Check

* Final Sorento Tuning

* Make CAN3 for Cam default

* Update README.md

* update panda, minor aesthetic updates

* few other minor changes

* added steer not allowed alert

* bup panda version to force panda update

* fixed camera alerts

* Revert to using CLU15 for Gear Selection

* Missing Defines

Didn’t realise this was removed as well!

* Change Gear Selection Definitions

Add logic to use transmission message rather than cluster message for all gear selections UNLESS the car in question does not have the known good transmission messages

* Revert Camera CAN Bus

* self.candidate

* fixed fingerpint, tested on Sorento

* Update for Elantra on Hyundai-Dev Branch

Latest Elantra values that correlate to progress Community branch.
2018-10-14 07:30:18 -07:00
Vasily Tarasov c499aa549c GM: LKA dashboard icon support (#389)
* GM: LKA dashboard icon support

* Decrease camera keepalive interval

* Use tuple for LKA icon status
2018-10-12 17:37:13 -07:00
Rick Lan 243f10d5fb Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-10-10 16:16:40 +10:00
dekerr 0a99fe3baa Save one inverse call in building transformation matrix (#384) 2018-10-08 21:02:20 +02:00
Rick Lan 837809774b Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-10-04 14:26:51 +10:00
Jamezz 8cc32df779 Revert the changes to GM in 0.5.4 (#380)
* Revert 0.5.4 changes for GM for 18ers

* Redo the refactor of stock control msgs

* Fixed missing CONTROL_MSGS -> STOCK_CONTROL_MSGS

* Remove spacing

* Need candidate array idx
2018-10-01 19:13:34 +02:00
Rick Lan 2100e46b60 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-09-28 12:24:12 +10:00
George Hotz 8291f35701 Merge pull request #377 from commaai/nowiggle
visiond: replace wiggly model with non wiggly model
2018-09-27 13:25:00 -08:00
George Hotz 0f885c87a5 visiond: replace wiggly model with non wiggly model 2018-09-27 09:52:07 -07:00
Rick Lan c7f9c1bd69 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-09-26 10:15:33 +10:00
Vehicle Researcher a422246dc3 openpilot v0.5.4 release 2018-09-25 00:13:41 -07:00
Vehicle Researcher e5b2ec4f01 Merge opendbc subtree 2018-09-25 00:04:00 -07:00
Vehicle Researcher 97f1ee4a0d Merge panda subtree 2018-09-25 00:03:58 -07:00
Vasily Tarasov 2d450bc3a8 Increase Volt's steering limit (#351)
* Increase Volt's steering limit

* Merge panda subtree
2018-09-22 04:41:44 +02:00
Vasily Tarasov 96c923875b GM refactor (#374) 2018-09-22 04:40:52 +02:00
wocsor 14b7eadf63 Add XSE trim to fingerprints (#372) 2018-09-21 01:06:15 +02:00
Rick Lan 574fabf9ca Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-09-20 12:08:22 +10:00
Ted Slesinski 402faabd42 Docker environment breaking (#369)
* Fixes matplotlib dependency

* Use version 2.1.2
2018-09-20 02:59:18 +02:00
Rick Lan 00def2849c * fixed opendbc content order, otherwise cabana can't load it. 2018-09-20 10:27:43 +10:00
Rick Lan 9df9019c1e * revert unnecessary changes. 2018-09-19 14:10:37 +10:00
EternityLan c818b6ada3 Merge pull request #1 from EternityLan/devel_lexus-ish-ave30r_v2
Devel lexus ish ave30r v2
2018-09-19 14:05:16 +10:00
Rick Lan be750af7ff Merge branch 'devel-lexus-ish-ave30r' of https://github.com/EternityLan/openpilot into devel_lexus-ish-ave30r_v2 2018-09-19 14:02:25 +10:00
Rick Lan f8752fbe2c * fixed .tx_lin assignment 2018-09-19 13:59:00 +10:00
Rick Lan fbbfcc5a74 * renamed AVE30 to ISH 2018-09-19 10:13:07 +10:00
Rick Lan 67ccfb11c7 Merge branch 'devel' of https://github.com/commaai/openpilot into devel_lexus-ish-ave30r_v2 2018-09-19 09:08:10 +10:00
Rick Lan 31d9f18fca * v2 init 2018-09-19 09:05:48 +10:00
Rick Lan 02b6a7a82b Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-09-19 09:02:35 +10:00
Ted Slesinski de79a07745 Add support for accord hybrid (#361) 2018-09-18 06:39:58 +02:00
wocsor 4b2c137489 update CHR fingerprint (#364)
CHR 2016 fingerprint has more messages
2018-09-17 22:24:52 +02:00
Andrew Frahn b3654cbcc9 Kia Sorento and future Multi-Car Support (#346)
* hyundai WIP

* steer_driver_factor is 1

* removed unnecessary file

* removed unnecessary code

* Update carcontroller.py

bug fix

* safety tuning and fixed interface stiffness

* better lateral tuning, some fixes

* Fix set speed

* added camera state reading, autoresume from stop, cancel on accel, hud alerts

* WIP

* Updated for Kia Sorento *WIP*

* Cleanup

* clean2

* Bug Fixes

* pre-merge

* Add all the cars!

* Panda to auto-detect Camera Bus

* Move Checksum Check

* Final Sorento Tuning

* Make CAN3 for Cam default

* Update README.md

* update panda, minor aesthetic updates

* few other minor changes

* added steer not allowed alert

* bup panda version to force panda update

* fixed camera alerts
2018-09-10 00:30:36 +02:00
Rick Lan 3103b9bfea Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r
# Conflicts:
#	selfdrive/car/toyota/interface.py
2018-09-08 19:53:22 +10:00
rbiasini d2b8c4f0cb fixed sign in after Google change (#357) 2018-09-08 06:19:48 +02:00
zeeexsixare 50d9c446cf Tried native Stop and Go on Highlander ICE with no comma pedal: Works! (#353)
* Trying to make Highlander ICE stop and go

* Making acceleration slow for fuel efficiency

* Removing annoying commanded disengage beep

* Raised accel_max by 50% and commented on chime

* Testing if Highlander ICE can resume follow from 0

* Returned to 1.5 m/s2 for testing stop and go

* Prep for merging upstream

* Prep for upstream merge item #2

* Added Highlander ICE/Hybrid to Stop and Go

Also updated table of vehicles

* Rollback advertising stop and go for Highlanders

* Fix whitespace
2018-09-07 05:03:10 +02:00
Vasily Tarasov 6eb1247426 GM: update readme, ACC is a required package (#354)
ACC implies Driver Confidence II, but not the other
way around. Openpilot requires front, long range radar
that only comes with ACC package.
2018-09-07 05:01:53 +02:00
Vasily Tarasov faea9a42c4 GM: go passive if detected ASCM or LKA camera (#350)
Since fingerprint is powertrain CAN only, camera still present
on object bus is not an issue.
2018-09-06 20:59:05 +02:00
daehahn 86813e6d37 Correct typo for Highlander (#349) 2018-09-05 15:29:36 -07:00
Vasily Tarasov 012727ef60 Change dashboard command of GM to use packer (#347)
* Change dashboard command of GM to use packer

Also, separate "follow distance" from "engaged".

* Fix dashboard setSpeed scaling
2018-09-04 00:21:04 -07:00
Rick Lan fb470830ed * update safetyParam, 100 doesnt hold bumpy road 2018-09-04 17:16:37 +10:00
Vasily Tarasov 9653f9d6a6 Fix pre-enable engagement on GM (#348)
In 2017 Volts, PCM fault occurs for a few seconds if ACC gas
is commanded while user presses gas pedal. PID winds up,
and when PCM fault clears, car gets a "max gas" jolt.

In 2018 Volts, PCM fault doesn't time out, which means pre-enable
doesn't work at all, and car would slowly decelerate, while openpilot
thinks it's engaged.
2018-09-04 00:16:09 -07:00
Rick Lan a988911e05 * changed safetyParam to 100/1.0 2018-09-04 13:24:14 +10:00
Rick Lan 9abe003d1d * remove extra space. 2018-09-04 13:22:39 +10:00
Rick Lan 81477e857a * fix conflict. 2018-09-04 12:50:50 +10:00
Rick Lan 67669174f0 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r
# Conflicts:
#	selfdrive/boardd/boardd.cc
#	selfdrive/car/toyota/interface.py
#	selfdrive/car/toyota/values.py
2018-09-04 12:40:02 +10:00
Vehicle Researcher 285c52eb69 openpilot v0.5.3 release 2018-09-03 16:43:12 -07:00
Vehicle Researcher 8f6e36f426 Merge opendbc subtree 2018-09-03 16:41:18 -07:00
Vehicle Researcher f0c5ca7227 Merge panda subtree 2018-09-03 16:41:16 -07:00
Rick Lan e0d7ce9e57 * updated minEnableSpeed to 19mph as per @rbiasini recommendation. 2018-09-03 13:46:33 +10:00
tentious 8970cc8d70 Honda Odyssey 2018/2019 EX-L PID Tuning (#343)
* Honda Odyssey 2019 EX-L PID Tuning.

* Update interface.py - Increased Kp for Odyssey

Increases response from 0.4, but oscillation still occurs in very sharp curves.
2018-09-02 20:06:19 -07:00
Rick Lan ec975a36cd Merge branch 'devel-lexus-ish-ave30r' of https://github.com/EternityLan/openpilot into devel-lexus-ish-ave30r
# Conflicts:
#	selfdrive/car/toyota/interface.py
2018-09-03 12:00:45 +10:00
Rick Lan 65ca70c731 * update minEnableSpeed 2018-09-03 12:00:15 +10:00
Rick Lan 3dffd9a942 * update minEnableSpeed 2018-09-03 11:53:13 +10:00
Rick Lan 547c9eaad0 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-09-03 11:48:54 +10:00
Ted Slesinski 54f3c2b373 Some code refactoring to Honda (#335)
* Move vehicle state values (that get sent to radar) into values.py file, its a better place for it :)

* idx with offset should only be applied to 0x300

* Adds new honda pilot to vehicle state msg array
2018-08-31 19:57:11 -07:00
Rick Lan 40c70cc865 * all to lower case 2018-08-31 10:40:55 +10:00
Rick Lan 112c02991d * minor changes to static msgs. 2018-08-31 10:28:17 +10:00
Rick Lan bdc16ce545 * updated comments. 2018-08-31 00:04:46 +10:00
Rick Lan 5c041d3b78 * fix compile error. 2018-08-30 20:49:29 +10:00
Rick Lan 97949b12b3 * delete unused def. 2018-08-30 20:46:33 +10:00
Rick Lan fabf747d74 * removed unused var definition. 2018-08-30 20:45:06 +10:00
Rick Lan 41b7ba1092 * fix control mismatch issue. 2018-08-30 20:40:46 +10:00
Rick Lan f86b42cd81 * use standard ui command, looks no different before and after. 2018-08-30 20:26:09 +10:00
Rick Lan 3d0859dc39 * removed duplicated msg in signal 2018-08-30 20:14:57 +10:00
Rick Lan 1ad1340b58 * init acc_addr & acc_vl value 2018-08-30 20:06:28 +10:00
Rick Lan 05231722e5 * init commit 2018-08-30 16:11:04 +10:00
Riccardo 2c4e1fd4fa Added Pilot 2019 as supported car to README 2018-08-28 14:25:00 -07:00
rbiasini 401c4026ac fixing base UI crash after completing OP guide for the first time (#337) 2018-08-27 10:43:23 -07:00
Ted Slesinski 22f0a89cf8 Adds 2019 Pilot (#334) 2018-08-26 22:35:11 -07:00
rbiasini b942ab58e1 fix critical put and get param that caused sporadic controlsd hanging (#333)
* fix critical put and get param that caused sporadic controlsd hanging

* test fix
2018-08-24 19:45:33 -07:00
Jamezz c29b311583 Volt: Don't adjust speed on resume from stopped (#325)
* Don't adjust speed if resuming

* Detab
2018-08-23 18:39:11 -07:00
rbiasini ed72759a48 little endian mask fix (#330) 2018-08-22 11:36:55 -07:00
Vehicle Researcher 0129a8a4ff openpilot v0.5.2 release 2018-08-19 20:36:37 -07:00
Vehicle Researcher db96b4b912 Merge opendbc subtree 2018-08-19 20:34:33 -07:00
Vehicle Researcher b70d75d1d0 Merge panda subtree 2018-08-19 20:34:21 -07:00
rbiasini 6a02547b42 updated opendbc (#322) 2018-08-16 17:02:52 -07:00
Ted Slesinski 33a75c3506 Adds 1.5L accord support (#321)
* Adds support for 1.5L Accord

* Merge opendbc subtree
2018-08-13 22:38:14 -07:00
arne182 2cfdc67610 Spelling Correction (#316) 2018-08-03 00:17:00 -07:00
Vehicle Researcher 6f3d10a4c4 openpilot v0.5.1 release 2018-08-02 02:58:52 +00:00
Vehicle Researcher 589b6187a1 Merge opendbc subtree 2018-08-02 02:55:39 +00:00
Vehicle Researcher 6b1efbf185 Merge panda subtree 2018-08-02 02:55:38 +00:00
rbiasini b63d51d3ef Revert "Added 2014 pre-AP tesla (prior to Oct 28, 2014) (#303)" (#307)
This reverts commit e07853bb5e.
2018-07-20 15:06:57 -07:00
Jean-Claude Thibault e07853bb5e Added 2014 pre-AP tesla (prior to Oct 28, 2014) (#303) 2018-07-20 15:02:01 -07:00
Mutley 866711ef2e Update README.md (#295)
Changed GM minimum speed for steer control
2018-07-15 22:21:52 -07:00
Joshua F. Rountree ef8e6fb39f Adds Pedal Interceptor Support for Honda & Acura Vehicles (#274)
* Adds Joel's Changes to values, sorted as Rick wanted.

* Adds space at end of file.

* Adds Changes to Steering Ratio for Pilot testing.

* Adding this to steer ratio makes it even 3.33

Not sure if this should go into this PR though or not.
This makes the ratio match the other vehicles in the file.  Otherwise it's 3.454545...

* Changes the RAV4 back to not include pedal.

* Updated Comments for Pedal Support

* - Adds menuever test output to gitignore.
- Slight comment update to Ridgeline

* - Cleanup steer status comments
- Adds steering warning for interceptor cars in low speed lockout.

* Cleans up comments.

* Update README.md

* Corrects verbiage in README regarding Comma Pedal on Honda's

* Updates Odyssey and MDX to not add extra warnings for low-speed-lockout.

* Updates Comma Pedal references to use anchor links.

* Minor tweak to README

* Updates RDX to warn no steering below 12mph

* Reverts changes to README, carstate.py, and interface.py

* Removes extra libraries from a prior experiment.

* Replaces README with one from current devel.  Hope this fixes spacing issues.

* Adds Pedal back to Honda Cars and sorts fingerprint values

* Fixes spacing changes that were not intentional.

* Fixed carstate no newline at end of file.

* Fixes new line at end of file issue.

* Converted the Long's to Int's
2018-07-13 17:15:42 -07:00
George Hotz 4568504c41 Merge pull request #290 from commaai/pedal-resum-speed-fix
fixed resume press when comma pedal is used
2018-07-13 16:55:40 -07:00
Riccardo 18c6482545 fixed resume press when comma pedal is used 2018-07-13 15:52:59 -07:00
George Hotz b0c83bb9a6 Merge pull request #288 from jfrux/patch-1
Minor README.md update.
2018-07-13 12:24:24 -07:00
Joshua F. Rountree ce57ce4898 Update README.md 2018-07-13 13:10:37 -04:00
Joshua F. Rountree 7d9f8c55e0 Integrated the requests by Andrew 2018-07-13 12:17:42 -04:00
George Hotz 04c26981f0 fix up table 2018-07-12 23:02:20 -07:00
Joshua F. Rountree 7f6ea03066 Minor README.md update.
Loving the way this adds some realism and cleans things up a bit on the image.
Let's do this! xD <3

Thanks for the AMAZING and EXCITING update.  Driving on it first thing in the morning.
Congratulations Comma Team!
2018-07-13 01:56:01 -04:00
Vehicle Researcher de33bc4645 openpilot v0.5 release 2018-07-12 18:52:06 -07:00
Vehicle Researcher e9ad7793f0 Merge opendbc subtree 2018-07-12 18:48:44 -07:00
Vehicle Researcher 4bdf3b95f3 Merge panda subtree 2018-07-12 18:48:43 -07:00
AlexMcInerney 504d00353d Added 2018 Chevy Volt Support with New Fingerprint (#283)
* Update values.py

* Add 2018 Volt Support Fingerprint
2018-07-06 16:29:31 -07:00
dekerr ce67c75f1f Small cleanup (#275)
* mass unit conversions

* flat/explicit conditions

* fix typos

* remove hardcode

* Update README.md

* Update carcontroller.py
2018-06-28 12:33:54 -07:00
Vehicle Researcher 95509a58cd openpilot v0.4.7.2 release 2018-06-25 13:48:52 -07:00
Vehicle Researcher 21b3f5321a Merge opendbc subtree 2018-06-25 13:45:15 -07:00
Vehicle Researcher b75d606c91 Merge panda subtree 2018-06-25 13:45:14 -07:00
Ted Slesinski ca3e1ce9b0 Add accord hybrid to fingerprint (#271) 2018-06-24 20:43:51 -07:00
Ted Slesinski 58744df1c5 Adjusting Kp, Ki values to reduce steer oscillation on CRV_5G 2018-06-21 19:53:21 +02:00
Vehicle Researcher 1181a00fe9 openpilot v0.4.7.1 release 2018-06-19 01:41:45 +00:00
Vehicle Researcher 35b08e1e3d Merge opendbc subtree 2018-06-19 01:38:16 +00:00
rbiasini fd2bead226 Acura ILX steer fault fix: send STEER_TORQUE_REQUEST = 0 when temp faults are present (#264) 2018-06-17 23:35:05 -07:00
Vehicle Researcher ae5cb7a0da openpilot v0.4.7 release 2018-06-16 20:59:34 -07:00
Vehicle Researcher e3ab9d6460 Merge opendbc subtree 2018-06-16 20:56:04 -07:00
Vehicle Researcher c210011c84 Merge panda subtree 2018-06-16 20:56:03 -07:00
Ted Slesinski 2751d87d01 Add missing messages fron Pilot EX-L to fingerprint (#260) 2018-06-06 10:20:38 -07:00
dekerr 8849aa02a3 Std unit conversions (#259)
* Added conversion constants

* implemented std unit conversion

* changed centerToFront ratio

Changed weight distribution ratios used to calc center of gravity distances to align closer to manufacturer specs

* implemented std unit conversion

* remove unused conversion

* reverted wheelbase conversion

slight change to pilot wheelbase

* removed redundant conversion

* removed incorrect/unused conversion

* removed class that now exists in honda/values.py

* redirect Cruisebuttons call

* redirect Cruisebuttons call

* Update interface.py

* Update numpy_fast.py

Refactor

* Update numpy_fast.py

* Update numpy_fast.py

-encapsulated get_interp 
-reduced calls to len() for iterable input
2018-06-04 12:39:54 -07:00
Tyler f49e9f4f09 Update process_dbc.py 2018-05-31 20:16:08 +02:00
Vasily Tarasov f0a6db351e s/persistant/persistent/g (#254) 2018-05-30 13:40:18 -07:00
Willem Melching 53b177b3c1 clean git repo before neos update 2018-05-24 00:22:48 +02:00
Vehicle Researcher c6df34f55b openpilot v0.4.6 release 2018-05-23 03:59:04 +00:00
Vehicle Researcher 28e3543ec4 Merge pyextra subtree 2018-05-23 03:55:35 +00:00
Vehicle Researcher 7865525451 Merge opendbc subtree 2018-05-23 03:55:33 +00:00
Vehicle Researcher 4a5019d925 Merge panda subtree 2018-05-23 03:55:30 +00:00
Vehicle Researcher 1b7b3b4e66 openpilot v0.4.5.1 release 2018-05-01 23:19:47 +00:00
Vehicle Researcher 37285038d3 openpilot v0.4.5 release 2018-04-28 09:44:39 +00:00
Vehicle Researcher 91a731f2ae Merge opendbc subtree 2018-04-28 09:40:30 +00:00
Vehicle Researcher e41761eb1b Merge panda subtree 2018-04-28 09:40:29 +00:00
Vehicle Researcher 9a9ff839a9 openpilot v0.4.4 release 2018-04-14 06:10:58 +00:00
Vehicle Researcher 4f7336f0e4 Merge opendbc subtree 2018-04-14 06:06:43 +00:00
Vehicle Researcher 94a27e351f Merge panda subtree 2018-04-14 06:06:42 +00:00
Ted Slesinski 28b8043c5b 2017 Honda Ridgeline (#198)
* Adds Honda Ridgeline

Replaced trim level placeholder

Adding 0x301 ridgeline message

(I restructured this slightly since we don't need to repeat `commands.append(make_can_msg(0x300, msg_0x300, idx, 1))` so many times

Updated dbc name

Use pedal_gas to detect gas pressed

Remove unnecessary signal check

Fix array notation

* Tire stiffness factor bumped to 1.5x

* Adds safety tests at line 133

* Revert "Adds safety tests at line 133"

This reverts commit 349edf5b1a879cac704db3786d0626211497bcb7.

* fix failing build due to syntax

* update variables for failing build

* Update interface.py

* Update Tire Slip Factor
2018-04-12 19:12:45 -07:00
Vehicle Researcher 78df63a6af openpilot v0.4.3.2 release 2018-03-31 07:54:47 +00:00
Vehicle Researcher d0c9cd28d1 Merge opendbc subtree 2018-03-31 07:29:19 +00:00
vanillagorillaa 9e1cabde36 update year on civic 2018-03-22 23:34:47 +01:00
Willem Melching c7cd8b4459 fix bug in canpacker for Toyotas with DSU connected (#221) 2018-03-22 15:13:23 -07:00
Vehicle Researcher 3d628a6fe2 openpilot v0.4.3.1 release 2018-03-19 23:40:24 -07:00
Vehicle Researcher 51fad4a6c6 openpilot v0.4.3 release 2018-03-18 10:36:29 -07:00
Vehicle Researcher a70a821d28 Merge opendbc subtree 2018-03-18 10:32:25 -07:00
Vehicle Researcher 013351a2ee Merge panda subtree 2018-03-18 10:32:24 -07:00
George Hotz ad3f0a348a Merge pull request #192 from gregjhogan/wifi-only-upload-fix
fix restricting video upload to wifi
2018-03-17 12:01:42 -07:00
Vehicle Researcher 9a411ebf32 openpilot v0.4.3 release 2018-03-17 00:01:50 -07:00
Vehicle Researcher 19010d3766 Merge opendbc subtree 2018-03-16 23:57:47 -07:00
Vehicle Researcher 02968cda63 Merge panda subtree 2018-03-16 23:57:46 -07:00
Mark Krieger 650c45dcc5 Slight changes to UI and Fingerprint for Odyssey Elite (#196)
* Adding back drive time to UI

* Add fingerprint for Odyssey Elite

* Removed extended fingerprint for Elite

* Revert "Adding back drive time to UI"

This reverts commit b9b02f7ff2511f28922f0bea47cd8c70bb9f4010.
2018-03-16 21:28:50 -07:00
Vasily Tarasov 93f55f3ccf Interpolate ki/kp for steering PID loop (#200)
* Interpolate ki/kp for steering PID loop

Very much needed for the Volt port: car ping-pongs with low kp
on high speeeds, and the loop is unstable with high kp on
low speeds.

Also, removes "number or array?" logic from PIController,
now that all the callers use interpolation ofr ki/kp.

* Pass speed to steering PID loop for ki/kp interpolation

* Remove unused numbers import
2018-03-15 13:28:15 -07:00
arne182 569db3c1d2 Update fingerprints.py (#210)
Consolidated my fingerprint and removed duplicates and ordered the fingerprint for the RAV4H. Double Checked.
2018-03-09 13:34:39 -08:00
George Hotz 26d97d3374 Merge pull request #203 from energee/safety-honda-bosch
Safety Reference for Honda Bosch
2018-03-08 08:33:31 -08:00
Ted Slesinski 3acfa1b39b Safety Reference for Honda Bosch 2018-02-28 10:24:05 -05:00
George Hotz bbc67f8506 Merge pull request #202 from vntarasov/volt-gm-id
Dibs on SAFETY_GM numerical value
2018-02-27 22:58:02 -08:00
Vasily Tarasov 8343b56870 Dibs on SAFETY_GM numerical value
To match Panda repo.
2018-02-26 10:22:19 -08:00
Greg Hogan 008d900f81 fix restricting video upload to wifi 2018-02-10 09:31:56 -06:00
vanillagorillaa 32e5d6cd15 Honda Pilot 2017 Port (#161)
* Update README.md

* Update fingerprints.py

* Update carstate.py

* Update hondacan.py

* Update interface.py

* Update interface.py

* Update interface.py

* Update README.md

* Update README.md

* Update README.md

* Update fingerprints.py

* Update carstate.py

* Update hondacan.py

* Update interface.py

* Update carstate.py

* Update hondacan.py

* Update README.md

* Update fingerprints.py

* Update carstate.py

* Update carstate.py

* Update carstate.py

* Update hondacan.py

* Update interface.py

* Update carstate.py

* Update carstate.py

* Update Pilot Fingerprint

* Update fingerprints.py

* Give pilot its own definition and not use ILX

* add pilot argument

* Add Pilot interface

* Add pilot argument

* Update interface.py

* Parse Different gear on pilot

* Add steer max

* Fixed duplication of steer max value

* Adjust PID's for steering

* Update carcontroller.py

* Change Steer Ratio and wheelbase

* Update Steer fault values

Steer fault value of 3, does not seem to effect anything

* Update Kp,Ki Ratio

* Update interface.py

* Update readme for Pilot

* add pilot

* Update fingerprints.py

* Update carstate.py

* add signals

* add signal
2018-02-09 12:50:37 -08:00
Vehicle Researcher 28c0797d30 openpilot v0.4.2 release 2018-02-06 12:43:45 -08:00
Vehicle Researcher a701aa7292 Merge opendbc subtree 2018-02-06 12:39:39 -08:00
Vehicle Researcher 433f934783 Merge panda subtree 2018-02-06 12:39:38 -08:00
vanillagorillaa 0dc6778548 Acura RDX 2018 AcuraWatch Plus Port (#162)
* Adding Acura RDX alpha support
2018-02-05 18:38:40 -08:00
ErichMoraga c86b52698b Update fingerprints.py
Taiwanese Prius Prime fingerprint was identical to the regular prime (107 msgs.), but should really have 110.  I have the correct one in there now.
2018-02-05 14:16:58 -08:00
George Hotz e5e5aa7ded openpilot v0.4.1 hotfix 2018-02-02 19:30:44 -08:00
George Hotz 4474b9b371 openpilot v0.4.1 tweaks 2018-01-30 21:34:01 -08:00
Vehicle Researcher 26e966852c openpilot v0.4.1 release 2018-01-30 12:58:14 -08:00
Vehicle Researcher 75ac92b90f Merge opendbc subtree 2018-01-30 12:54:13 -08:00
Vehicle Researcher b68f3f7781 Merge panda subtree 2018-01-30 12:54:12 -08:00
George Hotz 36bef17224 Merge pull request #155 from slesinski/odyssey-port
Honda Odyssey 2018 EX-L with Honda Sensing
2018-01-18 21:49:14 -08:00
Ted Slesinski 715771bcff Unnecessary characters in comma's dongle id 2018-01-19 00:47:47 -05:00
Ted Slesinski 8e264baaa2 SteerRatio should be 14.35 2018-01-19 00:37:32 -05:00
Ted Slesinski 8ff147de6d Added the extra carstate reads 2018-01-19 00:34:02 -05:00
Ted Slesinski 71057c586f Tuning specific to odyssey 2018-01-19 00:34:02 -05:00
Ted Slesinski fac22f4038 Gear shifter values like acura 2018-01-19 00:32:51 -05:00
Ted Slesinski 40094779d7 Car_gas 130 missing canbus, using 17c 2018-01-19 00:32:51 -05:00
Ted Slesinski 2552aa45c3 BRAKE_HOLD signal not ready yet 2018-01-19 00:32:51 -05:00
Ted Slesinski c2972a80f9 Park Brake not yet in DBC 2018-01-19 00:32:51 -05:00
Ted Slesinski 791a440709 Wrong value for MAIN_ON 2018-01-19 00:32:51 -05:00
Ted Slesinski 13145dd9a7 Packet size off on a fingerprint id 2018-01-19 00:32:51 -05:00
Ted Slesinski e9c477dcf2 Add hondacan changes 2018-01-19 00:30:33 -05:00
Ted Slesinski 8eebd19884 Add carcontroller changes 2018-01-19 00:30:33 -05:00
Ted Slesinski a54b35a4d6 Add odyssey car params to interface 2018-01-19 00:30:33 -05:00
Ted Slesinski 8a6f7a5e78 Add carstate changes 2018-01-19 00:30:33 -05:00
Ted Slesinski 6752959d4a Add odyssey fingerprint 2018-01-19 00:30:33 -05:00
Vehicle Researcher da52d065a4 openpilot v0.4.0.2 release 2018-01-18 15:46:12 -08:00
Vehicle Researcher b731b7cf12 Merge opendbc subtree 2018-01-18 15:42:13 -08:00
Vehicle Researcher ef3d8314d3 Merge panda subtree 2018-01-18 15:42:12 -08:00
Vehicle Researcher 7ef3fd567f openpilot v0.4.0.1 tweaks 2018-01-16 23:26:39 -08:00
heatnation b773e27ad1 Update fingerprints.py 2018-01-15 18:22:15 -08:00
Vehicle Researcher a77c0a1098 openpilot v0.4.0.1 release 2017-12-23 17:15:27 -08:00
Vehicle Researcher c7b5fb9116 Merge commit '57b9ddf20ef28d7a9b4fd57c08630281ef103422' as 'pyextra' 2017-12-23 17:10:45 -08:00
Vehicle Researcher b8085e2c42 Merge commit 'ba97d0e83837b4c893edc609001dde7c41b8e24b' as 'opendbc' 2017-12-23 17:10:44 -08:00
Vehicle Researcher 14fb17e22f Merge commit 'c251b312d87d26b5ed347b267f6f1570793f9b91' as 'panda' 2017-12-23 17:10:42 -08:00
Vehicle Researcher a34c87ab46 remove submodules 2017-12-23 17:06:56 -08:00
Vehicle Researcher 1ad9cc8c67 openpilot v0.3.9 tweaks 2017-12-06 12:48:00 -08:00
Vehicle Researcher 5627d0d7fd openpilot v0.3.9 release 2017-11-22 04:30:24 -08:00
Vehicle Researcher 2cfdbefde8 update releases 2017-11-04 05:31:15 -07:00
Vehicle Researcher 7dabcdace8 openpilot v0.3.8.2 tweaks 2017-11-03 18:21:38 -07:00
Vehicle Researcher 187a70f760 openpilot v0.3.8.2 release 2017-10-31 02:27:39 -07:00
Vehicle Researcher 48303589e9 openpilot v0.3.7 tweaks 2017-10-03 23:46:23 -07:00
Vehicle Researcher 8385b27cad openpilot v0.3.7 tweaks 2017-10-03 00:35:46 -07:00
George Hotz abd75aedd7 Bump panda version to fix old board updating 2017-09-30 23:30:38 -07:00
Vehicle Researcher daf54ad54d openpilot v0.3.7 release 2017-09-30 19:05:03 -07:00
espes 94fe677f91 Fix rear view mirror setting 2017-08-28 22:24:11 -07:00
Vehicle Researcher 3de85098e5 openpilot v0.3.6.1 tweaks 2017-08-16 05:21:06 -07:00
Vehicle Researcher 5524dc8773 openpilot v0.3.6.1 release 2017-08-15 03:15:00 -07:00
Vehicle Researcher 19dd5f3e32 openpilot v0.3.6 tweaks 2017-08-10 20:38:56 -07:00
Vehicle Researcher 99cb610b12 openpilot v0.3.6 release 2017-08-09 17:41:38 -07:00
Vehicle Researcher 9d3963559a openpilot v0.3.5 release 2017-07-30 17:59:37 -07:00
Vehicle Researcher 1b8c44b506 openpilot v0.3.4 tweaks 2017-07-28 20:51:27 -07:00
Vehicle Researcher 6f46f988d9 openpilot v0.3.4 release 2017-07-28 03:23:57 -07:00
George Hotz 68485aa4e4 Merge pull request #116 from commaai/revert-114-new_panda_code
Revert "Pulled in new panda firmware and updated boardd to support the changes."
2017-07-17 23:17:13 -07:00
George Hotz 1581fdc198 Revert "Pulled in new panda firmware and updated boardd to support the changes." 2017-07-17 23:16:57 -07:00
George Hotz 317ae0fb37 Merge pull request #114 from diamondman/new_panda_code
Pulled in new panda firmware and updated boardd to support the changes.
2017-07-11 22:24:38 -07:00
Jessy Diamond Exum 5bf4196aed Removed unnecessary TODO 2017-07-11 22:01:04 -07:00
Jessy Diamond Exum 38aa03e0f7 Moved boardd loopback config to envvar. 2017-07-11 21:59:03 -07:00
Jessy Diamond Exum 9a9dc3ab23 Pulled in new panda firmware and updated boardd to support the changes. 2017-07-11 21:45:16 -07:00
George Hotz e4aa959e2c Merge pull request #113 from pjlao307/update-alert-text
Update alert text
2017-07-07 10:25:59 -07:00
Joey Lao 2aa9a56f40 Update steering controls saturated message 2017-07-06 22:36:55 -07:00
pjlao307 721ed4ec0e Merge pull request #2 from commaai/release
Release
2017-07-03 11:15:42 -07:00
George Hotz 70be4ceab1 Merge pull request #109 from commaai/devel
openpilot 0.3.3
2017-06-30 18:23:10 -07:00
Vehicle Researcher 5cf91d0496 openpilot v0.3.3 release 2017-06-28 13:57:09 -07:00
George Hotz 6fee0bdb2d Merge pull request #102 from energee/devel-crv
Bounty: 2016 Honda CR-V Touring
2017-06-22 11:52:38 -07:00
Ted Slesinski e40c161125 Addresses brake error review comment 2017-06-20 02:51:58 -04:00
Ted Slesinski 97eb55cc55 Fixes global saturation change 2017-06-20 02:47:47 -04:00
Ted Slesinski 65134be0d1 Adds correct value of 8 to gearshifter check array 2017-06-20 02:46:59 -04:00
Ted Slesinski dbf71a23aa Init crv variable 2017-06-20 02:26:50 -04:00
George Hotz 7fec3db1d6 Merge pull request #103 from pjlao307/pjlao-update-ui
Update UI to make text more readable in all conditions as requested by community
2017-06-19 20:37:37 -07:00
Joey Lao 26b573c1d0 Make lead car text a little brighter 2017-06-12 16:39:10 -07:00
Vehicle Researcher 5ec1e7307e Revert last commit since KPH can get 3 digits long 2017-06-12 09:30:47 -07:00
Vehicle Researcher 8bc36b7f21 Adjust position of left speed to align with label (based on 2 digit speeds) 2017-06-12 09:03:49 -07:00
Vehicle Researcher 3b909eb693 More code cleanup 2017-06-12 08:41:11 -07:00
Vehicle Researcher 57e39c4472 Use color param in ui_draw_rounded_rect instead of hard coding 2017-06-12 08:27:57 -07:00
Vehicle Researcher ff7672339c Add background to radar text. Code cleanup. 2017-06-12 08:19:47 -07:00
John Jones 6e824a2c22 missed one update in latcontrol 2017-06-11 21:33:44 -04:00
Vehicle Researcher 32fa49e093 Clean up code 2017-06-11 15:18:39 -07:00
Vehicle Researcher 2250eac58f Remove commented line 2017-06-11 15:16:46 -07:00
Vehicle Researcher 97be6b3a0e Update UI to make speed text more readable in all conditions as requested by community 2017-06-11 15:12:50 -07:00
John Jones 942655c947 adding steering change from video and removing integer div and adding ki/kp changes 2017-06-11 13:20:19 -04:00
Ted Slesinski 615db3f7fd Reverting steering to original value 2017-06-08 13:15:30 -04:00
Ted Slesinski 0bb75c5389 Syntax typo 2017-06-08 02:33:31 -04:00
Ted Slesinski 7b5ee81d2d Adds support for 2016 Honda CR-V Touring 2017-06-08 01:37:39 -04:00
Vehicle Researcher 7fe46f1e1d openpilot v0.3.2 release 2017-05-22 22:26:12 -07:00
George Hotz 50c0d1c9da Merge pull request #82 from energee/devel
DBC file for 2017 Honda CR-V
2017-05-22 09:00:44 -07:00
Ted Slesinski 6dbf544d06 Adds 2017 CR-V dbc file 2017-05-21 19:46:34 -04:00
Vehicle Researcher 41e3a0f699 openpilot v0.3.1 release 2017-05-17 00:40:33 -07:00
Vehicle Researcher c5d8aec28b openpilot v0.3.0 release 2017-05-12 16:46:20 -07:00
Vehicle Researcher 4653a9aef0 openpilot v0.3.0-devel release 2017-05-11 12:41:17 -07:00
1322 changed files with 42676 additions and 264079 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ Steps to reproduce the behavior, or a explorer/cabana link to the exact drive an
**Expected behavior**
A clear and concise description of what you expected to happen.
**Device/Version information (please complete the following information):**
** Device/Version information (please complete the following information):**
- Device: [e.g. EON/EON Gold]
- Version: [e.g. 0.6.4], or commit hash when on devel
- Car make/model [e.g. Toyota Prius 2016]
+3 -17
View File
@@ -3,14 +3,11 @@ venv/
.tags
.ipynb_checkpoints
.idea
.overlay_init
.overlay_consistent
.sconsign.dblite
.vscode
model2.png
a.out
*.dylib
*.DSYM
*.d
*.pyc
@@ -18,9 +15,7 @@ a.out
.*.swp
.*.swo
.*.un~
*.tmp
*.o
*.os
*.so
*.a
*.clb
@@ -30,30 +25,21 @@ a.out
config.json
clcache
persist
board/obj/
selfdrive/boardd/boardd
selfdrive/logcatd/logcatd
selfdrive/mapd/default_speeds_by_region.json
selfdrive/proclogd/proclogd
selfdrive/ui/_ui
selfdrive/ui/ui
selfdrive/test/longitudinal_maneuvers/out
selfdrive/visiond/visiond
selfdrive/loggerd/loggerd
selfdrive/sensord/_gpsd
selfdrive/sensord/_sensord
selfdrive/camerad/camerad
selfdrive/modeld/_modeld
selfdrive/modeld/_dmonitoringmodeld
selfdrive/sensord/gpsd
selfdrive/sensord/sensord
/src/
one
openpilot
notebooks
xx
panda_jungle
.coverage*
htmlcov
pandaextra
-9
View File
@@ -29,12 +29,3 @@ Code is automatically check for style by travis as part of the automated tests.
We've released a [Model Port guide](https://medium.com/@comma_ai/openpilot-port-guide-for-toyota-models-e5467f4b5fe6) for porting to Toyota/Lexus models.
If you port openpilot to a substantially new car brand, see this more generic [Brand Port guide](https://medium.com/@comma_ai/how-to-write-a-car-port-for-openpilot-7ce0785eda84). You might also be eligible for a bounty. See our bounties at [comma.ai/bounties.html](https://comma.ai/bounties.html)
## Pull Requests
Pull requests should be against the master branch. Before running master on in-car hardware, you'll need to run
```
git submodule init
git submodule update
```
in order to pull down the submodules, such as `panda` and `opendbc`.
+80
View File
@@ -0,0 +1,80 @@
FROM ubuntu:16.04
ENV PYTHONUNBUFFERED 1
RUN apt-get update && apt-get install -y \
autoconf \
build-essential \
bzip2 \
clang \
cmake \
curl \
ffmpeg \
git \
libarchive-dev \
libbz2-dev \
libcurl4-openssl-dev \
libeigen3-dev \
libffi-dev \
libglew-dev \
libglib2.0-0 \
liblzma-dev \
libmysqlclient-dev \
libomp-dev \
libopencv-dev \
libssl-dev \
libtool \
libusb-1.0-0 \
libzmq5-dev \
locales \
ocl-icd-libopencl1 \
ocl-icd-opencl-dev \
opencl-headers \
python-dev \
python-pip \
screen \
sudo \
vim \
wget
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
ENV PATH="/root/.pyenv/bin:/root/.pyenv/shims:${PATH}"
RUN pyenv install 3.7.3
RUN pyenv global 3.7.3
RUN pyenv rehash
RUN pip install pipenv==2018.11.26
COPY Pipfile /tmp/
COPY Pipfile.lock /tmp/
RUN python --version
RUN cd /tmp && pipenv install --system --deploy
# Install subset of dev dependencies needed for CI
RUN pip install matplotlib==3.1.1 dictdiffer==0.8.0 fastcluster==1.1.25 aenum==2.2.1 scipy==1.3.1 lru-dict==1.1.6 tenacity==5.1.1 azure-common==1.1.23 azure-nspkg==3.0.2 azure-storage-blob==2.1.0 azure-storage-common==2.1.0 azure-storage-nspkg==3.1.0 pycurl==7.43.0.3
COPY phonelibs/install_capnp.sh /tmp/install_capnp.sh
RUN /tmp/install_capnp.sh
RUN git clone --branch v0.6.5 https://github.com/commaai/openpilot-tools.git /tmp/openpilot/tools
ENV PYTHONPATH /tmp/openpilot:${PYTHONPATH}
COPY ./.pylintrc /tmp/openpilot/.pylintrc
COPY ./common /tmp/openpilot/common
COPY ./cereal /tmp/openpilot/cereal
COPY ./opendbc /tmp/openpilot/opendbc
COPY ./selfdrive /tmp/openpilot/selfdrive
COPY ./phonelibs /tmp/openpilot/phonelibs
COPY ./pyextra /tmp/openpilot/pyextra
COPY ./panda /tmp/openpilot/panda
RUN mkdir -p /tmp/openpilot/selfdrive/test/out
RUN make -C /tmp/openpilot/selfdrive/controls/lib/longitudinal_mpc clean
RUN make -C /tmp/openpilot/selfdrive/controls/lib/lateral_mpc clean
+9
View File
@@ -0,0 +1,9 @@
code_dir := $(shell pwd)
# TODO: Add a global build system
.PHONY: all
all:
cd selfdrive && PYTHONPATH=$(code_dir) PREPAREONLY=1 ./manager.py
+144
View File
@@ -0,0 +1,144 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
opencv-python= "==3.4.2.17"
PyQt5 = "*"
ipython = "*"
azure-common = "*"
azure-nspkg = "*"
azure-storage-blob = "*"
azure-storage-common = "*"
azure-storage-nspkg = "*"
bincopy = "*"
bleach = "*"
boto = "*"
"boto3" = "*"
celery = "*"
control = "*"
datadog = "*"
decorator = "*"
dlib = "*"
dominate = "*"
elasticsearch = "*"
fasteners = "*"
future = "*"
futures = "*"
gevent = "*"
pycocotools = {git = "https://github.com/cocodataset/cocoapi.git",subdirectory = "PythonAPI"}
gunicorn = "*"
"h5py" = "*"
hexdump = "*"
"html5lib" = "*"
imageio = "*"
intervaltree = "*"
ipykernel = "*"
joblib = "*"
json-logging-py = "*"
jupyter = "*"
libarchive = "*"
lru-dict = "*"
lxml = "*"
"mpld3" = "*"
msgpack-python = "*"
nbstripout = "*"
nose-parameterized = "*"
numpy = "*"
osmium = "*"
pbr = "*"
percache = "*"
pprofile = "*"
psutil = "*"
pycurl = "*"
git-pylint-commit-hook = "*"
pymongo = "*"
"pynmea2" = "*"
pypolyline = "*"
pysendfile = "*"
python-logstash = "*"
pyvcd = "*"
redis = "*"
redlock = "*"
"s2sphere" = "*"
scikit-image = "*"
"subprocess32" = "*"
supervisor = "*"
tenacity = "*"
tensorflow-gpu = ""
utm = "*"
"v4l2" = "*"
PyJWT = "==1.4.1"
PyMySQL = "==0.9.2"
Theano = "*"
Werkzeug = "*"
"backports.lzma" = "*"
Flask-Cors = "*"
Flask-SocketIO = "*"
"GeoAlchemy2" = "*"
Pygments = "*"
PyNaCl = "*"
"PySDL2" = "*"
reverse_geocoder = "*"
Shapely = "*"
SQLAlchemy = "*"
uWSGI = "*"
scipy = "*"
fastcluster = "*"
backports-abc = "*"
pygame = "*"
simplejson = "*"
python-logstash-async = "*"
seaborn = "*"
tensorflow-estimator = "*"
pyproj = "*"
mock = "*"
blinker = "*"
gast = "==0.2.2"
matplotlib = "*"
dictdiffer = "*"
aenum = "*"
[packages]
overpy = {git = "https://github.com/commaai/python-overpy.git",ref = "f86529af402d4642e1faeb146671c40284007323"}
atomicwrites = "*"
cffi = "*"
crcmod = "*"
hexdump = "*"
libusb1 = "*"
numpy = "*"
psutil = "*"
pycapnp = "*"
cryptography = "*"
pyserial = "*"
python-dateutil = "*"
pyzmq = "*"
raven = "*"
requests = "*"
setproctitle = "*"
six = "*"
smbus2 = "*"
sympy = "*"
tqdm = "*"
Cython = "*"
PyYAML = "*"
websocket_client = "*"
Logentries = {git = "https://github.com/commaai/le_python.git",ref = "feaeacb48f7f4bdb02c0a8fc092326d4e101b7f2"}
urllib3 = "*"
chardet = "*"
idna = "*"
gunicorn = "*"
utm = "*"
json-rpc = "*"
Flask = "*"
PyJWT = "*"
"Jinja2" = "*"
nose = "*"
pyflakes = "*"
pylint = "*"
pycryptodome = "*"
pillow = "*"
[requires]
python_version = "3.7.3"
Generated
+2714
View File
File diff suppressed because it is too large Load Diff
+167 -231
View File
@@ -1,280 +1,182 @@
[![](https://i.imgur.com/UelUjKAh.png)](#)
[![](https://i.imgur.com/UetIFyH.jpg)](#)
Welcome to openpilot
======
[openpilot](http://github.com/commaai/openpilot) is an open source driver assistance system. Currently, it performs the functions of Adaptive Cruise Control (ACC) and Lane Keeping Assist System (LKAS) for selected Honda, Toyota, Acura, Lexus, Chevrolet, Hyundai, Kia. It's about on par with Tesla Autopilot and GM Super Cruise, and better than [all other manufacturers](http://www.thedrive.com/tech/5707/the-war-for-autonomous-driving-part-iii-us-vs-germany-vs-japan).
The openpilot codebase has been written to be concise and to enable rapid prototyping. We look forward to your contributions - improving real vehicle automation has never been easier.
Table of Contents
=======================
* [What is openpilot?](#what-is-openpilot)
* [Integration with Stock Features](#integration-with-stock-features)
* [Supported Hardware](#supported-hardware)
* [Community](#community)
* [Hardware](#hardware)
* [Supported Cars](#supported-cars)
* [Community Maintained Cars and Features](#community-maintained-cars-and-features)
* [Installation Instructions](#installation-instructions)
* [Limitations of openpilot ALC and LDW](#limitations-of-openpilot-alc-and-ldw)
* [Limitations of openpilot ACC and FCW](#limitations-of-openpilot-acc-and-fcw)
* [Limitations of openpilot DM](#limitations-of-openpilot-dm)
* [User Data and comma Account](#user-data-and-comma-account)
* [Safety and Testing](#safety-and-testing)
* [Community Maintained Cars](#community-maintained-cars)
* [In Progress Cars](#in-progress-cars)
* [How can I add support for my car?](#how-can-i-add-support-for-my-car)
* [Directory structure](#directory-structure)
* [User Data / chffr Account / Crash Reporting](#user-data--chffr-account--crash-reporting)
* [Testing on PC](#testing-on-pc)
* [Community and Contributing](#community-and-contributing)
* [Directory Structure](#directory-structure)
* [Contributing](#contributing)
* [Licensing](#licensing)
---
What is openpilot?
Community
------
[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](#supported-cars). In addition, while openpilot is engaged, a camera based Driver Monitoring (DM) feature alerts distracted and asleep drivers.
openpilot is developed by [comma.ai](https://comma.ai/) and users like you.
We have a [Twitter you should follow](https://twitter.com/comma_ai).
Also, we have a several thousand people community on [Discord](https://discord.comma.ai).
<table>
<tr>
<td><a href="https://www.youtube.com/watch?v=mgAbfr42oI8" title="YouTube" rel="noopener"><img src="https://i.imgur.com/kAtT6Ei.png"></a></td>
<td><a href="https://www.youtube.com/watch?v=394rJKeh76k" title="YouTube" rel="noopener"><img src="https://i.imgur.com/lTt8cS2.png"></a></td>
<td><a href="https://www.youtube.com/watch?v=1iNOc3cq8cs" title="YouTube" rel="noopener"><img src="https://i.imgur.com/ANnuSpe.png"></a></td>
<td><a href="https://www.youtube.com/watch?v=Vr6NgrB-zHw" title="YouTube" rel="noopener"><img src="https://i.imgur.com/Qypanuq.png"></a></td>
<td><a href="https://www.youtube.com/watch?v=ICOIin4p70w" title="YouTube" rel="noopener"><img src="https://i.imgur.com/gBTo7yB.png"></a></td>
<td><a href="https://www.youtube.com/watch?v=1zCtj3ckGFo" title="YouTube" rel="noopener"><img src="https://i.imgur.com/gNhhcep.png"></a></td>
<td><a href="https://www.youtube.com/watch?v=Qd2mjkBIRx0" title="YouTube" rel="noopener"><img src="https://i.imgur.com/tFnSexp.png"></a></td>
<td><a href="https://www.youtube.com/watch?v=ju12vlBm59E" title="YouTube" rel="noopener"><img src="https://i.imgur.com/3BKiJVy.png"></a></td>
</tr>
<tr>
<td><a href="https://www.youtube.com/watch?v=Ug41KIKF0oo" title="YouTube" rel="noopener"><img src="https://i.imgur.com/3caZ7xM.png"></a></td>
<td><a href="https://www.youtube.com/watch?v=NVR_CdG1FRg" title="YouTube" rel="noopener"><img src="https://i.imgur.com/bAZOwql.png"></a></td>
<td><a href="https://www.youtube.com/watch?v=tkEvIdzdfUE" title="YouTube" rel="noopener"><img src="https://i.imgur.com/EFINEzG.png"></a></td>
<td><a href="https://www.youtube.com/watch?v=_P-N1ewNne4" title="YouTube" rel="noopener"><img src="https://i.imgur.com/gAyAq22.png"></a></td>
<td><a href="https://www.youtube.com/watch?v=Z5VY5FzgNt4" title="YouTube" rel="noopener"><img src="https://i.imgur.com/3I9XOK2.png"></a></td>
<td><a href="https://www.youtube.com/watch?v=blnhZC7OmMg" title="YouTube" rel="noopener"><img src="https://i.imgur.com/f9IgX6s.png"></a></td>
<td><a href="https://www.youtube.com/watch?v=iRkz7FuJsA8" title="YouTube" rel="noopener"><img src="https://i.imgur.com/Vo5Zvmn.png"></a></td>
<td><a href="https://www.youtube.com/watch?v=IHjEqAKDqjM" title="YouTube" rel="noopener"><img src="https://i.imgur.com/V9Zd81n.png"></a></td>
</tr>
</table>
Integration with Stock Features
Hardware
------
In all supported cars:
* Stock Lane Keep Assist (LKA) and stock ALC are replaced by openpilot ALC, which only functions when openpilot is engaged by the user.
* Stock LDW is replaced by openpilot LDW.
At the moment openpilot supports the [EON Dashcam DevKit](https://comma.ai/shop/products/eon-dashcam-devkit). A [panda](https://shop.comma.ai/products/panda-obd-ii-dongle) and a [giraffe](https://comma.ai/shop/products/giraffe/) are recommended tools to interface the EON with the car. We'd like to support other platforms as well.
Additionally, on specific supported cars (see ACC column in [supported cars](#supported-cars)):
* Stock ACC is replaced by openpilot ACC.
* openpilot FCW operates in addition to stock FCW.
openpilot should preserve all other vehicle's stock features, including, but are not limited to: FCW, Automatic Emergency Braking (AEB), auto high-beam, blind spot warning, and side collision warning.
Supported Hardware
------
At the moment, openpilot supports the [EON DevKit](https://comma.ai/shop/products/eon-dashcam-devkit) and the [comma two](https://comma.ai/shop/products/comma-two-devkit). A [car harness](https://comma.ai/shop/products/car-harness) is recommended to connect the EON or comma two to the car. In the future, we'd like to support other platforms as well, like gaming PCs.
Install openpilot on a neo device by entering ``https://openpilot.comma.ai`` during NEOS setup.
Supported Cars
------
| Make | Model (US Market Reference) | Supported Package | ACC | No ACC accel below | No ALC below |
| ----------| ------------------------------| ------------------| -----------------| -------------------| -------------|
| Acura | ILX 2016-18 | AcuraWatch Plus | openpilot | 25mph<sup>5</sup> | 25mph |
| Acura | RDX 2016-18 | AcuraWatch Plus | openpilot | 25mph<sup>5</sup> | 12mph |
| Chrysler | Pacifica 2017-18 | Adaptive Cruise | Stock | 0mph | 9mph |
| Chrysler | Pacifica Hybrid 2017-18 | Adaptive Cruise | Stock | 0mph | 9mph |
| Chrysler | Pacifica Hybrid 2019-20 | Adaptive Cruise | Stock | 0mph | 39mph |
| Honda | Accord 2018-19 | All | Stock | 0mph | 3mph |
| Honda | Accord Hybrid 2018-19 | All | Stock | 0mph | 3mph |
| Honda | Civic Hatchback 2017-19 | Honda Sensing | Stock | 0mph | 12mph |
| Honda | Civic Sedan/Coupe 2016-18 | Honda Sensing | openpilot | 0mph | 12mph |
| Honda | Civic Sedan/Coupe 2019 | Honda Sensing | Stock | 0mph | 2mph |
| Honda | CR-V 2015-16 | Touring | openpilot | 25mph<sup>5</sup> | 12mph |
| Honda | CR-V 2017-19 | Honda Sensing | Stock | 0mph | 12mph |
| Honda | CR-V Hybrid 2017-2019 | Honda Sensing | Stock | 0mph | 12mph |
| Honda | Fit 2018-19 | Honda Sensing | openpilot | 25mph<sup>5</sup> | 12mph |
| Honda | Odyssey 2018-20 | Honda Sensing | openpilot | 25mph<sup>5</sup> | 0mph |
| Honda | Passport 2019 | All | openpilot | 25mph<sup>5</sup> | 12mph |
| Honda | Pilot 2016-18 | Honda Sensing | openpilot | 25mph<sup>5</sup> | 12mph |
| Honda | Pilot 2019 | All | openpilot | 25mph<sup>5</sup> | 12mph |
| Honda | Ridgeline 2017-19 | Honda Sensing | openpilot | 25mph<sup>5</sup> | 12mph |
| Hyundai | Elantra 2017-19<sup>1</sup> | SCC + LKAS | Stock | 19mph | 34mph |
| Hyundai | Genesis 2018<sup>1</sup> | All | Stock | 19mph | 34mph |
| Hyundai | Santa Fe 2019<sup>1</sup> | All | Stock | 0mph | 0mph |
| Jeep | Grand Cherokee 2016-18 | Adaptive Cruise | Stock | 0mph | 9mph |
| Jeep | Grand Cherokee 2019 | Adaptive Cruise | Stock | 0mph | 39mph |
| Kia | Optima 2019<sup>1</sup> | SCC + LKAS | Stock | 0mph | 0mph |
| Kia | Sorento 2018<sup>1</sup> | All | Stock | 0mph | 0mph |
| Kia | Stinger 2018<sup>1</sup> | SCC + LKAS | Stock | 0mph | 0mph |
| Lexus | CT Hybrid 2017-18 | All | Stock<sup>4</sup>| 0mph | 0mph |
| Lexus | ES 2019 | All | openpilot | 0mph | 0mph |
| Lexus | ES Hybrid 2019 | All | openpilot | 0mph | 0mph |
| Lexus | IS 2017-2019 | All | Stock | 22mph | 0mph |
| Lexus | IS Hybrid 2017 | All | Stock | 0mph | 0mph |
| Lexus | RX 2016-17 | All | Stock<sup>4</sup>| 0mph | 0mph |
| Lexus | RX 2020 | All | openpilot | 0mph | 0mph |
| Lexus | RX Hybrid 2016-19 | All | Stock<sup>4</sup>| 0mph | 0mph |
| Subaru | Crosstrek 2018-19 | EyeSight | Stock | 0mph | 0mph |
| Subaru | Impreza 2019-20 | EyeSight | Stock | 0mph | 0mph |
| Toyota | Avalon 2016 | TSS-P | Stock<sup>4</sup>| 20mph<sup>5</sup> | 0mph |
| Toyota | Avalon 2017-18 | All | Stock<sup>4</sup>| 20mph<sup>5</sup> | 0mph |
| Toyota | Camry 2018-19 | All | Stock | 0mph<sup>2</sup> | 0mph |
| Toyota | Camry Hybrid 2018-19 | All | Stock | 0mph<sup>2</sup> | 0mph |
| Toyota | C-HR 2017-19 | All | Stock | 0mph | 0mph |
| Toyota | C-HR Hybrid 2017-19 | All | Stock | 0mph | 0mph |
| Toyota | Corolla 2017-19 | All | Stock<sup>4</sup>| 20mph<sup>5</sup> | 0mph |
| Toyota | Corolla 2020 | All | openpilot | 0mph | 0mph |
| Toyota | Corolla Hatchback 2019-20 | All | openpilot | 0mph | 0mph |
| Toyota | Corolla Hybrid 2020 | All | openpilot | 0mph | 0mph |
| Toyota | Highlander 2017-19 | All | Stock<sup>4</sup>| 0mph | 0mph |
| Toyota | Highlander Hybrid 2017-19 | All | Stock<sup>4</sup>| 0mph | 0mph |
| Toyota | Prius 2016 | TSS-P | Stock<sup>4</sup>| 0mph | 0mph |
| Toyota | Prius 2017-19 | All | Stock<sup>4</sup>| 0mph | 0mph |
| Toyota | Prius Prime 2017-20 | All | Stock<sup>4</sup>| 0mph | 0mph |
| Toyota | Rav4 2016 | TSS-P | Stock<sup>4</sup>| 20mph<sup>5</sup> | 0mph |
| Toyota | Rav4 2017-18 | All | Stock<sup>4</sup>| 20mph<sup>5</sup> | 0mph |
| Toyota | Rav4 2019 | All | openpilot | 0mph | 0mph |
| Toyota | Rav4 Hybrid 2016 | TSS-P | Stock<sup>4</sup>| 0mph | 0mph |
| Toyota | Rav4 Hybrid 2017-18 | All | Stock<sup>4</sup>| 0mph | 0mph |
| Toyota | Rav4 Hybrid 2019-20 | All | openpilot | 0mph | 0mph |
| Toyota | Sienna 2018 | All | Stock<sup>4</sup>| 0mph | 0mph |
| Volkswagen| Golf 2016-19<sup>3</sup> | Driver Assistance | Stock | 0mph | 0mph |
| Make | Model (US Market Reference)| Supported Package | Lateral | Longitudinal | No Accel Below | No Steer Below | Giraffe |
| ---------------------| ---------------------------| ---------------------| --------| ---------------| -----------------| ---------------|-------------------|
| Acura | ILX 2016-18 | AcuraWatch Plus | Yes | Yes | 25mph<sup>1</sup>| 25mph | Nidec |
| Acura | RDX 2016-18 | AcuraWatch Plus | Yes | Yes | 25mph<sup>1</sup>| 12mph | Nidec |
| Buick<sup>3</sup> | Regal 2018 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom<sup>6</sup>|
| Chevrolet<sup>3</sup>| Malibu 2017 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom<sup>6</sup>|
| Chevrolet<sup>3</sup>| Volt 2017-18 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom<sup>6</sup>|
| Cadillac<sup>3</sup> | ATS 2018 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom<sup>6</sup>|
| Chrysler | Pacifica 2017-18 | Adaptive Cruise | Yes | Stock | 0mph | 9mph | FCA |
| Chrysler | Pacifica Hybrid 2017-18 | Adaptive Cruise | Yes | Stock | 0mph | 9mph | FCA |
| Chrysler | Pacifica Hybrid 2019 | Adaptive Cruise | Yes | Stock | 0mph | 39mph | FCA |
| GMC<sup>3</sup> | Acadia Denali 2018 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom<sup>6</sup>|
| Holden<sup>3</sup> | Astra 2017 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom<sup>6</sup>|
| Honda | Accord 2018-19 | All | Yes | Stock | 0mph | 3mph | Bosch |
| Honda | Accord Hybrid 2018-19 | All | Yes | Stock | 0mph | 3mph | Bosch |
| Honda | Civic Sedan/Coupe 2016-18 | Honda Sensing | Yes | Yes | 0mph | 12mph | Nidec |
| Honda | Civic Sedan/Coupe 2019 | Honda Sensing | Yes | Stock | 0mph | 2mph | Bosch |
| Honda | Civic Hatchback 2017-19 | Honda Sensing | Yes | Stock | 0mph | 12mph | Bosch |
| Honda | CR-V 2015-16 | Touring | Yes | Yes | 25mph<sup>1</sup>| 12mph | Nidec |
| Honda | CR-V 2017-19 | Honda Sensing | Yes | Stock | 0mph | 12mph | Bosch |
| Honda | CR-V Hybrid 2017-2019 | Honda Sensing | Yes | Stock | 0mph | 12mph | Bosch |
| Honda | Fit 2018-19 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 12mph | Inverted Nidec |
| Honda | Odyssey 2018-19 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 0mph | Inverted Nidec |
| Honda | Passport 2019 | All | Yes | Yes | 25mph<sup>1</sup>| 12mph | Inverted Nidec |
| Honda | Pilot 2016-18 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 12mph | Nidec |
| Honda | Pilot 2019 | All | Yes | Yes | 25mph<sup>1</sup>| 12mph | Inverted Nidec |
| Honda | Ridgeline 2017-19 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 12mph | Nidec |
| Hyundai | Santa Fe 2019 | All | Yes | Stock | 0mph | 0mph | Custom<sup>5</sup>|
| Hyundai | Elantra 2017-19 | SCC + LKAS | Yes | Stock | 19mph | 34mph | Custom<sup>5</sup>|
| Hyundai | Genesis 2018 | All | Yes | Stock | 19mph | 34mph | Custom<sup>5</sup>|
| Jeep | Grand Cherokee 2016-18 | Adaptive Cruise | Yes | Stock | 0mph | 9mph | FCA |
| Jeep | Grand Cherokee 2019 | Adaptive Cruise | Yes | Stock | 0mph | 39mph | FCA |
| Kia | Optima 2019 | SCC + LKAS | Yes | Stock | 0mph | 0mph | Custom<sup>5</sup>|
| Kia | Sorento 2018 | All | Yes | Stock | 0mph | 0mph | Custom<sup>5</sup>|
| Kia | Stinger 2018 | SCC + LKAS | Yes | Stock | 0mph | 0mph | Custom<sup>5</sup>|
| Lexus | CT Hybrid 2017-18 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
| Lexus | ES 2019 | All | Yes | Yes | 0mph | 0mph | Toyota |
| Lexus | ES Hybrid 2019 | All | Yes | Yes | 0mph | 0mph | Toyota |
| Lexus | RX Hybrid 2016-19 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
| Lexus | IS 2017-2019 | All | Yes | Stock | 22mph | 0mph | Toyota |
| Lexus | IS Hybrid 2017 | All | Yes | Stock | 0mph | 0mph | Toyota |
| Subaru | Crosstrek 2018-19 | EyeSight | Yes | Stock | 0mph | 0mph | Subaru |
| Subaru | Impreza 2019-20 | EyeSight | Yes | Stock | 0mph | 0mph | Subaru |
| Toyota | Avalon 2016 | TSS-P | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
| Toyota | Avalon 2017-18 | All | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
| Toyota | Camry 2018-19 | All | Yes | Stock | 0mph<sup>4</sup> | 0mph | Toyota |
| Toyota | Camry Hybrid 2018-19 | All | Yes | Stock | 0mph<sup>4</sup> | 0mph | Toyota |
| Toyota | C-HR 2017-19 | All | Yes | Stock | 0mph | 0mph | Toyota |
| Toyota | C-HR Hybrid 2017-19 | All | Yes | Stock | 0mph | 0mph | Toyota |
| Toyota | Corolla 2017-19 | All | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
| Toyota | Corolla 2020 | All | Yes | Yes | 0mph | 0mph | Toyota |
| Toyota | Corolla Hatchback 2019 | All | Yes | Yes | 0mph | 0mph | Toyota |
| Toyota | Corolla Hybrid 2019 | All | Yes | Yes | 0mph | 0mph | Toyota |
| Toyota | Highlander 2017-19 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
| Toyota | Highlander Hybrid 2017-19 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
| Toyota | Prius 2016 | TSS-P | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
| Toyota | Prius 2017-19 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
| Toyota | Prius Prime 2017-20 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
| Toyota | Rav4 2016 | TSS-P | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
| Toyota | Rav4 2017-18 | All | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
| Toyota | Rav4 2019 | All | Yes | Yes | 0mph | 0mph | Toyota |
| Toyota | Rav4 Hybrid 2016 | TSS-P | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
| Toyota | Rav4 Hybrid 2017-18 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
| Toyota | Sienna 2018 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
<sup>1</sup>Requires a [panda](https://comma.ai/shop/products/panda-obd-ii-dongle) and open sourced [Hyundai giraffe](https://github.com/commaai/neo/tree/master/giraffe/hyundai), designed for the 2019 Sante Fe; pinout may differ for other Hyundai and Kia models. <br />
<sup>2</sup>28mph for Camry 4CYL L, 4CYL LE and 4CYL SE which don't have Full-Speed Range Dynamic Radar Cruise Control. <br />
<sup>3</sup>Requires a [custom connector](https://community.comma.ai/wiki/index.php/Volkswagen#Integration_at_R242_Camera) for the [car harness](https://comma.ai/shop/products/car-harness) <br />
<sup>1</sup>[Comma Pedal](https://community.comma.ai/wiki/index.php/Comma_Pedal) is used to provide stop-and-go capability to some of the openpilot-supported cars that don't currently support stop-and-go. Here is how to [build a Comma Pedal](https://medium.com/@jfrux/comma-pedal-building-with-macrofab-6328bea791e8). ***NOTE: The Comma Pedal is not officially supported by [comma.ai](https://comma.ai).*** <br />
<sup>2</sup>When disconnecting the Driver Support Unit (DSU), otherwise longitudinal control is stock ACC. For DSU locations, see [Toyota Wiki page](https://community.comma.ai/wiki/index.php/Toyota). ***NOTE: disconnecting the DSU disables Automatic Emergency Braking (AEB).*** <br />
<sup>3</sup>[GM installation guide](https://zoneos.com/volt/). ***NOTE: disconnecting the ASCM disables Automatic Emergency Braking (AEB).*** <br />
<sup>4</sup>28mph for Camry 4CYL L, 4CYL LE and 4CYL SE which don't have Full-Speed Range Dynamic Radar Cruise Control. <br />
<sup>5</sup>Open sourced [Hyundai Giraffe](https://github.com/commaai/neo/tree/master/giraffe/hyundai) is designed for the 2019 Sante Fe; pinout may differ for other Hyundais. <br />
<sup>6</sup>Community built Giraffe, find more information [here](https://zoneos.com/shop/). <br />
Community Maintained Cars and Features
Community Maintained Cars
------
| Make | Model (US Market Reference) | Supported Package | ACC | No ACC accel below | No ALC below |
| ----------| ------------------------------| ------------------| -----------------| -------------------| -------------|
| Buick | Regal 2018<sup>6</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
| Cadillac | ATS 2018<sup>6</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
| Chevrolet | Malibu 2017<sup>6</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
| Chevrolet | Volt 2017-18<sup>6</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
| GMC | Acadia Denali 2018<sup>6</sup>| Adaptive Cruise | openpilot | 0mph | 7mph |
| Holden | Astra 2017<sup>6</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
| Make | Model | Supported Package | Lateral | Longitudinal | No Accel Below | No Steer Below | Giraffe |
| ---------------------| -------------------------| ---------------------| --------| ---------------| -----------------| ---------------|-------------------|
| Tesla | Model S 2012-13 | All | Yes | Not yet | Not applicable | 0mph | Custom<sup>7</sup>|
<sup>4</sup>When disconnecting the Driver Support Unit (DSU), openpilot ACC will replace stock ACC. For DSU locations, see [Toyota Wiki page](https://community.comma.ai/wiki/index.php/Toyota). ***NOTE: disconnecting the DSU disables Automatic Emergency Braking (AEB).*** <br />
<sup>5</sup>[Comma Pedal](https://community.comma.ai/wiki/index.php/Comma_Pedal) is used to provide stop-and-go capability to some of the openpilot-supported cars that don't currently support stop-and-go. Here is how to [build a Comma Pedal](https://medium.com/@jfrux/comma-pedal-building-with-macrofab-6328bea791e8). ***NOTE: The Comma Pedal is not officially supported by [comma](https://comma.ai).*** <br />
<sup>6</sup>Requires a [panda](https://comma.ai/shop/products/panda-obd-ii-dongle) and [community built giraffe](https://zoneos.com/volt/). ***NOTE: disconnecting the ASCM disables Automatic Emergency Braking (AEB).*** <br />
[[Tesla Model S Pull Request]](https://github.com/commaai/openpilot/pull/246) <br />
<sup>7</sup>Community built Giraffe, find more information here [Community Tesla Giraffe](https://github.com/jeankalud/neo/tree/tesla_giraffe/giraffe/tesla) <br />
Community Maintained Cars and Features are not verified by comma to meet our [safety model](SAFETY.md). Be extra cautious using them. They are only available after enabling the toggle in `Settings->Developer->Enable Community Features`.
Community Maintained Cars are not confirmed by comma.ai to meet our [safety model](https://github.com/commaai/openpilot/blob/devel/SAFETY.md). Be extra cautious using them.
Installation Instructions
In Progress Cars
------
- All TSS-P Toyota with Steering Assist and LSS-P Lexus with Steering Assist or Lane Keep Assist.
- All Hyundai with SmartSense.
- All Kia, Genesis with SCC and LKAS.
- All Chrysler, Jeep, Fiat with Adaptive Cruise Control and LaneSense.
- All Subaru with EyeSight.
How can I add support for my car?
------
Install openpilot on a EON by entering ``https://openpilot.comma.ai`` during the installer setup.
If your car has adaptive cruise control and lane keep assist, you are in luck. Using a [panda](https://comma.ai/shop/products/panda-obd-ii-dongle/) and [cabana](https://community.comma.ai/cabana/), you can understand how to make your car drive by wire.
Follow this [video instructions](https://youtu.be/3nlkomHathI) to properly mount the EON on the windshield. Note: openpilot features an automatic pose calibration routine and openpilot performance should not be affected by small pitch and yaw misalignments caused by imprecise EON mounting.
We've written guides for [Brand](https://medium.com/@comma_ai/how-to-write-a-car-port-for-openpilot-7ce0785eda84) and [Model](https://medium.com/@comma_ai/openpilot-port-guide-for-toyota-models-e5467f4b5fe6) ports. These guides might help you after you have the basics figured out.
Before placing the device on your windshield, check the state and local laws and ordinances where you drive. Some state laws prohibit or restrict the placement of objects on the windshield of a motor vehicle.
- BMW, Audi, Volvo, and Mercedes all use [FlexRay](https://en.wikipedia.org/wiki/FlexRay) and can be supported after [FlexRay support](https://github.com/commaai/openpilot/pull/463) is merged.
- We put time into a Ford port, but the steering has a 10 second cutout limitation that makes it unusable.
- The 2016-2017 Honda Accord uses a custom signaling protocol for steering that's unlikely to ever be upstreamed.
You will be able to engage openpilot after reviewing the onboarding screens and finishing the calibration procedure.
Limitations of openpilot ALC and LDW
------
openpilot ALC and openpilot LDW do not automatically drive the vehicle or reduce the amount of attention that must be paid to operate your vehicle. The driver must always keep control of the steering wheel and be ready to correct the openpilot ALC action at all times.
While changing lanes, openpilot is not capable of looking next to you or checking your blind spot. Only nudge the wheel to initiate a lane change after you have confirmed it's safe to do so.
Many factors can impact the performance of openpilot ALC and openpilot LDW, causing them to be unable to function as intended. These include, but are not limited to:
* Poor visibility (heavy rain, snow, fog, etc.) or weather conditions that may interfere with sensor operation.
* The road facing camera is obstructed, covered or damaged by mud, ice, snow, etc.
* Obstruction caused by applying excessive paint or adhesive products (such as wraps, stickers, rubber coating, etc.) onto the vehicle.
* The EON is mounted incorrectly.
* When in sharp curves, like on-off ramps, intersections etc...; openpilot is designed to be limited in the amount of steering torque it can produce.
* In the presence of restricted lanes or construction zones.
* When driving on highly banked roads or in presence of strong cross-wind.
* Extremely hot or cold temperatures.
* Bright light (due to oncoming headlights, direct sunlight, etc.).
* Driving on hills, narrow, or winding roads.
The list above does not represent an exhaustive list of situations that may interfere with proper operation of openpilot components. It is the driver's responsibility to be in control of the vehicle at all times.
Limitations of openpilot ACC and FCW
------
openpilot ACC and openpilot FCW are not systems that allow careless or inattentive driving. It is still necessary for the driver to pay close attention to the vehicles surroundings and to be ready to re-take control of the gas and the brake at all times.
Many factors can impact the performance of openpilot ACC and openpilot FCW, causing them to be unable to function as intended. These include, but are not limited to:
* Poor visibility (heavy rain, snow, fog, etc.) or weather conditions that may interfere with sensor operation.
* The road facing camera or radar are obstructed, covered, or damaged by mud, ice, snow, etc.
* Obstruction caused by applying excessive paint or adhesive products (such as wraps, stickers, rubber coating, etc.) onto the vehicle.
* The EON is mounted incorrectly.
* Approaching a toll booth, a bridge or a large metal plate.
* When driving on roads with pedestrians, cyclists, etc...
* In presence of traffic signs or stop lights, which are not detected by openpilot at this time.
* When the posted speed limit is below the user selected set speed. openpilot does not detect speed limits at this time.
* In presence of vehicles in the same lane that are not moving.
* When abrupt braking maneuvers are required. openpilot is designed to be limited in the amount of deceleration and acceleration that it can produce.
* When surrounding vehicles perform close cut-ins from neighbor lanes.
* Driving on hills, narrow, or winding roads.
* Extremely hot or cold temperatures.
* Bright light (due to oncoming headlights, direct sunlight, etc.).
* Interference from other equipment that generates radar waves.
The list above does not represent an exhaustive list of situations that may interfere with proper operation of openpilot components. It is the driver's responsibility to be in control of the vehicle at all times.
Limitations of openpilot DM
------
openpilot DM should not be considered an exact measurements of the status of alertness of the driver.
Many factors can impact the performance of openpilot DM, causing it to be unable to function as intended. These include, but are not limited to:
* Low light conditions, such as driving at night or in dark tunnels.
* Bright light (due to oncoming headlights, direct sunlight, etc.).
* The driver face is partially or completely outside field of view of the driver facing camera.
* Right hand driving vehicles.
* The driver facing camera is obstructed, covered, or damaged.
The list above does not represent an exhaustive list of situations that may interfere with proper operation of openpilot components. A driver should not rely on openpilot DM to assess their level of attention.
User Data and comma Account
------
By default, openpilot uploads the driving data to our servers. You can also access your data by pairing with the comma connect app ([iOS](https://apps.apple.com/us/app/comma-connect/id1456551889), [Android](https://play.google.com/store/apps/details?id=ai.comma.connect&hl=en_US)). We use your data to train better models and improve openpilot for everyone.
openpilot is open source software: the user is free to disable data collection if they wish to do so.
openpilot 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://my.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.
Safety and Testing
----
* openpilot observes ISO26262 guidelines, see [SAFETY.md](SAFETY.md) for more detail.
* openpilot has software in the loop [tests](run_docker_tests.sh) that run on every commit.
* The safety model code 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 EONs continuously replaying routes.
Testing on PC
------
Check out the tools directory in master: lots of tools you can use to replay driving data, test and develop openpilot from your pc.
Community and Contributing
------
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). Bug fixes and new car ports are encouraged.
You can add support for your car by following guides we have written for [Brand](https://medium.com/@comma_ai/how-to-write-a-car-port-for-openpilot-7ce0785eda84) and [Model](https://medium.com/@comma_ai/openpilot-port-guide-for-toyota-models-e5467f4b5fe6) ports. Generally, a car with adaptive cruise control and lane keep assist is a good candidate. [Join our Discord](https://discord.comma.ai) to discuss car ports: most car makes have a dedicated channel.
Want to get paid to work on openpilot? [comma is hiring](https://comma.ai/jobs/). We also have a [bounty program](https://comma.ai/bounties.html).
And [follow us on Twitter](https://twitter.com/comma_ai).
Directory Structure
Directory structure
------
.
├── apk # The apk files used for the UI
├── cereal # The messaging spec and libs used for all logs on EON
├── cereal # The messaging spec used for all logs on EON
├── common # Library like functionality we've developed here
├── installer/updater # Manages auto-updates of openpilot
├── opendbc # Files showing how to interpret data from cars
├── panda # Code used to communicate on CAN
├── panda # Code used to communicate on CAN and LIN
├── phonelibs # Libraries used on EON
├── pyextra # Libraries used on EON
└── selfdrive # Code needed to drive the car
├── assets # Fonts and images for UI
├── athena # Allows communication with the app
├── boardd # Daemon to talk to the board
├── camerad # Driver to capture images from the camera sensors
├── can # Helpers for parsing CAN messages
├── car # Car specific code to read states and control actuators
├── common # Shared C/C++ code for the daemons
├── controls # Perception, planning and controls
@@ -282,20 +184,54 @@ Directory Structure
├── locationd # Soon to be home of precise location
├── logcatd # Android logcat as a service
├── loggerd # Logger and uploader of car data
├── modeld # Driving and monitoring model runners
├── proclogd # Logs information from proc
├── sensord # IMU / GPS interface code
├── tests # Unit tests, system tests and a car simulator
── ui # The UI
├── test # Car simulator running code through virtual maneuvers
── ui # The UI
└── visiond # Vision pipeline
To understand how the services interact, see `cereal/service_list.yaml`.
To understand how the services interact, see `selfdrive/service_list.yaml`
User Data / chffr Account / Crash Reporting
------
By default, openpilot creates an account and includes a client for chffr, our dashcam app. We use your data to train better models and improve openpilot for everyone.
It's open source software, so you are free to disable it if you wish.
It logs the road facing camera, CAN, GPS, IMU, magnetometer, thermal sensors, crashes, and operating system logs.
The user facing camera is only logged if you explicitly opt-in in settings.
It does not log the microphone.
By using it, you agree to [our privacy policy](https://community.comma.ai/privacy.html). 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.ai. By accepting this agreement, you grant an irrevocable, perpetual, worldwide right to comma.ai for the use of this data.
Testing on PC
------
Check out [openpilot-tools](https://github.com/commaai/openpilot-tools): lots of tools you can use to replay driving data, test and develop openpilot from your pc.
Also, within openpilot there is a rudimentary infrastructure to run a basic simulation and generate a report of openpilot's behavior in different longitudinal control scenarios.
```bash
# Requires working docker
./run_docker_tests.sh
```
Contributing
------
We welcome both pull requests and issues on [github](http://github.com/commaai/openpilot). Bug fixes and new car ports encouraged.
We also have a [bounty program](https://comma.ai/bounties.html).
Want to get paid to work on openpilot? [comma.ai is hiring](https://comma.ai/jobs/)
Licensing
------
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.
+36
View File
@@ -0,0 +1,36 @@
Welcome to chffrplus
======
[chffrplus](https://github.com/commaai/chffrplus) is an open source dashcam.
This is the shipping reference software for the comma EON Dashcam DevKit. It keeps many of the niceities of [openpilot](https://github.com/commaai/openpilot), like high quality sensors, great camera, and good autostart and stop. Though unlike openpilot, it cannot control your car. chffrplus can interface with your car through a [panda](https://shop.comma.ai/products/panda-obd-ii-dongle), but just like our dashcam app [chffr](https://getchffr.com/), it is read only.
It integrates with the rest of the comma ecosystem, so you can view your drives on the [chffr](https://getchffr.com/) app for Android or iOS, and reverse engineer your car with [cabana](https://community.comma.ai/cabana/?demo=1).
Hardware
------
Right now chffrplus supports the [EON Dashcam DevKit](https://shop.comma.ai/products/eon-dashcam-devkit) for hardware to run on.
Install chffrplus on a EON device by entering ``https://chffrplus.comma.ai`` during NEOS setup.
User Data / chffr Account / Crash Reporting
------
By default chffrplus creates an account and includes a client for chffr, our dashcam app.
It's open source software, so you are free to disable it if you wish.
It logs the road facing camera, CAN, GPS, IMU, magnetometer, thermal sensors, crashes, and operating system logs.
It does not log the user facing camera or the microphone.
By using it, you agree to [our privacy policy](https://beta.comma.ai/privacy.html). 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.ai. By accepting this agreement, you grant an irrevocable, perpetual, worldwide right to comma.ai for the use of this data.
Licensing
------
chffrplus is released under the MIT license.
+2 -48
View File
@@ -1,54 +1,8 @@
Version 0.7.2 (2020-02-07)
========================
* ECU firmware version based fingerprinting for Honda & Toyota
* New driving model: improved path prediction during turns and lane changes and better lead speed tracking
* Improve driver monitoring under extreme lighting and add low accuracy alert
* Support for 2019 Rav4 Hybrid thanks to illumiN8i!
* Support for 2016, 2017 and 2020 Lexus RX thanks to illumiN8i!
* Support for 2020 Chrysler Pacifica Hybrid thanks to adhintz!
Version 0.7.1 (2020-01-20)
========================
* comma two support!
* Lane Change Assist above 45 mph!
* Replace zmq with custom messaging library, msgq!
* Supercombo model: calibration and driving models are combined for better lead estimate
* More robust updater thanks to jyoung8607! Requires NEOS update
* Improve low speed ACC tuning
Version 0.7 (2019-12-13)
========================
* Move to SCons build system!
* Add Lane Departure Warning (LDW) for all supported vehicles!
* NEOS update: increase wifi speed thanks to jyoung8607!
* Adaptive driver monitoring based on scene
* New driving model trained end-to-end: improve lane lines and lead detection
* Smarter torque limit alerts for all cars
* Improve GM longitudinal control: proper computations for 15Hz radar
* Move GM port, Toyota with DSU removed, comma pedal in community features; toggle switch required
* Remove upload over cellular toggle: only upload qlog and qcamera files if not on wifi
* Refactor Panda code towards ISO26262 and SIL2 compliancy
* Forward stock FCW for Honda Nidec
* Volkswagen port now standard: comma Harness intercepts stock camera
Version 0.6.6 (2019-11-05)
========================
* Volkswagen support thanks to jyoung8607!
* Toyota Corolla Hybrid with TSS 2.0 support thanks to u8511049!
* Lexus ES with TSS 2.0 support thanks to energee!
* Fix GM ignition detection and lock safety mode not required anymore
* Log panda firmware and dongle ID thanks to martinl!
* New driving model: improve path prediction and lead detection
* New driver monitoring model, 4x smaller and running on DSP
* Display an alert and don't start openpilot if panda has wrong firmware
* Fix bug preventing EON from terminating processes after a drive
* Remove support for Toyota giraffe without the 120Ohm resistor
Version 0.6.5 (2019-10-07)
========================
* NEOS update: upgrade to Python3 and new installer!
* comma Harness support!
* New driving model: improve path prediction
* New driving model: lateral control has lower reliance on lanelines
* New driver monitoring model: more accurate face and eye detection
* Redesign offroad screen to display updates and alerts
* Increase maximum allowed acceleration
@@ -108,7 +62,7 @@ Version 0.6 (2019-07-01)
* Panda safety code is MISRA compliant and ships with a signed version on release2
* New NEOS is 500MB smaller and has a reproducible usr/pipenv
* Lexus ES Hybrid support thanks to wocsor!
* Improve tuning for supported Toyota with TSS 2.0
* Improve tuning for supported Toyota with TSS2
* Various other stability improvements
Version 0.5.13 (2019-05-31)
+133 -16
View File
@@ -1,26 +1,16 @@
openpilot Safety
======
openpilot is an Adaptive Cruise Control (ACC) and Automated Lane Centering (ALC) system.
Like other ACC and ALC systems, openpilot is a failsafe passive system and it requires the
driver to be alert and to pay attention at all times.
openpilot is an Adaptive Cruise Control (ACC) and Lane Keeping Assist (LKA) system.
Like other ACC and LKA systems, openpilot requires the driver to be alert and to
pay attention at all times. We repeat, **driver alertness is necessary, but not
sufficient, for openpilot to be used safely**.
In order to enforce driver alertness, openpilot includes a driver monitoring feature
that alerts the driver when distracted.
However, even with an attentive driver, we must make further efforts for the system to be
safe. We repeat, **driver alertness is necessary, but not sufficient, for openpilot to be
used safely** and openpilot is provided with no warranty of fitness for any purpose.
openpilot is developed in good faith to be compliant with FMVSS requirements and to follow
industry standards of safety for Level 2 Driver Assistance Systems. In particular, we observe
ISO26262 guidelines, including those from [pertinent documents](https://www.nhtsa.gov/sites/nhtsa.dot.gov/files/documents/13498a_812_573_alcsystemreport.pdf)
released by NHTSA. In addition, we impose strict coding guidelines (like [MISRA C : 2012](https://www.misra.org.uk/MISRAHome/MISRAC2012/tabid/196/Default.aspx))
on parts of openpilot that are safety relevant. We also perform software-in-the-loop,
hardware-in-the-loop and in-vehicle tests before each software release.
Following Hazard and Risk Analysis and FMEA, at a very high level, we have designed openpilot
ensuring two main safety requirements.
safe. We have designed openpilot with two other safety considerations.
1. The driver must always be capable to immediately retake manual control of the vehicle,
by stepping on either pedal or by pressing the cancel button.
@@ -28,7 +18,134 @@ ensuring two main safety requirements.
react. This means that while the system is engaged, the actuators are constrained
to operate within reasonable limits.
For vehicle specific implementation of the safety concept, refer to `panda/board/safety/`.
Following are details of the car specific safety implementations:
Honda/Acura
------
- While the system is engaged, gas, brake and steer commands are subject to the same limits used by
the stock system.
- Without an interceptor, the gas is controlled by the Powertrain Control Module (PCM).
The PCM limits acceleration to what is reasonable for a cruise control system. With an
interceptor, the gas is clipped to 60%.
- The brake is controlled by the 0x1FA CAN message. This message allows full
braking, although the panda firmware and openpilot clip it to 1/4th of the max.
This is approximately 0.3g of braking.
- Steering is controlled by the 0xE4 CAN message. The Electronic Power Steering (EPS)
controller in the car limits the torque to a very small amount, so regardless of the
message, the controller cannot jerk the wheel.
- Brake and gas pedal pressed signals are contained in the 0x17C CAN message. A rising edge of
either signals triggers a disengagement, which is enforced by the panda firmware and by openpilot. The
white led on the panda signifies if the panda is allowing control messages.
- Honda CAN uses both a counter and a checksum to ensure integrity and prevent
replay of the same message.
Toyota/Lexus
------
- While the system is engaged, gas, brake and steer commands are subject to the same limits used by
the stock system.
- With the stock Driving Support Unit (DSU) connected (or in DSU-less models like Camry and C-HR),
the acceleration is controlled by the stock system and is subject to the stock adaptive cruise
control limits. Without the stock DSU connected, the acceleration command is controlled by the
0x343 CAN message and its value is limited between .3g of deceleration and .15g of acceleration
by the panda firmware and by openpilot. The acceleration command is ignored by the Engine Control
Module (ECM) while the cruise control system is disengaged.
- Steering torque is controlled through the 0x2E4 CAN message and it's limited by the panda firmware and by
openpilot to a value between -1500 and 1500. In addition, the vehicle EPS unit will not respond to
commands outside these limits. A steering torque rate limit is enforced by the panda firmware and by
openpilot, so that the commanded steering torque must rise from 0 to max value no faster than
1.5s. Commanded steering torque is limited by the panda firmware and by openpilot to be no more than 350
units above the actual EPS generated motor torque to ensure limited differences between
commanded and actual torques.
- Brake and gas pedal pressed signals are contained in the 0x224 and 0x1D2 CAN messages,
respectively. A rising edge of either signals triggers a disengagement, which is enforced by the
panda firmware and by openpilot. Additionally, the cruise control system disengages on the rising edge of
the brake pedal pressed signal.
- The cruise control system state is contained in the 0x1D2 message. No control messages are
allowed if the cruise control system is not active. This is enforced by openpilot and the
panda firmware. The white led on the panda signifies if the panda is allowing control messages.
GM/Chevrolet
------
- While the system is engaged, gas, brake and steer commands are subject to the same limits used by
the stock system.
- The gas and regen are controlled by the 0x2CB message and it's limited by the panda firmware and by
openpilot to a value between 1404 and 3072. the minimum value correspond to a mild decel due to regen,
while 3072 correspond to approximately 0.18g of acceleration from stop.
- The friction brakes are controlled by the 0x315 message and its value is limited by the panda firmware
and openpilot to 350. This is approximately 0.3g of braking.
- Steering torque is controlled through the 0x180 CAN message and it's limited by the panda firmware and by
openpilot to a value between -300 and 300. In addition, the vehicle EPS unit will fault for
commands outside these limits. A steering torque rate limit is enforced by the panda firmware and by
openpilot, so that the commanded steering torque must rise from 0 to max value no faster than
0.75s. Commanded steering torque is gradually limited by the panda firmware and by openpilot if the driver's
torque exceeds 12 units in the opposite dicrection to ensure limited applied torque against the
driver's will.
- Brake pedal and gas pedal potentiometer signals are contained in the 0xF1 and 0x1A1 CAN messages,
respectively. A rising edge of either signals triggers a disengagement, which is enforced by the
panda firmware and by openpilot. Additionally, the cruise control system disengages on the rising edge of
the brake pedal pressed signal. The regen paddle pressed signal is in the 0xBD message. When the
regen paddle is pressed, a disengagement is enforced by both the firmware and by openpilot.
- GM CAN uses both a counter and a checksum to ensure integrity and prevent
replay of the same message.
Hyundai/Kia (Lateral only)
------
- While the system is engaged, steer commands are subject to the same limits used by
the stock system.
- Steering torque is controlled through the 0x340 CAN message and it's limited by the panda firmware and by
openpilot to a value between -255 and 255. In addition, the vehicle EPS unit will fault for
commands outside the values of -409 and 409. A steering torque rate limit is enforced by the panda firmware and by
openpilot, so that the commanded steering torque must rise from 0 to max value no faster than
0.85s. Commanded steering torque is gradually limited by the panda firmware and by openpilot if the driver's
torque exceeds 50 units in the opposite dicrection to ensure limited applied torque against the
driver's will.
Chrysler/Jeep/Fiat (Lateral only)
------
- While the system is engaged, steer commands are subject to the same limits used by
the stock system.
- Steering torque is controlled through the 0x292 CAN message and it's limited by the panda firmware and by
openpilot to a value between -261 and 261. In addition, the vehicle EPS unit will fault for
commands outside these limits. A steering torque rate limit is enforced by the panda firmware and by
openpilot, so that the commanded steering torque must rise from 0 to max value no faster than
0.87s. Commanded steering torque is limited by the panda firmware and by openpilot to be no more than 80
units above the actual EPS generated motor torque to ensure limited differences between
commanded and actual torques.
Subaru (Lateral only)
------
- While the system is engaged, steer commands are subject to the same limits used by
the stock system.
- Steering torque is controlled through the 0x122 CAN message and it's limited by the panda firmware and by
openpilot to a value between -255 and 255. In addition, the vehicle EPS unit will fault for
commands outside the values of -2047 and 2047. A steering torque rate limit is enforced by the panda firmware and by
openpilot, so that the commanded steering torque must rise from 0 to max value no faster than
0.41s. Commanded steering torque is gradually limited by the panda firmware and by openpilot if the driver's
torque exceeds 60 units in the opposite dicrection to ensure limited applied torque against the
driver's will.
**Extra note**: comma.ai strongly discourages the use of openpilot forks with safety code either missing or
not fully meeting the above requirements.
-232
View File
@@ -1,232 +0,0 @@
import os
import subprocess
import sys
import platform
AddOption('--test',
action='store_true',
help='build test files')
AddOption('--asan',
action='store_true',
help='turn on ASAN')
arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
if platform.system() == "Darwin":
arch = "Darwin"
if arch == "aarch64":
lenv = {
"LD_LIBRARY_PATH": '/data/data/com.termux/files/usr/lib',
"PATH": os.environ['PATH'],
"ANDROID_DATA": os.environ['ANDROID_DATA'],
"ANDROID_ROOT": os.environ['ANDROID_ROOT'],
}
cpppath = [
"#phonelibs/opencl/include",
]
libpath = [
"#phonelibs/snpe/aarch64-android-clang3.8",
"/usr/lib",
"/data/data/com.termux/files/usr/lib",
"/system/vendor/lib64",
"/system/comma/usr/lib",
"#phonelibs/nanovg",
"#phonelibs/libyuv/lib",
]
cflags = ["-DQCOM", "-mcpu=cortex-a57"]
cxxflags = ["-DQCOM", "-mcpu=cortex-a57"]
rpath = ["/system/vendor/lib64"]
else:
lenv = {
"PATH": "#external/bin:" + os.environ['PATH'],
}
cpppath = [
"#phonelibs/capnp-cpp/include",
"#phonelibs/capnp-c/include",
"#phonelibs/zmq/x64/include",
"#external/tensorflow/include",
]
if arch == "Darwin":
libpath = [
"#phonelibs/capnp-cpp/mac/lib",
"#phonelibs/capnp-c/mac/lib",
"#phonelibs/libyuv/mac/lib",
"#cereal",
"#selfdrive/common",
"/usr/local/lib",
"/System/Library/Frameworks/OpenGL.framework/Libraries",
]
else:
libpath = [
"#phonelibs/capnp-cpp/x64/lib",
"#phonelibs/capnp-c/x64/lib",
"#phonelibs/snpe/x86_64-linux-clang",
"#phonelibs/zmq/x64/lib",
"#phonelibs/libyuv/x64/lib",
"#external/zmq/lib",
"#external/tensorflow/lib",
"#cereal",
"#selfdrive/common",
"/usr/lib",
"/usr/local/lib",
]
rpath = ["phonelibs/capnp-cpp/x64/lib",
"phonelibs/zmq/x64/lib",
"external/tensorflow/lib",
"cereal",
"selfdrive/common"]
# allows shared libraries to work globally
rpath = [os.path.join(os.getcwd(), x) for x in rpath]
cflags = []
cxxflags = []
ccflags_asan = ["-fsanitize=address", "-fno-omit-frame-pointer"] if GetOption('asan') else []
ldflags_asan = ["-fsanitize=address"] if GetOption('asan') else []
# change pythonpath to this
lenv["PYTHONPATH"] = Dir("#").path
env = Environment(
ENV=lenv,
CCFLAGS=[
"-g",
"-fPIC",
"-O2",
"-Werror=implicit-function-declaration",
"-Werror=incompatible-pointer-types",
"-Werror=int-conversion",
"-Werror=return-type",
"-Werror=format-extra-args",
] + cflags + ccflags_asan,
CPPPATH=cpppath + [
"#",
"#selfdrive",
"#phonelibs/bzip2",
"#phonelibs/libyuv/include",
"#phonelibs/openmax/include",
"#phonelibs/json/src",
"#phonelibs/json11",
"#phonelibs/eigen",
"#phonelibs/curl/include",
"#phonelibs/opencv/include",
"#phonelibs/libgralloc/include",
"#phonelibs/android_frameworks_native/include",
"#phonelibs/android_hardware_libhardware/include",
"#phonelibs/android_system_core/include",
"#phonelibs/linux/include",
"#phonelibs/snpe/include",
"#phonelibs/nanovg",
"#selfdrive/common",
"#selfdrive/camerad",
"#selfdrive/camerad/include",
"#selfdrive/loggerd/include",
"#selfdrive/modeld",
"#cereal/messaging",
"#cereal",
"#opendbc/can",
],
CC='clang',
CXX='clang++',
LINKFLAGS=ldflags_asan,
RPATH=rpath,
CFLAGS=["-std=gnu11"] + cflags,
CXXFLAGS=["-std=c++14"] + cxxflags,
LIBPATH=libpath +
[
"#cereal",
"#selfdrive/common",
"#phonelibs",
]
)
if os.environ.get('SCONS_CACHE'):
CacheDir('/tmp/scons_cache')
node_interval = 5
node_count = 0
def progress_function(node):
global node_count
node_count += node_interval
sys.stderr.write("progress: %d\n" % node_count)
if os.environ.get('SCONS_PROGRESS'):
Progress(progress_function, interval=node_interval)
SHARED = False
def abspath(x):
if arch == 'aarch64':
pth = os.path.join("/data/pythonpath", x[0].path)
env.Depends(pth, x)
return File(pth)
else:
# rpath works elsewhere
return x[0].path.rsplit("/", 1)[1][:-3]
#zmq = 'zmq'
# still needed for apks
zmq = FindFile("libzmq.a", libpath)
Export('env', 'arch', 'zmq', 'SHARED')
# cereal and messaging are shared with the system
SConscript(['cereal/SConscript'])
if SHARED:
cereal = abspath([File('cereal/libcereal_shared.so')])
messaging = abspath([File('cereal/libmessaging_shared.so')])
else:
cereal = [File('#cereal/libcereal.a')]
messaging = [File('#cereal/libmessaging.a')]
Export('cereal', 'messaging')
SConscript(['selfdrive/common/SConscript'])
Import('_common', '_visionipc', '_gpucommon', '_gpu_libs')
if SHARED:
common, visionipc, gpucommon = abspath(common), abspath(visionipc), abspath(gpucommon)
else:
common = [_common, 'json']
visionipc = _visionipc
gpucommon = [_gpucommon] + _gpu_libs
Export('common', 'visionipc', 'gpucommon')
SConscript(['opendbc/can/SConscript'])
SConscript(['common/SConscript'])
SConscript(['common/kalman/SConscript'])
SConscript(['phonelibs/SConscript'])
if arch != "Darwin":
SConscript(['selfdrive/camerad/SConscript'])
SConscript(['selfdrive/modeld/SConscript'])
SConscript(['selfdrive/controls/lib/cluster/SConscript'])
SConscript(['selfdrive/controls/lib/lateral_mpc/SConscript'])
SConscript(['selfdrive/controls/lib/longitudinal_mpc/SConscript'])
SConscript(['selfdrive/boardd/SConscript'])
SConscript(['selfdrive/proclogd/SConscript'])
SConscript(['selfdrive/ui/SConscript'])
SConscript(['selfdrive/loggerd/SConscript'])
if arch == "aarch64":
SConscript(['selfdrive/logcatd/SConscript'])
SConscript(['selfdrive/sensord/SConscript'])
SConscript(['selfdrive/clocksd/SConscript'])
SConscript(['selfdrive/locationd/SConscript'])
# TODO: finish cereal, dbcbuilder, MPC
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
-11
View File
@@ -1,11 +0,0 @@
#!/usr/bin/bash
mode=$1
if [ $1 -eq 1 ]; then
printf %s "1" > /data/params/d/DragonBTG
fi
if [ $1 -eq 0 ]; then
printf %s "0" > /data/params/d/DragonBTG
fi
rm -rf /data/openpilot/selfdrive/boardd/boardd && reboot
-1
View File
@@ -1 +0,0 @@
.sconsign.dblite
-8
View File
@@ -3,12 +3,4 @@ node_modules
package-lock.json
*.pyc
__pycache__
.*.swp
.*.swo
libcereal*.a
libmessaging.*
libmessaging_shared.*
services.h
.sconsign.dblite
libcereal_shared.*
-19
View File
@@ -1,19 +0,0 @@
from ubuntu:16.04
RUN apt-get update && apt-get install -y libzmq3-dev clang wget git autoconf libtool curl make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl
RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
ENV PATH="/root/.pyenv/bin:/root/.pyenv/shims:${PATH}"
RUN pyenv install 3.7.3
RUN pyenv global 3.7.3
RUN pyenv rehash
RUN pip3 install pyyaml==5.1.2 Cython==0.29.14 scons==3.1.1 pycapnp==0.6.4
WORKDIR /project/cereal
COPY install_capnp.sh .
RUN ./install_capnp.sh
ENV PYTHONPATH=/project
COPY . .
RUN scons -c && scons -j$(nproc)
+62
View File
@@ -0,0 +1,62 @@
PWD := $(shell pwd)
SRCS := log.capnp car.capnp
GENS := gen/cpp/car.capnp.c++ gen/cpp/log.capnp.c++
JS := gen/js/car.capnp.js gen/js/log.capnp.js
UNAME_M ?= $(shell uname -m)
GENS += gen/c/car.capnp.c gen/c/log.capnp.c gen/c/include/c++.capnp.h gen/c/include/java.capnp.h
ifeq ($(UNAME_M),x86_64)
ifneq (, $(shell which capnpc-java))
GENS += gen/java/Car.java gen/java/Log.java
else
$(warning capnpc-java not found, skipping java build)
endif
endif
ifeq ($(UNAME_M),aarch64)
CAPNPC=PATH=$(PWD)/../phonelibs/capnp-cpp/aarch64/bin/:$$PATH capnpc
else
CAPNPC=capnpc
endif
.PHONY: all
all: $(GENS)
js: $(JS)
.PHONY: clean
clean:
rm -rf gen
rm -rf node_modules
rm -rf package-lock.json
gen/c/%.capnp.c: %.capnp
@echo "[ CAPNPC C ] $@"
mkdir -p gen/c/
$(CAPNPC) '$<' -o c:gen/c/
gen/js/%.capnp.js: %.capnp
@echo "[ CAPNPC JavaScript ] $@"
mkdir -p gen/js/
sh ./generate_javascript.sh
gen/cpp/%.capnp.c++: %.capnp
@echo "[ CAPNPC C++ ] $@"
mkdir -p gen/cpp/
$(CAPNPC) '$<' -o c++:gen/cpp/
gen/java/Car.java gen/java/Log.java: $(SRCS)
@echo "[ CAPNPC java ] $@"
mkdir -p gen/java/
$(CAPNPC) $^ -o java:gen/java
# c-capnproto needs some empty headers
gen/c/include/c++.capnp.h gen/c/include/java.capnp.h:
mkdir -p gen/c/include
touch '$@'
-42
View File
@@ -1,42 +0,0 @@
What is cereal?
----
cereal is both a messaging spec for robotics systems as well as generic high performance IPC pub sub messaging with a single publisher and multiple subscribers.
Imagine this use case:
* A sensor process reads gyro measurements directly from an IMU and publishes a sensorEvents packet
* A calibration process subscribes to the sensorEvents packet to use the IMU
* A localization process subscribes to the sensorEvents packet to use the IMU also
Messaging Spec
----
You'll find the message types in [log.capnp](log.capnp). It uses [Cap'n proto](https://capnproto.org/capnp-tool.html) and defines one struct called Event.
All Events have a logMonoTime and a valid. Then a big union defines the packet type.
Pub Sub Backends
----
cereal supports two backends, one based on [zmq](https://zeromq.org/), the other called msgq, a custom pub sub based on shared memory that doesn't require the bytes to pass through the kernel.
Example
---
```python
import cereal.messaging as messaging
# in subscriber
sm = messaging.SubMaster(['sensorEvents'])
while 1:
sm.update()
print(sm['sensorEvents'])
# in publisher
pm = messaging.PubMaster(['sensorEvents'])
dat = messaging.new_message()
dat.init('sensorEvents', 1)
dat.sensorEvents[0] = {"gyro": {"v": [0.1, -0.1, 0.1]}}
pm.send('sensorEvents', dat)
```
-68
View File
@@ -1,68 +0,0 @@
Import('env', 'arch', 'zmq')
gen_dir = Dir('gen')
messaging_dir = Dir('messaging')
# TODO: remove src-prefix and cereal from command string. can we set working directory?
env.Command(["gen/c/include/c++.capnp.h", "gen/c/include/java.capnp.h"], [], "mkdir -p " + gen_dir.path + "/c/include && touch $TARGETS")
env.Command(
['gen/c/car.capnp.c', 'gen/c/log.capnp.c', 'gen/c/car.capnp.h', 'gen/c/log.capnp.h'],
['car.capnp', 'log.capnp'],
'capnpc $SOURCES --src-prefix=cereal -o c:' + gen_dir.path + '/c/')
env.Command(
['gen/cpp/car.capnp.c++', 'gen/cpp/log.capnp.c++', 'gen/cpp/car.capnp.h', 'gen/cpp/log.capnp.h'],
['car.capnp', 'log.capnp'],
'capnpc $SOURCES --src-prefix=cereal -o c++:' + gen_dir.path + '/cpp/')
import shutil
if shutil.which('capnpc-java'):
env.Command(
['gen/java/Car.java', 'gen/java/Log.java'],
['car.capnp', 'log.capnp'],
'capnpc $SOURCES --src-prefix=cereal -o java:' + gen_dir.path + '/java/')
# TODO: remove non shared cereal and messaging
cereal_objects = env.SharedObject([
'gen/c/car.capnp.c',
'gen/c/log.capnp.c',
'gen/cpp/car.capnp.c++',
'gen/cpp/log.capnp.c++',
])
env.Library('cereal', cereal_objects)
env.SharedLibrary('cereal_shared', cereal_objects, LIBS=["capnp_c"])
cereal_dir = Dir('.')
services_h = env.Command(
['services.h'],
['service_list.yaml', 'services.py'],
'python3 ' + cereal_dir.path + '/services.py > $TARGET')
messaging_objects = env.SharedObject([
'messaging/messaging.cc',
'messaging/impl_zmq.cc',
'messaging/impl_msgq.cc',
'messaging/msgq.cc',
])
messaging_lib = env.Library('messaging', messaging_objects)
Depends('messaging/impl_zmq.cc', services_h)
# note, this rebuilds the deps shared, zmq is statically linked to make APK happy
# TODO: get APK to load system zmq to remove the static link
shared_lib_shared_lib = [zmq, 'm', 'stdc++'] + ["gnustl_shared"] if arch == "aarch64" else [zmq]
env.SharedLibrary('messaging_shared', messaging_objects, LIBS=shared_lib_shared_lib)
env.Program('messaging/bridge', ['messaging/bridge.cc'], LIBS=[messaging_lib, 'zmq'])
Depends('messaging/bridge.cc', services_h)
# different target?
#env.Program('messaging/demo', ['messaging/demo.cc'], LIBS=[messaging_lib, 'zmq'])
env.Command(['messaging/messaging_pyx.so'],
[messaging_lib, 'messaging/messaging_pyx_setup.py', 'messaging/messaging_pyx.pyx', 'messaging/messaging.pxd'],
"cd " + messaging_dir.path + " && python3 messaging_pyx_setup.py build_ext --inplace")
if GetOption('test'):
env.Program('messaging/test_runner', ['messaging/test_runner.cc', 'messaging/msgq_tests.cc'], LIBS=[messaging_lib])
-49
View File
@@ -1,49 +0,0 @@
import os
import subprocess
zmq = 'zmq'
arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
cereal_dir = Dir('.')
cpppath = [
cereal_dir,
'/usr/lib/include',
]
AddOption('--test',
action='store_true',
help='build test files')
AddOption('--asan',
action='store_true',
help='turn on ASAN')
ccflags_asan = ["-fsanitize=address", "-fno-omit-frame-pointer"] if GetOption('asan') else []
ldflags_asan = ["-fsanitize=address"] if GetOption('asan') else []
env = Environment(
ENV=os.environ,
CC='clang',
CXX='clang++',
CCFLAGS=[
"-g",
"-fPIC",
"-O2",
"-Werror=implicit-function-declaration",
"-Werror=incompatible-pointer-types",
"-Werror=int-conversion",
"-Werror=return-type",
"-Werror=format-extra-args",
] + ccflags_asan,
LDFLAGS=ldflags_asan,
LINKFLAGS=ldflags_asan,
CFLAGS="-std=gnu11",
CXXFLAGS="-std=c++14",
CPPPATH=cpppath,
)
Export('env', 'zmq', 'arch')
SConscript(['SConscript'])
-14
View File
@@ -1,14 +0,0 @@
pr: none
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: |
set -e
docker build -t cereal .
docker run cereal bash -c "scons --test --asan -j$(nproc) && messaging/test_runner"
docker run cereal bash -c "ZMQ=1 python -m unittest discover ."
docker run cereal bash -c "MSGQ=1 python -m unittest discover ."
displayName: 'Run Tests'
+10 -61
View File
@@ -84,21 +84,9 @@ struct CarEvent @0x9b1657f34caf3ad3 {
laneChange @59;
invalidGiraffeToyota @60;
internetConnectivityNeeded @61;
communityFeatureDisallowed @62;
lowMemory @63;
stockAeb @64;
ldw @65;
carUnrecognized @66;
radarCommIssue @67;
driverMonitorLowAcc @68;
# dragonpilot
manualSteeringRequired @69;
manualSteeringRequiredBlinkersOn @70;
leadCarMoving @71;
leadCarDetected @72;
preAutoLaneChangeLeft @73;
preAutoLaneChangeRight @74;
autoLaneChange @75;
manualSteeringRequired @62;
manualSteeringRequiredBlinkersOn @63;
leadCarMoving @64;
}
}
@@ -132,9 +120,6 @@ struct CarState {
steeringTorque @8 :Float32; # TODO: standardize units
steeringTorqueEps @27 :Float32; # TODO: standardize units
steeringPressed @9 :Bool; # if the user is using the steering wheel
steeringRateLimited @29 :Bool; # if the torque is limited by the rate limiter
stockAeb @30 :Bool;
stockFcw @31 :Bool;
# cruise state
cruiseState @10 :CruiseState;
@@ -188,6 +173,7 @@ struct CarState {
manumatic @9;
}
# send on change
struct ButtonEvent {
pressed @0 :Bool;
@@ -331,7 +317,7 @@ struct CarParams {
minEnableSpeed @7 :Float32;
minSteerSpeed @8 :Float32;
safetyModel @9 :SafetyModel;
safetyModelPassive @42 :SafetyModel = silent;
safetyModelPassive @42 :SafetyModel = noOutput;
safetyParam @10 :Int16;
steerMaxBP @11 :List(Float32);
@@ -341,6 +327,7 @@ struct CarParams {
brakeMaxBP @15 :List(Float32);
brakeMaxV @16 :List(Float32);
# things about the car in the manual
mass @17 :Float32; # [kg] running weight
wheelbase @18 :Float32; # [m] distance from rear to front axle
@@ -354,7 +341,6 @@ struct CarParams {
tireStiffnessRear @24 :Float32; # [N/rad] rear tire coeff of stiff
longitudinalTuning @25 :LongitudinalPIDTuning;
lateralParams @48 :LateralParams;
lateralTuning :union {
pid @26 :LateralPIDTuning;
indi @27 :LateralINDITuning;
@@ -362,7 +348,6 @@ struct CarParams {
}
steerLimitAlert @28 :Bool;
steerLimitTimer @47 :Float32; # time before steerLimitAlert is issued
vEgoStopping @29 :Float32; # Speed at which the car goes into stopping state
directAccelControl @30 :Bool; # Does the car have direct accel control or just gas/brake
@@ -378,15 +363,6 @@ struct CarParams {
isPandaBlack @39: Bool;
dashcamOnly @41: Bool;
transmissionType @43 :TransmissionType;
carFw @44 :List(CarFw);
radarTimeStep @45: Float32 = 0.05; # time delta between radar updates, 20Hz is very standard
communityFeature @46: Bool; # true if a community maintained feature is detected
fingerprintSource @49: FingerprintSource;
struct LateralParams {
torqueBP @0 :List(Int32);
torqueV @1 :List(Int32);
}
struct LateralPIDTuning {
kpBP @0 :List(Float32);
@@ -405,6 +381,7 @@ struct CarParams {
deadzoneV @5 :List(Float32);
}
struct LateralINDITuning {
outerLoopGain @0 :Float32;
innerLoopGain @1 :Float32;
@@ -427,12 +404,12 @@ struct CarParams {
}
enum SafetyModel {
silent @0;
hondaNidec @1;
noOutput @0;
honda @1;
toyota @2;
elm327 @3;
gm @4;
hondaBoschGiraffe @5;
hondaBosch @5;
ford @6;
cadillac @7;
hyundai @8;
@@ -446,9 +423,6 @@ struct CarParams {
toyotaIpas @16;
allOutput @17;
gmAscm @18;
noOutput @19; # like silent but without silent CAN TXs
hondaBoschHarness @20;
volkswagenPq @21;
}
enum SteerControlType {
@@ -461,29 +435,4 @@ struct CarParams {
automatic @1;
manual @2;
}
struct CarFw {
ecu @0 :Ecu;
fwVersion @1 :Data;
address @2: UInt32;
subAddress @3: UInt8;
}
enum Ecu {
eps @0;
esp @1;
fwdRadar @2;
fwdCamera @3;
engine @4;
unknown @5;
# Toyota only
dsu @6;
apgs @7;
}
enum FingerprintSource {
can @0;
fw @1;
}
}
+3 -4
View File
@@ -8,8 +8,7 @@ tar xvf capnproto-c++-${VERSION}.tar.gz
cd capnproto-c++-${VERSION}
CXXFLAGS="-fPIC" ./configure
make -j$(nproc)
make install
make -j4
# manually build binaries statically
g++ -std=gnu++11 -I./src -I./src -DKJ_HEADER_WARNINGS -DCAPNP_HEADER_WARNINGS -DCAPNP_INCLUDE_DIR=\"/usr/local/include\" -pthread -O2 -DNDEBUG -pthread -pthread -o .libs/capnp src/capnp/compiler/module-loader.o src/capnp/compiler/capnp.o ./.libs/libcapnpc.a ./.libs/libcapnp.a ./.libs/libkj.a -lpthread -pthread
@@ -19,6 +18,7 @@ g++ -std=gnu++11 -I./src -I./src -DKJ_HEADER_WARNINGS -DCAPNP_HEADER_WARNINGS -D
g++ -std=gnu++11 -I./src -I./src -DKJ_HEADER_WARNINGS -DCAPNP_HEADER_WARNINGS -DCAPNP_INCLUDE_DIR=\"/usr/local/include\" -pthread -O2 -DNDEBUG -pthread -pthread -o .libs/capnpc-capnp src/capnp/compiler/capnpc-capnp.o ./.libs/libcapnp.a ./.libs/libkj.a -lpthread -pthread
cp .libs/capnp /usr/local/bin/
ln -s /usr/local/bin/capnp /usr/local/bin/capnpc
cp .libs/capnpc-c++ /usr/local/bin/
cp .libs/capnpc-capnp /usr/local/bin/
cp .libs/*.a /usr/local/lib
@@ -30,8 +30,7 @@ cd c-capnproto
git submodule update --init --recursive
autoreconf -f -i -s
CXXFLAGS="-fPIC" ./configure
make -j$(nproc)
make install
make -j4
# manually build binaries statically
gcc -fPIC -o .libs/capnpc-c compiler/capnpc-c.o compiler/schema.capnp.o compiler/str.o ./.libs/libcapnp_c.a
+5 -106
View File
@@ -126,7 +126,6 @@ struct FrameData {
lensErr @13 :Float32;
lensTruePos @14 :Float32;
image @6 :Data;
gainFrac @15 :Float32;
frameType @7 :FrameType;
timestampSof @8 :UInt64;
@@ -138,7 +137,6 @@ struct FrameData {
unknown @0;
neo @1;
chffrAndroid @2;
front @3;
}
struct AndroidCaptureResult {
@@ -270,7 +268,6 @@ struct ThermalData {
mem @4 :UInt16;
gpu @5 :UInt16;
bat @6 :UInt32;
pa0 @21 :UInt16;
# not thermal
freeSpace @7 :Float32;
@@ -279,7 +276,6 @@ struct ThermalData {
batteryCurrent @15 :Int32;
batteryVoltage @16 :Int32;
usbOnline @12 :Bool;
networkType @22 :NetworkType;
fanSpeed @10 :UInt16;
started @11 :Bool;
@@ -288,11 +284,7 @@ struct ThermalData {
thermalStatus @14 :ThermalStatus;
chargingError @17 :Bool;
chargingDisabled @18 :Bool;
memUsedPercent @19 :Int8;
cpuPerc @20 :Int8;
ipAddr @23 :Text; # dragonpilot
ipAddr @19 :Text;
enum ThermalStatus {
green @0; # all processes run
@@ -300,49 +292,23 @@ struct ThermalData {
red @2; # no engage, will disengage
danger @3; # immediate process shutdown
}
enum NetworkType {
none @0;
wifi @1;
cell2G @2;
cell3G @3;
cell4G @4;
cell5G @5;
}
}
struct HealthData {
# from can health
voltage @0 :UInt32;
current @1 :UInt32;
ignitionLine @2 :Bool;
started @2 :Bool;
controlsAllowed @3 :Bool;
gasInterceptorDetected @4 :Bool;
startedSignalDetectedDeprecated @5 :Bool;
hasGps @6 :Bool;
canSendErrs @7 :UInt32;
canFwdErrs @8 :UInt32;
canRxErrs @19 :UInt32;
gmlanSendErrs @9 :UInt32;
hwType @10 :HwType;
fanSpeedRpm @11 :UInt16;
usbPowerMode @12 :UsbPowerMode;
ignitionCan @13 :Bool;
safetyModel @14 :Car.CarParams.SafetyModel;
faultStatus @15 :FaultStatus;
powerSaveEnabled @16 :Bool;
uptime @17 :UInt32;
faults @18 :List(FaultType);
enum FaultStatus {
none @0;
faultTemp @1;
faultPerm @2;
}
enum FaultType {
relayMalfunction @0;
}
enum HwType {
unknown @0;
@@ -497,7 +463,6 @@ struct ControlsState @0x97ff69c53601abf1 {
decelForTurn @47 :Bool;
decelForModel @54 :Bool;
canErrorCounter @57 :UInt32;
lateralControlState :union {
indiState @52 :LateralINDIState;
@@ -543,7 +508,6 @@ struct ControlsState @0x97ff69c53601abf1 {
delayedOutput @7 :Float32;
delta @8 :Float32;
output @9 :Float32;
saturated @10 :Bool;
}
struct LateralPIDState {
@@ -564,7 +528,6 @@ struct ControlsState @0x97ff69c53601abf1 {
i @2 :Float32;
output @3 :Float32;
lqrOutput @4 :Float32;
saturated @5 :Bool;
}
@@ -588,8 +551,6 @@ struct ModelData {
settings @5 :ModelSettings;
leadFuture @7 :LeadData;
speed @8 :List(Float32);
meta @10 :MetaData;
longitudinal @11 :LongitudinalData;
struct PathData {
points @0 :List(Float32);
@@ -620,19 +581,6 @@ struct ModelData {
yuvCorrection @5 :List(Float32);
inputTransform @6 :List(Float32);
}
struct MetaData {
engagedProb @0 :Float32;
desirePrediction @1 :List(Float32);
brakeDisengageProb @2 :Float32;
gasDisengageProb @3 :Float32;
steerOverrideProb @4 :Float32;
}
struct LongitudinalData {
speeds @0 :List(Float32);
accelerations @1 :List(Float32);
}
}
struct CalibrationFeatures {
@@ -766,8 +714,6 @@ struct PathPlan {
desire @17 :Desire;
laneChangeState @18 :LaneChangeState;
laneChangeDirection @19 :LaneChangeDirection;
# dragonpilot
autoLCAllowed @20 :Bool;
enum Desire {
none @0;
@@ -1436,7 +1382,6 @@ struct UbloxGnss {
measurementReport @0 :MeasurementReport;
ephemeris @1 :Ephemeris;
ionoData @2 :IonoData;
hwStatus @3 :HwStatus;
}
struct MeasurementReport {
@@ -1560,30 +1505,9 @@ struct UbloxGnss {
healthValid @5 :Bool;
ionoCoeffsValid @6 :Bool;
}
struct HwStatus {
noisePerMS @0 :UInt16;
agcCnt @1 :UInt16;
aStatus @2 :AntennaSupervisorState;
aPower @3 :AntennaPowerStatus;
jamInd @4 :UInt8;
enum AntennaSupervisorState {
init @0;
dontknow @1;
ok @2;
short @3;
open @4;
}
enum AntennaPowerStatus {
off @0;
on @1;
dontknow @2;
}
}
}
struct Clocks {
bootTimeNanos @0 :UInt64;
monotonicNanos @1 :UInt64;
@@ -1724,7 +1648,6 @@ struct UiLayoutState {
home @0;
music @1;
nav @2;
settings @3;
}
}
@@ -1790,7 +1713,7 @@ struct OrbKeyFrame {
descriptors @3 :Data;
}
struct DriverState {
struct DriverMonitoring {
frameId @0 :UInt32;
descriptorDEPRECATED @1 :List(Float32);
stdDEPRECATED @2 :Float32;
@@ -1801,28 +1724,6 @@ struct DriverState {
rightEyeProb @7 :Float32;
leftBlinkProb @8 :Float32;
rightBlinkProb @9 :Float32;
irPwrDEPRECATED @10 :Float32;
faceOrientationStd @11 :List(Float32);
facePositionStd @12 :List(Float32);
}
struct DMonitoringState {
# TODO: deprecate old fields in controlsState
events @0 :List(Car.CarEvent);
faceDetected @1 :Bool;
isDistracted @2 :Bool;
awarenessStatus @3 :Float32;
isRHD @4 :Bool;
rhdChecked @5 :Bool;
posePitchOffset @6 :Float32;
posePitchValidCount @7 :UInt32;
poseYawOffset @8 :Float32;
poseYawValidCount @9 :UInt32;
stepChange @10 :Float32;
awarenessActive @11 :Float32;
awarenessPassive @12 :Float32;
isLowStd @13 :Bool;
hiStdCount @14 :UInt32;
}
struct Boot {
@@ -1944,7 +1845,7 @@ struct Event {
orbKeyFrame @56 :OrbKeyFrame;
uiLayoutState @57 :UiLayoutState;
orbFeaturesSummary @58 :OrbFeaturesSummary;
driverState @59 :DriverState;
driverMonitoring @59 :DriverMonitoring;
boot @60 :Boot;
liveParameters @61 :LiveParametersData;
liveMapData @62 :LiveMapData;
@@ -1954,7 +1855,5 @@ struct Event {
thumbnail @66: Thumbnail;
carEvents @68: List(Car.CarEvent);
carParams @69: Car.CarParams;
frontFrame @70: FrameData;
dMonitoringState @71: DMonitoringState;
}
}
-10
View File
@@ -1,10 +0,0 @@
demo
bridge
test_runner
*.o
*.os
*.d
*.a
*.so
messaging_pyx.cpp
build/
-64
View File
@@ -1,64 +0,0 @@
#include <iostream>
#include <string>
#include <cassert>
#include <csignal>
#include <map>
typedef void (*sighandler_t)(int sig);
#include "services.h"
#include "impl_msgq.hpp"
#include "impl_zmq.hpp"
void sigpipe_handler(int sig) {
assert(sig == SIGPIPE);
std::cout << "SIGPIPE received" << std::endl;
}
static std::vector<std::string> get_services() {
std::vector<std::string> name_list;
for (const auto& it : services) {
std::string name = it.name;
if (name == "plusFrame" || name == "uiLayoutState") continue;
name_list.push_back(name);
}
return name_list;
}
int main(void){
signal(SIGPIPE, (sighandler_t)sigpipe_handler);
auto endpoints = get_services();
std::map<SubSocket*, PubSocket*> sub2pub;
Context *zmq_context = new ZMQContext();
Context *msgq_context = new MSGQContext();
Poller *poller = new MSGQPoller();
for (auto endpoint: endpoints){
SubSocket * msgq_sock = new MSGQSubSocket();
msgq_sock->connect(msgq_context, endpoint, "127.0.0.1", false);
poller->registerSocket(msgq_sock);
PubSocket * zmq_sock = new ZMQPubSocket();
zmq_sock->connect(zmq_context, endpoint);
sub2pub[msgq_sock] = zmq_sock;
}
while (true){
for (auto sub_sock : poller->poll(100)){
Message * msg = sub_sock->receive();
if (msg == NULL) continue;
sub2pub[sub_sock]->sendMessage(msg);
delete msg;
}
}
return 0;
}
File diff suppressed because it is too large Load Diff
-50
View File
@@ -1,50 +0,0 @@
#include <iostream>
#include <cstddef>
#include <chrono>
#include <thread>
#include <cassert>
#include "messaging.hpp"
#include "impl_zmq.hpp"
#define MSGS 1e5
int main() {
Context * c = Context::create();
SubSocket * sub_sock = SubSocket::create(c, "controlsState");
PubSocket * pub_sock = PubSocket::create(c, "controlsState");
char data[8];
Poller * poller = Poller::create({sub_sock});
auto start = std::chrono::steady_clock::now();
for (uint64_t i = 0; i < MSGS; i++){
*(uint64_t*)data = i;
pub_sock->send(data, 8);
auto r = poller->poll(100);
for (auto p : r){
Message * m = p->receive();
uint64_t ii = *(uint64_t*)m->getData();
assert(i == ii);
delete m;
}
}
auto end = std::chrono::steady_clock::now();
double elapsed = std::chrono::duration_cast<std::chrono::nanoseconds>(end - start).count() / 1e9;
double throughput = ((double) MSGS / (double) elapsed);
std::cout << throughput << " msg/s" << std::endl;
delete poller;
delete sub_sock;
delete pub_sock;
delete c;
return 0;
}
-30
View File
@@ -1,30 +0,0 @@
import time
from messaging_pyx import Context, Poller, SubSocket, PubSocket # pylint: disable=no-name-in-module, import-error
MSGS = 1e5
if __name__ == "__main__":
c = Context()
sub_sock = SubSocket()
pub_sock = PubSocket()
sub_sock.connect(c, "controlsState")
pub_sock.connect(c, "controlsState")
poller = Poller()
poller.registerSocket(sub_sock)
t = time.time()
for i in range(int(MSGS)):
bts = i.to_bytes(4, 'little')
pub_sock.send(bts)
for s in poller.poll(100):
dat = s.receive()
ii = int.from_bytes(dat, 'little')
assert(i == ii)
dt = time.time() - t
print("%.1f msg/s" % (MSGS / dt))
-195
View File
@@ -1,195 +0,0 @@
#include <cassert>
#include <cstring>
#include <iostream>
#include <cstdlib>
#include <csignal>
#include <cerrno>
#include "impl_msgq.hpp"
volatile sig_atomic_t msgq_do_exit = 0;
void sig_handler(int signal) {
assert(signal == SIGINT || signal == SIGTERM);
msgq_do_exit = 1;
}
MSGQContext::MSGQContext() {
}
MSGQContext::~MSGQContext() {
}
void MSGQMessage::init(size_t sz) {
size = sz;
data = new char[size];
}
void MSGQMessage::init(char * d, size_t sz) {
size = sz;
data = new char[size];
memcpy(data, d, size);
}
void MSGQMessage::takeOwnership(char * d, size_t sz) {
size = sz;
data = d;
}
void MSGQMessage::close() {
if (size > 0){
delete[] data;
}
size = 0;
}
MSGQMessage::~MSGQMessage() {
this->close();
}
int MSGQSubSocket::connect(Context *context, std::string endpoint, std::string address, bool conflate){
assert(context);
assert(address == "127.0.0.1");
q = new msgq_queue_t;
int r = msgq_new_queue(q, endpoint.c_str(), DEFAULT_SEGMENT_SIZE);
if (r != 0){
return r;
}
msgq_init_subscriber(q);
if (conflate){
q->read_conflate = true;
}
timeout = -1;
return 0;
}
Message * MSGQSubSocket::receive(bool non_blocking){
msgq_do_exit = 0;
void (*prev_handler_sigint)(int);
void (*prev_handler_sigterm)(int);
if (!non_blocking){
prev_handler_sigint = std::signal(SIGINT, sig_handler);
prev_handler_sigterm = std::signal(SIGTERM, sig_handler);
}
msgq_msg_t msg;
MSGQMessage *r = NULL;
int rc = msgq_msg_recv(&msg, q);
// Hack to implement blocking read with a poller. Don't use this
while (!non_blocking && rc == 0 && msgq_do_exit == 0){
msgq_pollitem_t items[1];
items[0].q = q;
int t = (timeout != -1) ? timeout : 100;
int n = msgq_poll(items, 1, t);
rc = msgq_msg_recv(&msg, q);
// The poll indicated a message was ready, but the receive failed. Try again
if (n == 1 && rc == 0){
continue;
}
if (timeout != -1){
break;
}
}
if (!non_blocking){
std::signal(SIGINT, prev_handler_sigint);
std::signal(SIGTERM, prev_handler_sigterm);
}
errno = msgq_do_exit ? EINTR : 0;
if (rc > 0){
if (msgq_do_exit){
msgq_msg_close(&msg); // Free unused message on exit
} else {
r = new MSGQMessage;
r->takeOwnership(msg.data, msg.size);
}
}
return (Message*)r;
}
void MSGQSubSocket::setTimeout(int t){
timeout = t;
}
MSGQSubSocket::~MSGQSubSocket(){
if (q != NULL){
msgq_close_queue(q);
delete q;
}
}
int MSGQPubSocket::connect(Context *context, std::string endpoint){
assert(context);
q = new msgq_queue_t;
msgq_new_queue(q, endpoint.c_str(), DEFAULT_SEGMENT_SIZE);
msgq_init_publisher(q);
return 0;
}
int MSGQPubSocket::sendMessage(Message *message){
msgq_msg_t msg;
msg.data = message->getData();
msg.size = message->getSize();
return msgq_msg_send(&msg, q);
}
int MSGQPubSocket::send(char *data, size_t size){
msgq_msg_t msg;
msg.data = data;
msg.size = size;
return msgq_msg_send(&msg, q);
}
MSGQPubSocket::~MSGQPubSocket(){
if (q != NULL){
msgq_close_queue(q);
delete q;
}
}
void MSGQPoller::registerSocket(SubSocket * socket){
assert(num_polls + 1 < MAX_POLLERS);
polls[num_polls].q = (msgq_queue_t*)socket->getRawSocket();
sockets.push_back(socket);
num_polls++;
}
std::vector<SubSocket*> MSGQPoller::poll(int timeout){
std::vector<SubSocket*> r;
msgq_poll(polls, num_polls, timeout);
for (size_t i = 0; i < num_polls; i++){
if (polls[i].revents){
r.push_back(sockets[i]);
}
}
return r;
}
-64
View File
@@ -1,64 +0,0 @@
#pragma once
#include "messaging.hpp"
#include "msgq.hpp"
#include <zmq.h>
#include <string>
#define MAX_POLLERS 128
class MSGQContext : public Context {
private:
void * context = NULL;
public:
MSGQContext();
void * getRawContext() {return context;}
~MSGQContext();
};
class MSGQMessage : public Message {
private:
char * data;
size_t size;
public:
void init(size_t size);
void init(char *data, size_t size);
void takeOwnership(char *data, size_t size);
size_t getSize(){return size;}
char * getData(){return data;}
void close();
~MSGQMessage();
};
class MSGQSubSocket : public SubSocket {
private:
msgq_queue_t * q = NULL;
int timeout;
public:
int connect(Context *context, std::string endpoint, std::string address, bool conflate=false);
void setTimeout(int timeout);
void * getRawSocket() {return (void*)q;}
Message *receive(bool non_blocking=false);
~MSGQSubSocket();
};
class MSGQPubSocket : public PubSocket {
private:
msgq_queue_t * q = NULL;
public:
int connect(Context *context, std::string endpoint);
int sendMessage(Message *message);
int send(char *data, size_t size);
~MSGQPubSocket();
};
class MSGQPoller : public Poller {
private:
std::vector<SubSocket*> sockets;
msgq_pollitem_t polls[MAX_POLLERS];
size_t num_polls = 0;
public:
void registerSocket(SubSocket *socket);
std::vector<SubSocket*> poll(int timeout);
~MSGQPoller(){};
};
-155
View File
@@ -1,155 +0,0 @@
#include <cassert>
#include <cstring>
#include <iostream>
#include <cstdlib>
#include <cerrno>
#include <zmq.h>
#include "services.h"
#include "impl_zmq.hpp"
static int get_port(std::string endpoint) {
int port = -1;
for (const auto& it : services) {
std::string name = it.name;
if (name == endpoint) {
port = it.port;
break;
}
}
assert(port >= 0);
return port;
}
ZMQContext::ZMQContext() {
context = zmq_ctx_new();
}
ZMQContext::~ZMQContext() {
zmq_ctx_term(context);
}
void ZMQMessage::init(size_t sz) {
size = sz;
data = new char[size];
}
void ZMQMessage::init(char * d, size_t sz) {
size = sz;
data = new char[size];
memcpy(data, d, size);
}
void ZMQMessage::close() {
if (size > 0){
delete[] data;
}
size = 0;
}
ZMQMessage::~ZMQMessage() {
this->close();
}
int ZMQSubSocket::connect(Context *context, std::string endpoint, std::string address, bool conflate){
sock = zmq_socket(context->getRawContext(), ZMQ_SUB);
if (sock == NULL){
return -1;
}
zmq_setsockopt(sock, ZMQ_SUBSCRIBE, "", 0);
if (conflate){
int arg = 1;
zmq_setsockopt(sock, ZMQ_CONFLATE, &arg, sizeof(int));
}
int reconnect_ivl = 500;
zmq_setsockopt(sock, ZMQ_RECONNECT_IVL_MAX, &reconnect_ivl, sizeof(reconnect_ivl));
full_endpoint = "tcp://" + address + ":";
full_endpoint += std::to_string(get_port(endpoint));
return zmq_connect(sock, full_endpoint.c_str());
}
Message * ZMQSubSocket::receive(bool non_blocking){
zmq_msg_t msg;
assert(zmq_msg_init(&msg) == 0);
int flags = non_blocking ? ZMQ_DONTWAIT : 0;
int rc = zmq_msg_recv(&msg, sock, flags);
Message *r = NULL;
if (rc >= 0){
// Make a copy to ensure the data is aligned
r = new ZMQMessage;
r->init((char*)zmq_msg_data(&msg), zmq_msg_size(&msg));
}
zmq_msg_close(&msg);
return r;
}
void ZMQSubSocket::setTimeout(int timeout){
zmq_setsockopt(sock, ZMQ_RCVTIMEO, &timeout, sizeof(int));
}
ZMQSubSocket::~ZMQSubSocket(){
zmq_close(sock);
}
int ZMQPubSocket::connect(Context *context, std::string endpoint){
sock = zmq_socket(context->getRawContext(), ZMQ_PUB);
if (sock == NULL){
return -1;
}
full_endpoint = "tcp://*:";
full_endpoint += std::to_string(get_port(endpoint));
return zmq_bind(sock, full_endpoint.c_str());
}
int ZMQPubSocket::sendMessage(Message *message){
return zmq_send(sock, message->getData(), message->getSize(), ZMQ_DONTWAIT);
}
int ZMQPubSocket::send(char *data, size_t size){
return zmq_send(sock, data, size, ZMQ_DONTWAIT);
}
ZMQPubSocket::~ZMQPubSocket(){
zmq_close(sock);
}
void ZMQPoller::registerSocket(SubSocket * socket){
assert(num_polls + 1 < MAX_POLLERS);
polls[num_polls].socket = socket->getRawSocket();
polls[num_polls].events = ZMQ_POLLIN;
sockets.push_back(socket);
num_polls++;
}
std::vector<SubSocket*> ZMQPoller::poll(int timeout){
std::vector<SubSocket*> r;
int rc = zmq_poll(polls, num_polls, timeout);
if (rc < 0){
return r;
}
for (size_t i = 0; i < num_polls; i++){
if (polls[i].revents){
r.push_back(sockets[i]);
}
}
return r;
}
-63
View File
@@ -1,63 +0,0 @@
#pragma once
#include "messaging.hpp"
#include <zmq.h>
#include <string>
#define MAX_POLLERS 128
class ZMQContext : public Context {
private:
void * context = NULL;
public:
ZMQContext();
void * getRawContext() {return context;}
~ZMQContext();
};
class ZMQMessage : public Message {
private:
char * data;
size_t size;
public:
void init(size_t size);
void init(char *data, size_t size);
size_t getSize(){return size;}
char * getData(){return data;}
void close();
~ZMQMessage();
};
class ZMQSubSocket : public SubSocket {
private:
void * sock;
std::string full_endpoint;
public:
int connect(Context *context, std::string endpoint, std::string address, bool conflate=false);
void setTimeout(int timeout);
void * getRawSocket() {return sock;}
Message *receive(bool non_blocking=false);
~ZMQSubSocket();
};
class ZMQPubSocket : public PubSocket {
private:
void * sock;
std::string full_endpoint;
public:
int connect(Context *context, std::string endpoint);
int sendMessage(Message *message);
int send(char *data, size_t size);
~ZMQPubSocket();
};
class ZMQPoller : public Poller {
private:
std::vector<SubSocket*> sockets;
zmq_pollitem_t polls[MAX_POLLERS];
size_t num_polls = 0;
public:
void registerSocket(SubSocket *socket);
std::vector<SubSocket*> poll(int timeout);
~ZMQPoller(){};
};
-117
View File
@@ -1,117 +0,0 @@
#include "messaging.hpp"
#include "impl_zmq.hpp"
#include "impl_msgq.hpp"
Context * Context::create(){
Context * c;
if (std::getenv("ZMQ")){
c = new ZMQContext();
} else {
c = new MSGQContext();
}
return c;
}
SubSocket * SubSocket::create(){
SubSocket * s;
if (std::getenv("ZMQ")){
s = new ZMQSubSocket();
} else {
s = new MSGQSubSocket();
}
return s;
}
SubSocket * SubSocket::create(Context * context, std::string endpoint){
SubSocket *s = SubSocket::create();
int r = s->connect(context, endpoint, "127.0.0.1");
if (r == 0) {
return s;
} else {
delete s;
return NULL;
}
}
SubSocket * SubSocket::create(Context * context, std::string endpoint, std::string address){
SubSocket *s = SubSocket::create();
int r = s->connect(context, endpoint, address);
if (r == 0) {
return s;
} else {
delete s;
return NULL;
}
}
SubSocket * SubSocket::create(Context * context, std::string endpoint, std::string address, bool conflate){
SubSocket *s = SubSocket::create();
int r = s->connect(context, endpoint, address, conflate);
if (r == 0) {
return s;
} else {
delete s;
return NULL;
}
}
PubSocket * PubSocket::create(){
PubSocket * s;
if (std::getenv("ZMQ")){
s = new ZMQPubSocket();
} else {
s = new MSGQPubSocket();
}
return s;
}
PubSocket * PubSocket::create(Context * context, std::string endpoint){
PubSocket *s = PubSocket::create();
int r = s->connect(context, endpoint);
if (r == 0) {
return s;
} else {
delete s;
return NULL;
}
}
Poller * Poller::create(){
Poller * p;
if (std::getenv("ZMQ")){
p = new ZMQPoller();
} else {
p = new MSGQPoller();
}
return p;
}
Poller * Poller::create(std::vector<SubSocket*> sockets){
Poller * p = Poller::create();
for (auto s : sockets){
p->registerSocket(s);
}
return p;
}
extern "C" Context * messaging_context_create() {
return Context::create();
}
extern "C" SubSocket * messaging_subsocket_create(Context* context, const char* endpoint) {
return SubSocket::create(context, std::string(endpoint));
}
extern "C" PubSocket * messaging_pubsocket_create(Context* context, const char* endpoint) {
return PubSocket::create(context, std::string(endpoint));
}
extern "C" Poller * messaging_poller_create(SubSocket** sockets, int size) {
std::vector<SubSocket*> socketsVec(sockets, sockets + size);
return Poller::create(socketsVec);
}
-56
View File
@@ -1,56 +0,0 @@
#pragma once
#include <cstddef>
#include <vector>
#include <string>
#define MSG_MULTIPLE_PUBLISHERS 100
class Context {
public:
virtual void * getRawContext() = 0;
static Context * create();
virtual ~Context(){};
};
class Message {
public:
virtual void init(size_t size) = 0;
virtual void init(char * data, size_t size) = 0;
virtual void close() = 0;
virtual size_t getSize() = 0;
virtual char * getData() = 0;
virtual ~Message(){};
};
class SubSocket {
public:
virtual int connect(Context *context, std::string endpoint, std::string address, bool conflate=false) = 0;
virtual void setTimeout(int timeout) = 0;
virtual Message *receive(bool non_blocking=false) = 0;
virtual void * getRawSocket() = 0;
static SubSocket * create();
static SubSocket * create(Context * context, std::string endpoint);
static SubSocket * create(Context * context, std::string endpoint, std::string address);
static SubSocket * create(Context * context, std::string endpoint, std::string address, bool conflate);
virtual ~SubSocket(){};
};
class PubSocket {
public:
virtual int connect(Context *context, std::string endpoint) = 0;
virtual int sendMessage(Message *message) = 0;
virtual int send(char *data, size_t size) = 0;
static PubSocket * create();
static PubSocket * create(Context * context, std::string endpoint);
virtual ~PubSocket(){};
};
class Poller {
public:
virtual void registerSocket(SubSocket *socket) = 0;
virtual std::vector<SubSocket*> poll(int timeout) = 0;
static Poller * create();
static Poller * create(std::vector<SubSocket*> sockets);
virtual ~Poller(){};
};
-39
View File
@@ -1,39 +0,0 @@
# distutils: language = c++
#cython: language_level=3
from libcpp.string cimport string
from libcpp.vector cimport vector
from libcpp cimport bool
cdef extern from "messaging.hpp":
cdef cppclass Context:
@staticmethod
Context * create()
cdef cppclass Message:
void init(size_t)
void init(char *, size_t)
void close()
size_t getSize()
char *getData()
cdef cppclass SubSocket:
@staticmethod
SubSocket * create()
int connect(Context *, string, string, bool)
Message * receive(bool)
void setTimeout(int)
cdef cppclass PubSocket:
@staticmethod
PubSocket * create()
int connect(Context *, string)
int sendMessage(Message *)
int send(char *, size_t)
cdef cppclass Poller:
@staticmethod
Poller * create()
void registerSocket(SubSocket *)
vector[SubSocket*] poll(int) nogil
-151
View File
@@ -1,151 +0,0 @@
# distutils: language = c++
# cython: c_string_encoding=ascii, language_level=3
import sys
from libcpp.string cimport string
from libcpp cimport bool
from libc cimport errno
from messaging cimport Context as cppContext
from messaging cimport SubSocket as cppSubSocket
from messaging cimport PubSocket as cppPubSocket
from messaging cimport Poller as cppPoller
from messaging cimport Message as cppMessage
class MessagingError(Exception):
pass
class MultiplePublishersError(MessagingError):
pass
cdef class Context:
cdef cppContext * context
def __cinit__(self):
self.context = cppContext.create()
def term(self):
del self.context
self.context = NULL
def __dealloc__(self):
pass
# Deleting the context will hang if sockets are still active
# TODO: Figure out a way to make sure the context is closed last
# del self.context
cdef class Poller:
cdef cppPoller * poller
cdef list sub_sockets
def __cinit__(self):
self.sub_sockets = []
self.poller = cppPoller.create()
def __dealloc__(self):
del self.poller
def registerSocket(self, SubSocket socket):
self.sub_sockets.append(socket)
self.poller.registerSocket(socket.socket)
def poll(self, timeout):
sockets = []
cdef int t = timeout
with nogil:
result = self.poller.poll(t)
for s in result:
socket = SubSocket()
socket.setPtr(s)
sockets.append(socket)
return sockets
cdef class SubSocket:
cdef cppSubSocket * socket
cdef bool is_owner
def __cinit__(self):
self.socket = cppSubSocket.create()
self.is_owner = True
if self.socket == NULL:
raise MessagingError
def __dealloc__(self):
if self.is_owner:
del self.socket
cdef setPtr(self, cppSubSocket * ptr):
if self.is_owner:
del self.socket
self.is_owner = False
self.socket = ptr
def connect(self, Context context, string endpoint, string address=b"127.0.0.1", bool conflate=False):
r = self.socket.connect(context.context, endpoint, address, conflate)
if r != 0:
if errno.errno == errno.EADDRINUSE:
raise MultiplePublishersError
else:
raise MessagingError
def setTimeout(self, int timeout):
self.socket.setTimeout(timeout)
def receive(self, bool non_blocking=False):
msg = self.socket.receive(non_blocking)
if msg == NULL:
# If a blocking read returns no message check errno if SIGINT was caught in the C++ code
if errno.errno == errno.EINTR:
print("SIGINT received, exiting")
sys.exit(1)
return None
else:
sz = msg.getSize()
m = msg.getData()[:sz]
del msg
return m
cdef class PubSocket:
cdef cppPubSocket * socket
def __cinit__(self):
self.socket = cppPubSocket.create()
if self.socket == NULL:
raise MessagingError
def __dealloc__(self):
del self.socket
def connect(self, Context context, string endpoint):
r = self.socket.connect(context.context, endpoint)
if r != 0:
if errno.errno == errno.EADDRINUSE:
raise MultiplePublishersError
else:
raise MessagingError
def send(self, string data):
length = len(data)
r = self.socket.send(<char*>data.c_str(), length)
if r != length:
if errno.errno == errno.EADDRINUSE:
raise MultiplePublishersError
else:
raise MessagingError
-56
View File
@@ -1,56 +0,0 @@
import os
import subprocess
import sysconfig
from distutils.core import Extension, setup # pylint: disable=import-error,no-name-in-module
from Cython.Build import cythonize
from Cython.Distutils import build_ext
def get_ext_filename_without_platform_suffix(filename):
name, ext = os.path.splitext(filename)
ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
if ext_suffix == ext:
return filename
ext_suffix = ext_suffix.replace(ext, '')
idx = name.find(ext_suffix)
if idx == -1:
return filename
else:
return name[:idx] + ext
class BuildExtWithoutPlatformSuffix(build_ext):
def get_ext_filename(self, ext_name):
filename = super().get_ext_filename(ext_name)
return get_ext_filename_without_platform_suffix(filename)
sourcefiles = ['messaging_pyx.pyx']
extra_compile_args = ["-std=c++11"]
libraries = ['zmq']
ARCH = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip() # pylint: disable=unexpected-keyword-arg
if ARCH == "aarch64":
extra_compile_args += ["-Wno-deprecated-register"]
libraries += ['gnustl_shared']
setup(name='CAN parser',
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
ext_modules=cythonize(
Extension(
"messaging_pyx",
language="c++",
sources=sourcefiles,
extra_compile_args=extra_compile_args,
libraries=libraries,
extra_objects=[
os.path.join(os.path.dirname(os.path.realpath(__file__)), '../', 'libmessaging.a'),
]
)
),
nthreads=4,
)
-449
View File
@@ -1,449 +0,0 @@
#include <iostream>
#include <cassert>
#include <cerrno>
#include <cmath>
#include <cstring>
#include <cstdint>
#include <chrono>
#include <algorithm>
#include <cstdlib>
#include <csignal>
#include <random>
#include <poll.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/syscall.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include "msgq.hpp"
void sigusr2_handler(int signal) {
assert(signal == SIGUSR2);
}
uint64_t msgq_get_uid(void){
std::random_device rd("/dev/urandom");
std::uniform_int_distribution<uint64_t> distribution(0,std::numeric_limits<uint32_t>::max());
uint64_t uid = distribution(rd) << 32 | syscall(SYS_gettid);
return uid;
}
int msgq_msg_init_size(msgq_msg_t * msg, size_t size){
msg->size = size;
msg->data = new(std::nothrow) char[size];
return (msg->data == NULL) ? -1 : 0;
}
int msgq_msg_init_data(msgq_msg_t * msg, char * data, size_t size) {
int r = msgq_msg_init_size(msg, size);
if (r == 0)
memcpy(msg->data, data, size);
return r;
}
int msgq_msg_close(msgq_msg_t * msg){
if (msg->size > 0)
delete[] msg->data;
msg->size = 0;
return 0;
}
void msgq_reset_reader(msgq_queue_t * q){
int id = q->reader_id;
q->read_valids[id]->store(true);
q->read_pointers[id]->store(*q->write_pointer);
}
void msgq_wait_for_subscriber(msgq_queue_t *q){
while (*q->num_readers == 0){
;
}
return;
}
int msgq_new_queue(msgq_queue_t * q, const char * path, size_t size){
assert(size < 0xFFFFFFFF); // Buffer must be smaller than 2^32 bytes
std::signal(SIGUSR2, sigusr2_handler);
const char * prefix = "/dev/shm/";
char * full_path = new char[strlen(path) + strlen(prefix) + 1];
strcpy(full_path, prefix);
strcat(full_path, path);
auto fd = open(full_path, O_RDWR | O_CREAT, 0777);
delete[] full_path;
if (fd < 0)
return -1;
int rc = ftruncate(fd, size + sizeof(msgq_header_t));
if (rc < 0)
return -1;
char * mem = (char*)mmap(NULL, size + sizeof(msgq_header_t), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
close(fd);
if (mem == NULL)
return -1;
q->mmap_p = mem;
msgq_header_t *header = (msgq_header_t *)mem;
// Setup pointers to header segment
q->num_readers = reinterpret_cast<std::atomic<uint64_t>*>(&header->num_readers);
q->write_pointer = reinterpret_cast<std::atomic<uint64_t>*>(&header->write_pointer);
q->write_uid = reinterpret_cast<std::atomic<uint64_t>*>(&header->write_uid);
for (size_t i = 0; i < NUM_READERS; i++){
q->read_pointers[i] = reinterpret_cast<std::atomic<uint64_t>*>(&header->read_pointers[i]);
q->read_valids[i] = reinterpret_cast<std::atomic<uint64_t>*>(&header->read_valids[i]);
q->read_uids[i] = reinterpret_cast<std::atomic<uint64_t>*>(&header->read_uids[i]);
}
q->data = mem + sizeof(msgq_header_t);
q->size = size;
q->reader_id = -1;
q->endpoint = path;
q->read_conflate = false;
return 0;
}
void msgq_close_queue(msgq_queue_t *q){
if (q->mmap_p != NULL){
munmap(q->mmap_p, q->size + sizeof(msgq_header_t));
}
}
void msgq_init_publisher(msgq_queue_t * q) {
//std::cout << "Starting publisher" << std::endl;
uint64_t uid = msgq_get_uid();
*q->write_uid = uid;
*q->num_readers = 0;
for (size_t i = 0; i < NUM_READERS; i++){
*q->read_valids[i] = false;
*q->read_uids[i] = 0;
}
q->write_uid_local = uid;
}
static void thread_signal(uint32_t tid) {
#ifndef SYS_tkill
// TODO: this won't work for multithreaded programs
kill(tid, SIGUSR2);
#else
syscall(SYS_tkill, tid, SIGUSR2);
#endif
}
void msgq_init_subscriber(msgq_queue_t * q) {
assert(q != NULL);
assert(q->num_readers != NULL);
uint64_t uid = msgq_get_uid();
// Get reader id
while (true){
uint64_t cur_num_readers = *q->num_readers;
uint64_t new_num_readers = cur_num_readers + 1;
// No more slots available. Reset all subscribers to kick out inactive ones
if (new_num_readers > NUM_READERS){
std::cout << "Warning, evicting all subscribers!" << std::endl;
*q->num_readers = 0;
for (size_t i = 0; i < NUM_READERS; i++){
*q->read_valids[i] = false;
uint64_t old_uid = *q->read_uids[i];
*q->read_uids[i] = 0;
// Wake up reader in case they are in a poll
thread_signal(old_uid & 0xFFFFFFFF);
}
continue;
}
// Use atomic compare and swap to handle race condition
// where two subscribers start at the same time
if (std::atomic_compare_exchange_strong(q->num_readers,
&cur_num_readers,
new_num_readers)){
q->reader_id = cur_num_readers;
q->read_uid_local = uid;
// We start with read_valid = false,
// on the first read the read pointer will be synchronized with the write pointer
*q->read_valids[cur_num_readers] = false;
*q->read_pointers[cur_num_readers] = 0;
*q->read_uids[cur_num_readers] = uid;
break;
}
}
//std::cout << "New subscriber id: " << q->reader_id << " uid: " << q->read_uid_local << " " << q->endpoint << std::endl;
msgq_reset_reader(q);
}
int msgq_msg_send(msgq_msg_t * msg, msgq_queue_t *q){
// Die if we are no longer the active publisher
if (q->write_uid_local != *q->write_uid){
std::cout << "Killing old publisher: " << q->endpoint << std::endl;
errno = EADDRINUSE;
return -1;
}
uint64_t total_msg_size = ALIGN(msg->size + sizeof(int64_t));
// We need to fit at least three messages in the queue,
// then we can always safely access the last message
assert(3 * total_msg_size <= q->size);
uint64_t num_readers = *q->num_readers;
uint32_t write_cycles, write_pointer;
UNPACK64(write_cycles, write_pointer, *q->write_pointer);
char *p = q->data + write_pointer; // add base offset
// Check remaining space
// Always leave space for a wraparound tag for the next message, including alignment
int64_t remaining_space = q->size - write_pointer - total_msg_size - sizeof(int64_t);
if (remaining_space <= 0){
// Write -1 size tag indicating wraparound
*(int64_t*)p = -1;
// Invalidate all readers that are beyond the write pointer
// TODO: should we handle the case where a new reader shows up while this is running?
for (uint64_t i = 0; i < num_readers; i++){
uint64_t read_pointer = *q->read_pointers[i];
uint64_t read_cycles = read_pointer >> 32;
read_pointer &= 0xFFFFFFFF;
if ((read_pointer > write_pointer) && (read_cycles != write_cycles)) {
*q->read_valids[i] = false;
}
}
// Update global and local copies of write pointer and write_cycles
write_pointer = 0;
write_cycles = write_cycles + 1;
PACK64(*q->write_pointer, write_cycles, write_pointer);
// Set actual pointer to the beginning of the data segment
p = q->data;
}
// Invalidate readers that are in the area that will be written
uint64_t start = write_pointer;
uint64_t end = ALIGN(start + sizeof(int64_t) + msg->size);
for (uint64_t i = 0; i < num_readers; i++){
uint32_t read_cycles, read_pointer;
UNPACK64(read_cycles, read_pointer, *q->read_pointers[i]);
if ((read_pointer >= start) && (read_pointer < end) && (read_cycles != write_cycles)) {
*q->read_valids[i] = false;
}
}
// Write size tag
std::atomic<int64_t> *size_p = reinterpret_cast<std::atomic<int64_t>*>(p);
*size_p = msg->size;
// Copy data
memcpy(p + sizeof(int64_t), msg->data, msg->size);
__sync_synchronize();
// Update write pointer
uint32_t new_ptr = ALIGN(write_pointer + msg->size + sizeof(int64_t));
PACK64(*q->write_pointer, write_cycles, new_ptr);
// Notify readers
for (uint64_t i = 0; i < num_readers; i++){
uint64_t reader_uid = *q->read_uids[i];
thread_signal(reader_uid & 0xFFFFFFFF);
}
return msg->size;
}
int msgq_msg_ready(msgq_queue_t * q){
start:
int id = q->reader_id;
assert(id >= 0); // Make sure subscriber is initialized
if (q->read_uid_local != *q->read_uids[id]){
std::cout << q->endpoint << ": Reader was evicted, reconnecting" << std::endl;
msgq_init_subscriber(q);
goto start;
}
// Check valid
if (!*q->read_valids[id]){
msgq_reset_reader(q);
goto start;
}
uint32_t read_cycles, read_pointer;
UNPACK64(read_cycles, read_pointer, *q->read_pointers[id]);
uint32_t write_cycles, write_pointer;
UNPACK64(write_cycles, write_pointer, *q->write_pointer);
// Check if new message is available
return (read_pointer != write_pointer);
}
int msgq_msg_recv(msgq_msg_t * msg, msgq_queue_t * q){
start:
int id = q->reader_id;
assert(id >= 0); // Make sure subscriber is initialized
if (q->read_uid_local != *q->read_uids[id]){
std::cout << q->endpoint << ": Reader was evicted, reconnecting" << std::endl;
msgq_init_subscriber(q);
goto start;
}
// Check valid
if (!*q->read_valids[id]){
msgq_reset_reader(q);
goto start;
}
uint32_t read_cycles, read_pointer;
UNPACK64(read_cycles, read_pointer, *q->read_pointers[id]);
uint32_t write_cycles, write_pointer;
UNPACK64(write_cycles, write_pointer, *q->write_pointer);
char * p = q->data + read_pointer;
// Check if new message is available
if (read_pointer == write_pointer) {
msg->size = 0;
return 0;
}
// Read potential message size
std::atomic<int64_t> *size_p = reinterpret_cast<std::atomic<int64_t>*>(p);
std::int64_t size = *size_p;
// Check if the size that was read is valid
if (!*q->read_valids[id]){
msgq_reset_reader(q);
goto start;
}
// If size is -1 the buffer was full, and we need to wrap around
if (size == -1){
read_cycles++;
PACK64(*q->read_pointers[id], read_cycles, 0);
goto start;
}
// crashing is better than passing garbage data to the consumer
// the size will have weird value if it was overwritten by data accidentally
assert((uint64_t)size < q->size);
assert(size > 0);
uint32_t new_read_pointer = ALIGN(read_pointer + sizeof(std::int64_t) + size);
// If conflate is true, check if this is the latest message, else start over
if (q->read_conflate){
if (new_read_pointer != write_pointer){
// Update read pointer
PACK64(*q->read_pointers[id], read_cycles, new_read_pointer);
goto start;
}
}
// Copy message
if (msgq_msg_init_size(msg, size) < 0)
return -1;
__sync_synchronize();
memcpy(msg->data, p + sizeof(int64_t), size);
__sync_synchronize();
// Update read pointer
PACK64(*q->read_pointers[id], read_cycles, new_read_pointer);
// Check if the actual data that was copied is valid
if (!*q->read_valids[id]){
msgq_msg_close(msg);
msgq_reset_reader(q);
goto start;
}
return msg->size;
}
int msgq_poll(msgq_pollitem_t * items, size_t nitems, int timeout){
assert(timeout >= 0);
int num = 0;
// Check if messages ready
for (size_t i = 0; i < nitems; i++) {
items[i].revents = msgq_msg_ready(items[i].q);
if (items[i].revents) num++;
}
int ms = (timeout == -1) ? 100 : timeout;
struct timespec ts;
ts.tv_sec = ms / 1000;
ts.tv_nsec = (ms % 1000) * 1000 * 1000;
while (num == 0) {
int ret;
ret = nanosleep(&ts, &ts);
// Check if messages ready
for (size_t i = 0; i < nitems; i++) {
if (items[i].revents == 0 && msgq_msg_ready(items[i].q)){
num += 1;
items[i].revents = 1;
}
}
// exit if we had a timeout and the sleep finished
if (timeout != -1 && ret == 0){
break;
}
}
return num;
}
-66
View File
@@ -1,66 +0,0 @@
#pragma once
#include <cstdint>
#include <cstring>
#include <string>
#include <atomic>
#define DEFAULT_SEGMENT_SIZE (10 * 1024 * 1024)
#define NUM_READERS 8
#define ALIGN(n) ((n + (8 - 1)) & -8)
#define UNPACK64(higher, lower, input) do {uint64_t tmp = input; higher = tmp >> 32; lower = tmp & 0xFFFFFFFF;} while (0)
#define PACK64(output, higher, lower) output = ((uint64_t)higher << 32 ) | ((uint64_t)lower & 0xFFFFFFFF)
struct msgq_header_t {
uint64_t num_readers;
uint64_t write_pointer;
uint64_t write_uid;
uint64_t read_pointers[NUM_READERS];
uint64_t read_valids[NUM_READERS];
uint64_t read_uids[NUM_READERS];
};
struct msgq_queue_t {
std::atomic<uint64_t> *num_readers;
std::atomic<uint64_t> *write_pointer;
std::atomic<uint64_t> *write_uid;
std::atomic<uint64_t> *read_pointers[NUM_READERS];
std::atomic<uint64_t> *read_valids[NUM_READERS];
std::atomic<uint64_t> *read_uids[NUM_READERS];
char * mmap_p;
char * data;
size_t size;
int reader_id;
uint64_t read_uid_local;
uint64_t write_uid_local;
bool read_conflate;
std::string endpoint;
};
struct msgq_msg_t {
size_t size;
char * data;
};
struct msgq_pollitem_t {
msgq_queue_t *q;
int revents;
};
void msgq_wait_for_subscriber(msgq_queue_t *q);
void msgq_reset_reader(msgq_queue_t *q);
int msgq_msg_init_size(msgq_msg_t *msg, size_t size);
int msgq_msg_init_data(msgq_msg_t *msg, char * data, size_t size);
int msgq_msg_close(msgq_msg_t *msg);
int msgq_new_queue(msgq_queue_t * q, const char * path, size_t size);
void msgq_close_queue(msgq_queue_t *q);
void msgq_init_publisher(msgq_queue_t * q);
void msgq_init_subscriber(msgq_queue_t * q);
int msgq_msg_send(msgq_msg_t *msg, msgq_queue_t *q);
int msgq_msg_recv(msgq_msg_t *msg, msgq_queue_t *q);
int msgq_msg_ready(msgq_queue_t * q);
int msgq_poll(msgq_pollitem_t * items, size_t nitems, int timeout);
-56
View File
@@ -1,56 +0,0 @@
# MSGQ: A lock free single producer multi consumer message queue
[![Build Status](https://dev.azure.com/commaai/default/_apis/build/status/commaai.msgq?branchName=master)](https://dev.azure.com/commaai/default/_build/latest?definitionId=21&branchName=master)
## What is MSGQ?
MSGQ is a system to pass messages from a single producer to multiple consumers. All the consumers need to be able to receive all the messages. It is designed to be a high performance replacement for ZMQ-like SUB/PUB patterns. It uses a ring buffer in shared memory to efficiently read and write data. Each read requires a copy. Writing can be done without a copy, as long as the size of the data is known in advance.
## Storage
The storage for the queue consists of an area of metadata, and the actual buffer. The metadata contains:
1. A counter to the number of readers that are active
2. A pointer to the head of the queue for writing. From now on referred to as *write pointer*
3. A cycle counter for the writer. This counter is incremented when the writer wraps around
4. N pointers, pointing to the current read position for all the readers. From now on referred to as *read pointer*
5. N counters, counting the number of cycles for all the readers
6. N booleans, indicating validity for all the readers. From now on referred to as *validity flag*
The counter and the pointer are both 32 bit values, packed into 64 bit so they can be read and written atomically.
The data buffer is a ring buffer. All messages are prefixed by an 8 byte size field, followed by the data. A size of -1 indicates a wrap-around, and means the next message is stored at the beginning of the buffer.
## Writing
Writing involves the following steps:
1. Check if the area that is to be written overlaps with any of the read pointers, mark those readers as invalid by clearing the validity flag.
2. Write the message
3. Increase the write pointer by the size of the message
In case there is not enough space at the end of the buffer, a special empty message with a prefix of -1 is written. The cycle counter is incremented by one. In this case step 1 will check there are no read pointers pointing to the remainder of the buffer. Then another write cycle will start with the actual message.
There always needs to be 8 bytes of empty space at the end of the buffer. By doing this there is always space to write the -1.
## Reset reader
When the reader is lagging too much behind the read pointer becomes invalid and no longer points to the beginning of a valid message. To reset a reader to the current write pointer, the following steps are performed:
1. Set valid flag
2. Set read cycle counter to that of the writer
3. Set read pointer to write pointer
## Reading
Reading involves the following steps:
1. Read the size field at the current read pointer
2. Read the validity flag
3. Copy the data out of the buffer
4. Increase the read pointer by the size of the message
5. Check the validity flag again
Before starting the copy, the valid flag is checked. This is to prevent a race condition where the size prefix was invalid, and the read could read outside of the buffer. Make sure that step 1 and 2 are not reordered by your compiler or CPU.
If a writer overwrites the data while it's being copied out, the data will be invalid. Therefore the validity flag is also checked after reading it. The order of step 4 and 5 does not matter.
If at steps 2 or 5 the validity flag is not set, the reader is reset. Any data that was already read is discarded. After the reader is reset, the reading starts from the beginning.
If a message with size -1 is encountered, step 3 and 4 are replaced by increasing the cycle counter and setting the read pointer to the beginning of the buffer. After that another read is performed.
-395
View File
@@ -1,395 +0,0 @@
#include "catch2/catch.hpp"
#include "msgq.hpp"
TEST_CASE("ALIGN"){
REQUIRE(ALIGN(0) == 0);
REQUIRE(ALIGN(1) == 8);
REQUIRE(ALIGN(7) == 8);
REQUIRE(ALIGN(8) == 8);
REQUIRE(ALIGN(99999) == 100000);
}
TEST_CASE("msgq_msg_init_size"){
const size_t msg_size = 30;
msgq_msg_t msg;
msgq_msg_init_size(&msg, msg_size);
REQUIRE(msg.size == msg_size);
msgq_msg_close(&msg);
}
TEST_CASE("msgq_msg_init_data"){
const size_t msg_size = 30;
char * data = new char[msg_size];
for (size_t i = 0; i < msg_size; i++){
data[i] = i;
}
msgq_msg_t msg;
msgq_msg_init_data(&msg, data, msg_size);
REQUIRE(msg.size == msg_size);
REQUIRE(memcmp(msg.data, data, msg_size) == 0);
delete[] data;
msgq_msg_close(&msg);
}
TEST_CASE("msgq_init_subscriber"){
remove("/dev/shm/test_queue");
msgq_queue_t q;
msgq_new_queue(&q, "test_queue", 1024);
REQUIRE(*q.num_readers == 0);
q.reader_id = 1;
*q.read_valids[0] = false;
*q.read_pointers[0] = ((uint64_t)1 << 32);
*q.write_pointer = 255;
msgq_init_subscriber(&q);
REQUIRE(q.read_conflate == false);
REQUIRE(*q.read_valids[0] == true);
REQUIRE((*q.read_pointers[0] >> 32) == 0);
REQUIRE((*q.read_pointers[0] & 0xFFFFFFFF) == 255);
}
TEST_CASE("msgq_msg_send first message"){
remove("/dev/shm/test_queue");
msgq_queue_t q;
msgq_new_queue(&q, "test_queue", 1024);
msgq_init_publisher(&q);
REQUIRE(*q.write_pointer == 0);
size_t msg_size = 128;
SECTION("Aligned message size"){
}
SECTION("Unaligned message size"){
msg_size--;
}
char * data = new char[msg_size];
for (size_t i = 0; i < msg_size; i++){
data[i] = i;
}
msgq_msg_t msg;
msgq_msg_init_data(&msg, data, msg_size);
msgq_msg_send(&msg, &q);
REQUIRE(*(int64_t*)q.data == msg_size); // Check size tag
REQUIRE(*q.write_pointer == 128 + sizeof(int64_t));
REQUIRE(memcmp(q.data + sizeof(int64_t), data, msg_size) == 0);
delete[] data;
msgq_msg_close(&msg);
}
TEST_CASE("msgq_msg_send test wraparound"){
remove("/dev/shm/test_queue");
msgq_queue_t q;
msgq_new_queue(&q, "test_queue", 1024);
msgq_init_publisher(&q);
REQUIRE((*q.write_pointer & 0xFFFFFFFF) == 0);
REQUIRE((*q.write_pointer >> 32) == 0);
const size_t msg_size = 120;
msgq_msg_t msg;
msgq_msg_init_size(&msg, msg_size);
for (int i = 0; i < 8; i++) {
msgq_msg_send(&msg, &q);
}
// Check 8th message was written at the beginning
REQUIRE((*q.write_pointer & 0xFFFFFFFF) == msg_size + sizeof(int64_t));
// Check cycle count
REQUIRE((*q.write_pointer >> 32) == 1);
// Check wraparound tag
char * tag_location = q.data;
tag_location += 7 * (msg_size + sizeof(int64_t));
REQUIRE(*(int64_t*)tag_location == -1);
msgq_msg_close(&msg);
}
TEST_CASE("msgq_msg_recv test wraparound"){
remove("/dev/shm/test_queue");
msgq_queue_t q_pub, q_sub;
msgq_new_queue(&q_pub, "test_queue", 1024);
msgq_new_queue(&q_sub, "test_queue", 1024);
msgq_init_publisher(&q_pub);
msgq_init_subscriber(&q_sub);
REQUIRE((*q_pub.write_pointer >> 32) == 0);
REQUIRE((*q_sub.read_pointers[0] >> 32) == 0);
const size_t msg_size = 120;
msgq_msg_t msg1;
msgq_msg_init_size(&msg1, msg_size);
SECTION("Check cycle counter after reset") {
for (int i = 0; i < 8; i++) {
msgq_msg_send(&msg1, &q_pub);
}
msgq_msg_t msg2;
msgq_msg_recv(&msg2, &q_sub);
REQUIRE(msg2.size == 0); // Reader had to reset
msgq_msg_close(&msg2);
}
SECTION("Check cycle counter while keeping up with writer") {
for (int i = 0; i < 8; i++) {
msgq_msg_send(&msg1, &q_pub);
msgq_msg_t msg2;
msgq_msg_recv(&msg2, &q_sub);
REQUIRE(msg2.size > 0);
msgq_msg_close(&msg2);
}
}
REQUIRE((*q_sub.read_pointers[0] >> 32) == 1);
msgq_msg_close(&msg1);
}
TEST_CASE("msgq_msg_send test invalidation"){
remove("/dev/shm/test_queue");
msgq_queue_t q_pub, q_sub;
msgq_new_queue(&q_pub, "test_queue", 1024);
msgq_new_queue(&q_sub, "test_queue", 1024);
msgq_init_publisher(&q_pub);
msgq_init_subscriber(&q_sub);
*q_sub.write_pointer = (uint64_t)1 << 32;
REQUIRE(*q_sub.read_valids[0] == true);
SECTION("read pointer in tag"){
*q_sub.read_pointers[0] = 0;
}
SECTION("read pointer in data section"){
*q_sub.read_pointers[0] = 64;
}
SECTION("read pointer in wraparound section"){
*q_pub.write_pointer = ((uint64_t)1 << 32) | 1000; // Writer is one cycle ahead
*q_sub.read_pointers[0] = 1020;
}
msgq_msg_t msg;
msgq_msg_init_size(&msg, 128);
msgq_msg_send(&msg, &q_pub);
REQUIRE(*q_sub.read_valids[0] == false);
msgq_msg_close(&msg);
}
TEST_CASE("msgq_init_subscriber init 2 subscribers"){
remove("/dev/shm/test_queue");
msgq_queue_t q1, q2;
msgq_new_queue(&q1, "test_queue", 1024);
msgq_new_queue(&q2, "test_queue", 1024);
*q1.num_readers = 0;
REQUIRE(*q1.num_readers == 0);
REQUIRE(*q2.num_readers == 0);
msgq_init_subscriber(&q1);
REQUIRE(*q1.num_readers == 1);
REQUIRE(*q2.num_readers == 1);
REQUIRE(q1.reader_id == 0);
msgq_init_subscriber(&q2);
REQUIRE(*q1.num_readers == 2);
REQUIRE(*q2.num_readers == 2);
REQUIRE(q2.reader_id == 1);
}
TEST_CASE("Write 1 msg, read 1 msg", "[integration]"){
remove("/dev/shm/test_queue");
const size_t msg_size = 128;
msgq_queue_t writer, reader;
msgq_new_queue(&writer, "test_queue", 1024);
msgq_new_queue(&reader, "test_queue", 1024);
msgq_init_publisher(&writer);
msgq_init_subscriber(&reader);
// Build 128 byte message
msgq_msg_t outgoing_msg;
msgq_msg_init_size(&outgoing_msg, msg_size);
for (size_t i = 0; i < msg_size; i++){
outgoing_msg.data[i] = i;
}
REQUIRE(msgq_msg_send(&outgoing_msg, &writer) == msg_size);
msgq_msg_t incoming_msg1;
REQUIRE(msgq_msg_recv(&incoming_msg1, &reader) == msg_size);
REQUIRE(memcmp(incoming_msg1.data, outgoing_msg.data, msg_size) == 0);
// Verify that there are no more messages
msgq_msg_t incoming_msg2;
REQUIRE(msgq_msg_recv(&incoming_msg2, &reader) == 0);
msgq_msg_close(&outgoing_msg);
msgq_msg_close(&incoming_msg1);
msgq_msg_close(&incoming_msg2);
}
TEST_CASE("Write 2 msg, read 2 msg - conflate = false", "[integration]"){
remove("/dev/shm/test_queue");
const size_t msg_size = 128;
msgq_queue_t writer, reader;
msgq_new_queue(&writer, "test_queue", 1024);
msgq_new_queue(&reader, "test_queue", 1024);
msgq_init_publisher(&writer);
msgq_init_subscriber(&reader);
// Build 128 byte message
msgq_msg_t outgoing_msg;
msgq_msg_init_size(&outgoing_msg, msg_size);
for (size_t i = 0; i < msg_size; i++){
outgoing_msg.data[i] = i;
}
REQUIRE(msgq_msg_send(&outgoing_msg, &writer) == msg_size);
REQUIRE(msgq_msg_send(&outgoing_msg, &writer) == msg_size);
msgq_msg_t incoming_msg1;
REQUIRE(msgq_msg_recv(&incoming_msg1, &reader) == msg_size);
REQUIRE(memcmp(incoming_msg1.data, outgoing_msg.data, msg_size) == 0);
msgq_msg_t incoming_msg2;
REQUIRE(msgq_msg_recv(&incoming_msg2, &reader) == msg_size);
REQUIRE(memcmp(incoming_msg2.data, outgoing_msg.data, msg_size) == 0);
msgq_msg_close(&outgoing_msg);
msgq_msg_close(&incoming_msg1);
msgq_msg_close(&incoming_msg2);
}
TEST_CASE("Write 2 msg, read 2 msg - conflate = true", "[integration]"){
remove("/dev/shm/test_queue");
const size_t msg_size = 128;
msgq_queue_t writer, reader;
msgq_new_queue(&writer, "test_queue", 1024);
msgq_new_queue(&reader, "test_queue", 1024);
msgq_init_publisher(&writer);
msgq_init_subscriber(&reader);
reader.read_conflate = true;
// Build 128 byte message
msgq_msg_t outgoing_msg;
msgq_msg_init_size(&outgoing_msg, msg_size);
for (size_t i = 0; i < msg_size; i++){
outgoing_msg.data[i] = i;
}
REQUIRE(msgq_msg_send(&outgoing_msg, &writer) == msg_size);
REQUIRE(msgq_msg_send(&outgoing_msg, &writer) == msg_size);
msgq_msg_t incoming_msg1;
REQUIRE(msgq_msg_recv(&incoming_msg1, &reader) == msg_size);
REQUIRE(memcmp(incoming_msg1.data, outgoing_msg.data, msg_size) == 0);
// Verify that there are no more messages
msgq_msg_t incoming_msg2;
REQUIRE(msgq_msg_recv(&incoming_msg2, &reader) == 0);
msgq_msg_close(&outgoing_msg);
msgq_msg_close(&incoming_msg1);
msgq_msg_close(&incoming_msg2);
}
TEST_CASE("1 publisher, 1 slow subscriber", "[integration]"){
remove("/dev/shm/test_queue");
msgq_queue_t writer, reader;
msgq_new_queue(&writer, "test_queue", 1024);
msgq_new_queue(&reader, "test_queue", 1024);
msgq_init_publisher(&writer);
msgq_init_subscriber(&reader);
int n_received = 0;
int n_skipped = 0;
for (uint64_t i = 0; i < 1e5; i++) {
msgq_msg_t outgoing_msg;
msgq_msg_init_data(&outgoing_msg, (char*)&i, sizeof(uint64_t));
msgq_msg_send(&outgoing_msg, &writer);
msgq_msg_close(&outgoing_msg);
if (i % 10 == 0){
msgq_msg_t msg1;
msgq_msg_recv(&msg1, &reader);
if (msg1.size == 0){
n_skipped++;
} else {
n_received++;
}
msgq_msg_close(&msg1);
}
}
// TODO: verify these numbers by hand
REQUIRE(n_received == 8572);
REQUIRE(n_skipped == 1428);
}
TEST_CASE("1 publisher, 2 subscribers", "[integration]"){
remove("/dev/shm/test_queue");
msgq_queue_t writer, reader1, reader2;
msgq_new_queue(&writer, "test_queue", 1024);
msgq_new_queue(&reader1, "test_queue", 1024);
msgq_new_queue(&reader2, "test_queue", 1024);
msgq_init_publisher(&writer);
msgq_init_subscriber(&reader1);
msgq_init_subscriber(&reader2);
for (uint64_t i = 0; i < 1024 * 3; i++) {
msgq_msg_t outgoing_msg;
msgq_msg_init_data(&outgoing_msg, (char*)&i, sizeof(uint64_t));
msgq_msg_send(&outgoing_msg, &writer);
msgq_msg_t msg1, msg2;
msgq_msg_recv(&msg1, &reader1);
msgq_msg_recv(&msg2, &reader2);
REQUIRE(msg1.size == sizeof(uint64_t));
REQUIRE(msg2.size == sizeof(uint64_t));
REQUIRE(*(uint64_t*)msg1.data == i);
REQUIRE(*(uint64_t*)msg2.data == i);
msgq_msg_close(&outgoing_msg);
msgq_msg_close(&msg1);
msgq_msg_close(&msg2);
}
}
-14
View File
@@ -1,14 +0,0 @@
from messaging_pyx import Context, SubSocket, PubSocket # pylint: disable=no-name-in-module, import-error
if __name__ == "__main__":
c = Context()
pub_sock = PubSocket()
pub_sock.connect(c, "controlsState")
for i in range(int(1e10)):
print(i)
sub_sock = SubSocket()
sub_sock.connect(c, "controlsState")
pub_sock.send(b'a')
print(sub_sock.receive())
-2
View File
@@ -1,2 +0,0 @@
#define CATCH_CONFIG_MAIN
#include "catch2/catch.hpp"
-142
View File
@@ -1,142 +0,0 @@
import unittest
import time
import cereal.messaging as messaging
import concurrent.futures
def poller():
context = messaging.Context()
p = messaging.Poller()
sub = messaging.SubSocket()
sub.connect(context, 'controlsState')
p.registerSocket(sub)
socks = p.poll(10000)
r = [s.receive(non_blocking=True) for s in socks]
return r
class TestPoller(unittest.TestCase):
def test_poll_once(self):
context = messaging.Context()
pub = messaging.PubSocket()
pub.connect(context, 'controlsState')
with concurrent.futures.ThreadPoolExecutor() as e:
poll = e.submit(poller)
time.sleep(0.1) # Slow joiner syndrome
# Send message
pub.send("a")
# Wait for poll result
result = poll.result()
del pub
context.term()
self.assertEqual(result, [b"a"])
def test_poll_and_create_many_subscribers(self):
context = messaging.Context()
pub = messaging.PubSocket()
pub.connect(context, 'controlsState')
with concurrent.futures.ThreadPoolExecutor() as e:
poll = e.submit(poller)
time.sleep(0.1) # Slow joiner syndrome
c = messaging.Context()
for _ in range(10):
messaging.SubSocket().connect(c, 'controlsState')
time.sleep(0.1)
# Send message
pub.send("a")
# Wait for poll result
result = poll.result()
del pub
context.term()
self.assertEqual(result, [b"a"])
def test_multiple_publishers_exception(self):
context = messaging.Context()
with self.assertRaises(messaging.MultiplePublishersError):
pub1 = messaging.PubSocket()
pub1.connect(context, 'controlsState')
pub2 = messaging.PubSocket()
pub2.connect(context, 'controlsState')
pub1.send("a")
del pub1
del pub2
context.term()
def test_multiple_messages(self):
context = messaging.Context()
pub = messaging.PubSocket()
pub.connect(context, 'controlsState')
sub = messaging.SubSocket()
sub.connect(context, 'controlsState')
time.sleep(0.1) # Slow joiner
for i in range(100):
pub.send(str(i))
msg_seen = False
i = 0
while True:
r = sub.receive(non_blocking=True)
if r is not None:
self.assertEqual(str(i), r.decode('utf8'))
msg_seen = True
i += 1
if r is None and msg_seen: # ZMQ sometimes receives nothing on the first receive
break
del pub
del sub
context.term()
def test_conflate(self):
context = messaging.Context()
pub = messaging.PubSocket()
pub.connect(context, 'controlsState')
sub = messaging.SubSocket()
sub.connect(context, 'controlsState', conflate=True)
time.sleep(0.1) # Slow joiner
pub.send('a')
pub.send('b')
self.assertEqual(b'b', sub.receive())
del pub
del sub
context.term()
if __name__ == "__main__":
unittest.main()
-33
View File
@@ -1,33 +0,0 @@
#!/usr/bin/env python3
import os
import yaml
class Service():
def __init__(self, port, should_log, frequency, decimation=None):
self.port = port
self.should_log = should_log
self.frequency = frequency
self.decimation = decimation
service_list_path = os.path.join(os.path.dirname(__file__), "service_list.yaml")
service_list = {}
with open(service_list_path, "r") as f:
for k, v in yaml.safe_load(f).items():
decimation = None
if len(v) == 4:
decimation = v[3]
service_list[k] = Service(v[0], v[1], v[2], decimation)
if __name__ == "__main__":
print("/* THIS IS AN AUTOGENERATED FILE, PLEASE EDIT service_list.yaml */")
print("#ifndef __SERVICES_H")
print("#define __SERVICES_H")
print("struct service { int port; bool should_log; int frequency; int decimation; char name[0x100]; };")
print("static struct service services[] = {")
for k, v in service_list.items():
print(' { .name = "%s", .port = %d, .should_log = %s, .frequency = %d, .decimation = %d },' % (k, v.port, "true" if v.should_log else "false", v.frequency, -1 if v.decimation is None else v.decimation))
print("};")
print("#endif")
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
pyflakes $(find . -iname "*.py" | grep -vi "^\./pyextra.*" | grep -vi "^\./panda")
RESULT=$?
if [ $RESULT -eq 0 ]; then
pylint $(find . -iname "*.py" | grep -vi "^\./pyextra.*" | grep -vi "^\./panda")
RESULT=$? & 3
fi
[ $RESULT -ne 0 ] && exit 1
exit 0
-1
View File
@@ -1 +0,0 @@
*.cpp
-6
View File
@@ -1,6 +0,0 @@
Import('env')
# parser
env.Command(['common_pyx.so'],
['common_pyx_setup.py', 'clock.pyx'],
"cd common && python3 common_pyx_setup.py build_ext --inplace")
-130
View File
@@ -1,130 +0,0 @@
import os
import binascii
import itertools
import re
import struct
import subprocess
import random
from cereal import log
NetworkType = log.ThermalData.NetworkType
ANDROID = os.path.isfile('/EON')
def getprop(key):
if not ANDROID:
return ""
return subprocess.check_output(["getprop", key], encoding='utf8').strip()
def get_imei(slot):
slot = str(slot)
if slot not in ("0", "1"):
raise ValueError("SIM slot must be 0 or 1")
ret = parse_service_call_string(service_call(["iphonesubinfo", "3" ,"i32", str(slot)]))
if not ret:
# allow non android to be identified differently
ret = "%015d" % random.randint(0, 1<<32)
return ret
def get_serial():
ret = getprop("ro.serialno")
if ret == "":
ret = "cccccccc"
return ret
def get_subscriber_info():
ret = parse_service_call_string(service_call(["iphonesubinfo", "7"]))
if ret is None or len(ret) < 8:
return ""
return ret
def reboot(reason=None):
if reason is None:
reason_args = ["null"]
else:
reason_args = ["s16", reason]
subprocess.check_output([
"service", "call", "power", "16", # IPowerManager.reboot
"i32", "0", # no confirmation,
*reason_args,
"i32", "1" # wait
])
def service_call(call):
if not ANDROID:
return None
ret = subprocess.check_output(["service", "call", *call], encoding='utf8').strip()
if 'Parcel' not in ret:
return None
return parse_service_call_bytes(ret)
def parse_service_call_unpack(r, fmt):
try:
return struct.unpack(fmt, r)[0]
except Exception:
return None
def parse_service_call_string(r):
try:
r = r[8:] # Cut off length field
r = r.decode('utf_16_be')
# All pairs of two characters seem to be swapped. Not sure why
result = ""
for a, b, in itertools.zip_longest(r[::2], r[1::2], fillvalue='\x00'):
result += b + a
result = result.replace('\x00', '')
return result
except Exception:
return None
def parse_service_call_bytes(ret):
try:
r = b""
for hex_part in re.findall(r'[ (]([0-9a-f]{8})', ret):
r += binascii.unhexlify(hex_part)
return r
except Exception:
return None
def get_network_type():
if not ANDROID:
return NetworkType.none
wifi_check = parse_service_call_string(service_call(["connectivity", "2"]))
if wifi_check is None:
return NetworkType.none
elif 'WIFI' in wifi_check:
return NetworkType.wifi
else:
cell_check = parse_service_call_unpack(service_call(['phone', '59']), ">q")
# from TelephonyManager.java
cell_networks = {
0: NetworkType.none,
1: NetworkType.cell2G,
2: NetworkType.cell2G,
3: NetworkType.cell3G,
4: NetworkType.cell2G,
5: NetworkType.cell3G,
6: NetworkType.cell3G,
7: NetworkType.cell3G,
8: NetworkType.cell3G,
9: NetworkType.cell3G,
10: NetworkType.cell3G,
11: NetworkType.cell2G,
12: NetworkType.cell3G,
13: NetworkType.cell4G,
14: NetworkType.cell4G,
15: NetworkType.cell3G,
16: NetworkType.cell2G,
17: NetworkType.cell3G,
18: NetworkType.cell4G,
19: NetworkType.cell4G
}
return cell_networks.get(cell_check, NetworkType.none)
+2 -2
View File
@@ -1,13 +1,13 @@
import jwt
import requests
from datetime import datetime, timedelta
from common.basedir import PERSIST
from selfdrive.version import version
class Api():
def __init__(self, dongle_id):
self.dongle_id = dongle_id
with open(PERSIST+'/comma/id_rsa') as f:
with open('/persist/comma/id_rsa') as f:
self.private_key = f.read()
def get(self, *args, **kwargs):
-99
View File
@@ -1,99 +0,0 @@
import os
import subprocess
import glob
import hashlib
import shutil
from common.basedir import BASEDIR
from selfdrive.swaglog import cloudlog
android_packages = ("tw.com.ainvest.outpack", "cn.dragonpilot.gpsservice", "com.autonavi.amapauto", "com.mixplorer", "com.tomtom.speedcams.android.map", "ai.comma.plus.offroad", "ai.comma.plus.frame")
def get_installed_apks():
dat = subprocess.check_output(["pm", "list", "packages", "-f"], encoding='utf8').strip().split("\n")
ret = {}
for x in dat:
if x.startswith("package:"):
v,k = x.split("package:")[1].split("=")
ret[k] = v
return ret
def install_apk(path):
# can only install from world readable path
install_path = "/sdcard/%s" % os.path.basename(path)
shutil.copyfile(path, install_path)
ret = subprocess.call(["pm", "install", "-r", install_path])
os.remove(install_path)
return ret == 0
def start_frame():
set_package_permissions()
system("am start -n ai.comma.plus.frame/.MainActivity")
def set_package_permissions():
pm_grant("ai.comma.plus.offroad", "android.permission.ACCESS_FINE_LOCATION")
pm_grant("ai.comma.plus.offroad", "android.permission.READ_PHONE_STATE")
appops_set("ai.comma.plus.offroad", "SU", "allow")
appops_set("ai.comma.plus.offroad", "WIFI_SCAN", "allow")
appops_set("ai.comma.plus.offroad", "READ_EXTERNAL_STORAGE", "allow")
appops_set("ai.comma.plus.offroad", "WRITE_EXTERNAL_STORAGE", "allow")
def appops_set(package, op, mode):
system(f"LD_LIBRARY_PATH= appops set {package} {op} {mode}")
def pm_grant(package, permission):
system(f"pm grant {package} {permission}")
def system(cmd):
try:
cloudlog.info("running %s" % cmd)
subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
except subprocess.CalledProcessError as e:
cloudlog.event("running failed",
cmd=e.cmd,
output=e.output[-1024:],
returncode=e.returncode)
# *** external functions ***
def update_apks():
# install apks
installed = get_installed_apks()
install_apks = glob.glob(os.path.join(BASEDIR, "apk/*.apk"))
for apk in install_apks:
app = os.path.basename(apk)[:-4]
if app not in installed:
installed[app] = None
cloudlog.info("installed apks %s" % (str(installed), ))
for app in installed.keys():
apk_path = os.path.join(BASEDIR, "apk/"+app+".apk")
if not os.path.exists(apk_path):
continue
h1 = hashlib.sha1(open(apk_path, 'rb').read()).hexdigest()
h2 = None
if installed[app] is not None:
h2 = hashlib.sha1(open(installed[app], 'rb').read()).hexdigest()
cloudlog.info("comparing version of %s %s vs %s" % (app, h1, h2))
if h2 is None or h1 != h2:
cloudlog.info("installing %s" % app)
success = install_apk(apk_path)
if not success:
cloudlog.info("needing to uninstall %s" % app)
system("pm uninstall %s" % app)
success = install_apk(apk_path)
assert success
def pm_apply_packages(cmd):
for p in android_packages:
system("pm %s %s" % (cmd, p))
if __name__ == "__main__":
update_apks()
-7
View File
@@ -1,11 +1,4 @@
import os
BASEDIR = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../"))
from common.android import ANDROID
if ANDROID:
PERSIST = "/persist"
PARAMS = "/data/params"
else:
PERSIST = os.path.join(BASEDIR, "persist")
PARAMS = os.path.join(BASEDIR, "persist", "params")
+9 -15
View File
@@ -1,22 +1,16 @@
from posix.time cimport clock_gettime, timespec, CLOCK_MONOTONIC_RAW, clockid_t
from posix.time cimport clock_gettime, timespec, CLOCK_BOOTTIME, CLOCK_MONOTONIC_RAW
IF UNAME_SYSNAME == "Darwin":
# Darwin doesn't have a CLOCK_BOOTTIME
CLOCK_BOOTTIME = CLOCK_MONOTONIC_RAW
ELSE:
from posix.time cimport CLOCK_BOOTTIME
cdef double readclock(int clock_id):
cdef timespec ts
cdef double current
cdef double readclock(clockid_t clock_id):
cdef timespec ts
cdef double current
clock_gettime(clock_id, &ts)
current = ts.tv_sec + (ts.tv_nsec / 1000000000.)
return current
clock_gettime(clock_id, &ts)
current = ts.tv_sec + (ts.tv_nsec / 1000000000.)
return current
def monotonic_time():
return readclock(CLOCK_MONOTONIC_RAW)
return readclock(CLOCK_MONOTONIC_RAW)
def sec_since_boot():
return readclock(CLOCK_BOOTTIME)
return readclock(CLOCK_BOOTTIME)
-20
View File
@@ -1,20 +0,0 @@
from distutils.core import Extension, setup # pylint: disable=import-error,no-name-in-module
from Cython.Build import cythonize
from common.cython_hacks import BuildExtWithoutPlatformSuffix
sourcefiles = ['clock.pyx']
extra_compile_args = ["-std=c++11"]
setup(name='Common',
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
ext_modules=cythonize(
Extension(
"common_pyx",
language="c++",
sources=sourcefiles,
extra_compile_args=extra_compile_args,
)
),
nthreads=4,
)
+2 -1
View File
@@ -257,6 +257,7 @@ class dbc():
if __name__ == "__main__":
from opendbc import DBC_PATH
import numpy as np
dbc_test = dbc(os.path.join(DBC_PATH, 'toyota_prius_2017_pt_generated.dbc'))
msg = ('STEER_ANGLE_SENSOR', {'STEER_ANGLE': -6.0, 'STEER_RATE': 4, 'STEER_FRACTION': -0.2})
@@ -266,7 +267,7 @@ if __name__ == "__main__":
dbc_test = dbc(os.path.join(DBC_PATH, 'hyundai_santa_fe_2019_ccan.dbc'))
decoded = dbc_test.decode((0x2b0, 0, "\xfa\xfe\x00\x07\x12"))
assert abs(decoded[1]['SAS_Angle'] - (-26.2)) < 0.001
assert np.isclose(decoded[1]['SAS_Angle'], -26.2)
msg = ('SAS11', {'SAS_Stat': 7.0, 'MsgCount': 0.0, 'SAS_Angle': -26.200000000000003, 'SAS_Speed': 0.0, 'CheckSum': 0.0})
encoded = dbc_test.encode(*msg)
-6
View File
@@ -2,14 +2,8 @@ import os
import sys
import fcntl
import hashlib
import platform
from cffi import FFI
def suffix():
if platform.system() == "Darwin":
return ".dylib"
else:
return ".so"
def ffi_wrap(name, c_code, c_header, tmpdir="/tmp/ccache", cflags="", libraries=None):
if libraries is None:
-1
View File
@@ -1 +0,0 @@
simple_kalman_impl.c
+10
View File
@@ -0,0 +1,10 @@
all: simple_kalman_impl.so
simple_kalman_impl.so: simple_kalman_impl.pyx simple_kalman_impl.pxd simple_kalman_setup.py
python3 simple_kalman_setup.py build_ext --inplace
rm -rf build
rm simple_kalman_impl.c
.PHONY: clean
clean:
rm -f simple_kalman_impl.so
-6
View File
@@ -1,6 +0,0 @@
Import('env')
env.Command(['simple_kalman_impl.so'],
['simple_kalman_impl.pyx', 'simple_kalman_impl.pxd', 'simple_kalman_setup.py'],
"cd common/kalman && python3 simple_kalman_setup.py build_ext --inplace")
+8 -1
View File
@@ -1,3 +1,10 @@
# pylint: skip-file
from common.kalman.simple_kalman_impl import KF1D as KF1D
import os
import subprocess
kalman_dir = os.path.dirname(os.path.abspath(__file__))
subprocess.check_call(["make", "simple_kalman_impl.so"], cwd=kalman_dir)
from .simple_kalman_impl import KF1D as KF1D
# Silence pyflakes
assert KF1D
+1 -1
View File
@@ -1,4 +1,4 @@
from distutils.core import Extension, setup
from distutils.core import Extension, setup # pylint: disable=import-error,no-name-in-module
from Cython.Build import cythonize
+22 -38
View File
@@ -1,11 +1,9 @@
import io
import os
import sys
import copy
import json
import socket
import logging
import traceback
from threading import local
from collections import OrderedDict
from contextlib import contextmanager
@@ -80,6 +78,28 @@ class SwagLogger(logging.Logger):
self.log_local = local()
self.log_local.ctx = {}
def findCaller(self, stack_info=None):
"""
Find the stack frame of the caller so that we can note the source
file name, line number and function name.
"""
# f = currentframe()
f = sys._getframe(3)
#On some versions of IronPython, currentframe() returns None if
#IronPython isn't run with -X:Frames.
if f is not None:
f = f.f_back
rv = "(unknown file)", 0, "(unknown function)"
while hasattr(f, "f_code"):
co = f.f_code
filename = os.path.normcase(co.co_filename)
if filename in (logging._srcfile, _srcfile):
f = f.f_back
continue
rv = (co.co_filename, f.f_lineno, co.co_name)
break
return rv
def local_ctx(self):
try:
return self.log_local.ctx
@@ -120,42 +140,6 @@ class SwagLogger(logging.Logger):
else:
self.info(evt)
def findCaller(self, stack_info=False, stacklevel=1):
"""
Find the stack frame of the caller so that we can note the source
file name, line number and function name.
"""
f = sys._getframe(3)
#On some versions of IronPython, currentframe() returns None if
#IronPython isn't run with -X:Frames.
if f is not None:
f = f.f_back
orig_f = f
while f and stacklevel > 1:
f = f.f_back
stacklevel -= 1
if not f:
f = orig_f
rv = "(unknown file)", 0, "(unknown function)", None
while hasattr(f, "f_code"):
co = f.f_code
filename = os.path.normcase(co.co_filename)
if filename == _srcfile:
f = f.f_back
continue
sinfo = None
if stack_info:
sio = io.StringIO()
sio.write('Stack (most recent call last):\n')
traceback.print_stack(f, file=sio)
sinfo = sio.getvalue()
if sinfo[-1] == '\n':
sinfo = sinfo[:-1]
sio.close()
rv = (co.co_filename, f.f_lineno, co.co_name, sinfo)
break
return rv
if __name__ == "__main__":
log = SwagLogger()
+8 -34
View File
@@ -29,7 +29,7 @@ import fcntl
import tempfile
import threading
from enum import Enum
from common.basedir import PARAMS
def mkdirs_exists_ok(path):
try:
@@ -54,9 +54,7 @@ keys = {
"AthenadPid": [TxType.PERSISTENT],
"CalibrationParams": [TxType.PERSISTENT],
"CarParams": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"CarParamsCache": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"CarVin": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"CommunityFeaturesToggle": [TxType.PERSISTENT],
"CompletedTrainingVersion": [TxType.PERSISTENT],
"ControlsParams": [TxType.PERSISTENT],
"DoUninstall": [TxType.CLEAR_ON_MANAGER_START],
@@ -67,26 +65,22 @@ keys = {
"GithubSshKeys": [TxType.PERSISTENT],
"HasAcceptedTerms": [TxType.PERSISTENT],
"HasCompletedSetup": [TxType.PERSISTENT],
"IsLdwEnabled": [TxType.PERSISTENT],
"IsGeofenceEnabled": [TxType.PERSISTENT],
"IsMetric": [TxType.PERSISTENT],
"IsOffroad": [TxType.CLEAR_ON_MANAGER_START],
"IsRHD": [TxType.PERSISTENT],
"IsTakingSnapshot": [TxType.CLEAR_ON_MANAGER_START],
"IsUpdateAvailable": [TxType.CLEAR_ON_MANAGER_START],
"IsUpdateAvailable": [TxType.PERSISTENT],
"IsUploadRawEnabled": [TxType.PERSISTENT],
"IsUploadVideoOverCellularEnabled": [TxType.PERSISTENT],
"LastUpdateTime": [TxType.PERSISTENT],
"LimitSetSpeed": [TxType.PERSISTENT],
"LimitSetSpeedNeural": [TxType.PERSISTENT],
"LiveParameters": [TxType.PERSISTENT],
"LongitudinalControl": [TxType.PERSISTENT],
"OpenpilotEnabledToggle": [TxType.PERSISTENT],
"PandaFirmware": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"PandaFirmwareHex": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"PandaDongleId": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"Passive": [TxType.PERSISTENT],
"RecordFront": [TxType.PERSISTENT],
"ReleaseNotes": [TxType.PERSISTENT],
"SafetyModelLock": [TxType.PERSISTENT],
"ShouldDoUpdate": [TxType.CLEAR_ON_MANAGER_START],
"SpeedLimitOffset": [TxType.PERSISTENT],
"SubscriberInfo": [TxType.PERSISTENT],
@@ -95,12 +89,9 @@ keys = {
"UpdateAvailable": [TxType.CLEAR_ON_MANAGER_START],
"Version": [TxType.PERSISTENT],
"Offroad_ChargeDisabled": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"Offroad_ConnectivityNeeded": [TxType.CLEAR_ON_MANAGER_START],
"Offroad_ConnectivityNeededPrompt": [TxType.CLEAR_ON_MANAGER_START],
"Offroad_TemperatureTooHigh": [TxType.CLEAR_ON_MANAGER_START],
"Offroad_PandaFirmwareMismatch": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"Offroad_InvalidTime": [TxType.CLEAR_ON_MANAGER_START],
"Offroad_IsTakingSnapshot": [TxType.CLEAR_ON_MANAGER_START],
"Offroad_ConnectivityNeededPrompt": [TxType.CLEAR_ON_MANAGER_START],
"Offroad_ConnectivityNeeded": [TxType.CLEAR_ON_MANAGER_START],
#dragonpilot config
"DragonEnableDashcam": [TxType.PERSISTENT],
"DragonEnableDriverSafetyCheck": [TxType.PERSISTENT],
@@ -113,8 +104,6 @@ keys = {
"DragonCachedModel": [TxType.PERSISTENT],
"DragonCachedFP": [TxType.PERSISTENT],
"DragonCachedVIN": [TxType.PERSISTENT],
"DragonCachedCarFW": [TxType.PERSISTENT],
"DragonCachedSource": [TxType.PERSISTENT],
"DragonAllowGas": [TxType.PERSISTENT],
"DragonToyotaStockDSU": [TxType.PERSISTENT],
"DragonLatCtrl": [TxType.PERSISTENT],
@@ -151,20 +140,10 @@ keys = {
"DragonUIBlinker": [TxType.PERSISTENT],
"DragonEnableDriverMonitoring": [TxType.PERSISTENT],
"DragonCarModel": [TxType.PERSISTENT],
"DragonCarVIN": [TxType.PERSISTENT], #deprecated
"DragonCarVIN": [TxType.PERSISTENT],
"DragonEnableSlowOnCurve": [TxType.PERSISTENT],
"DragonEnableLeadCarMovingAlert": [TxType.PERSISTENT],
"DragonToyotaSnGMod": [TxType.PERSISTENT],
"DragonEnableSRLearner": [TxType.PERSISTENT],
"DragonWazeMode": [TxType.PERSISTENT],
"DragonRunWaze": [TxType.PERSISTENT],
"DragonEnableAssistedLC": [TxType.PERSISTENT],
"DragonEnableAutoLC": [TxType.PERSISTENT],
"DragonAssistedLCMinMPH": [TxType.PERSISTENT],
"DragonAutoLCMinMPH": [TxType.PERSISTENT],
"DragonAutoLCDelay": [TxType.PERSISTENT],
"DragonBTG": [TxType.PERSISTENT],
"DragonBootHotspot": [TxType.PERSISTENT],
}
@@ -384,7 +363,7 @@ def write_db(params_path, key, value):
lock.release()
class Params():
def __init__(self, db=PARAMS):
def __init__(self, db='/data/params'):
self.db = db
# create the database if it doesn't exist...
@@ -392,11 +371,6 @@ class Params():
with self.transaction(write=True):
pass
def clear_all(self):
shutil.rmtree(self.db, ignore_errors=True)
with self.transaction(write=True):
pass
def transaction(self, write=False):
if write:
return DBWriter(self.db)
+9 -1
View File
@@ -6,12 +6,20 @@ import subprocess
import multiprocessing
from cffi import FFI
from common.common_pyx import sec_since_boot # pylint: disable=no-name-in-module, import-error
# Build and load cython module
import pyximport
installer = pyximport.install(inplace=True, build_dir='/tmp')
from common.clock import monotonic_time, sec_since_boot # pylint: disable=no-name-in-module, import-error
pyximport.uninstall(*installer)
assert monotonic_time
assert sec_since_boot
# time step for each process
DT_CTRL = 0.01 # controlsd
DT_PLAN = 0.05 # mpc
DT_MDL = 0.05 # model
DT_RDR = 0.05 # radar
DT_DMON = 0.1 # driver monitoring
DT_TRML = 0.5 # thermald and manager
+9 -44
View File
@@ -2,62 +2,27 @@ import os
import subprocess
from common.basedir import BASEDIR
class Spinner():
def __init__(self):
try:
self.spinner_proc = subprocess.Popen(["./spinner"],
stdin=subprocess.PIPE,
cwd=os.path.join(BASEDIR, "selfdrive", "ui", "spinner"),
close_fds=True)
except OSError:
self.spinner_proc = None
def __enter__(self):
self.spinner_proc = subprocess.Popen(["./spinner"],
stdin=subprocess.PIPE,
cwd=os.path.join(BASEDIR, "selfdrive", "ui", "spinner"),
close_fds=True)
return self
def update(self, spinner_text):
if self.spinner_proc is not None:
self.spinner_proc.stdin.write(spinner_text.encode('utf8') + b"\n")
try:
self.spinner_proc.stdin.flush()
except BrokenPipeError:
pass
def close(self):
if self.spinner_proc is not None:
try:
self.spinner_proc.stdin.close()
except BrokenPipeError:
pass
self.spinner_proc.terminate()
self.spinner_proc = None
def __del__(self):
self.close()
self.spinner_proc.stdin.write(spinner_text.encode('utf8') + b"\n")
self.spinner_proc.stdin.flush()
def __exit__(self, type, value, traceback):
self.close()
self.spinner_proc.stdin.close()
self.spinner_proc.terminate()
class FakeSpinner():
def __init__(self):
pass
def __enter__(self):
return self
def update(self, _):
pass
def __exit__(self, type, value, traceback):
pass
if __name__ == "__main__":
import time
with Spinner() as s:
s.update("Spinner text")
time.sleep(5.0)
print("gone")
time.sleep(5.0)
+33 -10
View File
@@ -44,7 +44,6 @@ def get_calib_from_vp(vp):
roll_calib = 0
return roll_calib, pitch_calib, yaw_calib
# aka 'extrinsic_matrix'
# road : x->forward, y -> left, z->up
def get_view_frame_from_road_frame(roll, pitch, yaw, height):
@@ -62,13 +61,6 @@ def vp_from_ke(m):
"""
return (m[0, 0]/m[2,0], m[1,0]/m[2,0])
def vp_from_rpy(rpy):
e = get_view_frame_from_road_frame(rpy[0], rpy[1], rpy[2], 1.22)
ke = np.dot(eon_intrinsics, e)
return vp_from_ke(ke)
def roll_from_ke(m):
# note: different from calibration.h/RollAnglefromKE: i think that one's just wrong
return np.arctan2(-(m[1, 0] - m[1, 1] * m[2, 0] / m[2, 1]),
@@ -131,6 +123,37 @@ def img_from_device(pt_device):
return pt_img.reshape(input_shape)[:,:2]
#TODO please use generic img transform below
def rotate_img(img, eulers, crop=None, intrinsics=eon_intrinsics):
import cv2 # pylint: disable=no-name-in-module, import-error
size = img.shape[:2]
rot = orient.rot_from_euler(eulers)
quadrangle = np.array([[0, 0],
[size[1]-1, 0],
[0, size[0]-1],
[size[1]-1, size[0]-1]], dtype=np.float32)
quadrangle_norm = np.hstack((normalize(quadrangle, intrinsics=intrinsics), np.ones((4,1))))
warped_quadrangle_full = np.einsum('ij, kj->ki', intrinsics.dot(rot), quadrangle_norm)
warped_quadrangle = np.column_stack((warped_quadrangle_full[:,0]/warped_quadrangle_full[:,2],
warped_quadrangle_full[:,1]/warped_quadrangle_full[:,2])).astype(np.float32)
if crop:
W_border = (size[1] - crop[0])//2
H_border = (size[0] - crop[1])//2
outside_crop = (((warped_quadrangle[:,0] < W_border) |
(warped_quadrangle[:,0] >= size[1] - W_border)) &
((warped_quadrangle[:,1] < H_border) |
(warped_quadrangle[:,1] >= size[0] - H_border)))
if not outside_crop.all():
raise ValueError("warped image not contained inside crop")
else:
H_border, W_border = 0, 0
M = cv2.getPerspectiveTransform(quadrangle, warped_quadrangle)
img_warped = cv2.warpPerspective(img, M, size[::-1])
return img_warped[H_border: size[0] - H_border,
W_border: size[1] - W_border]
def get_camera_frame_from_calib_frame(camera_frame_from_road_frame):
camera_frame_from_ground = camera_frame_from_road_frame[:, (0, 1, 3)]
calib_frame_from_ground = np.dot(eon_intrinsics,
@@ -160,7 +183,7 @@ def transform_img(base_img,
alpha=1.0,
beta=0,
blur=0):
import cv2 # pylint: disable=import-error
import cv2 # pylint: disable=no-name-in-module, import-error
cv2.setNumThreads(1)
if yuv:
@@ -218,7 +241,7 @@ def transform_img(base_img,
def yuv_crop(frame, output_size, center=None):
# output_size in camera coordinates so u,v
# center in array coordinates so row, column
import cv2 # pylint: disable=import-error
import cv2 # pylint: disable=no-name-in-module, import-error
rgb = cv2.cvtColor(frame, cv2.COLOR_YUV2RGB_I420)
if not center:
center = (rgb.shape[0]/2, rgb.shape[1]/2)
+5 -5
View File
@@ -1,7 +1,7 @@
{
"ota_url": "http://dpp.cool/neosupdate/ota-signed-efdf7de63b1aef63d68301e6175930991bf9a5927d16ec6fcc69287e2ee7ca4a.zip",
"ota_hash": "efdf7de63b1aef63d68301e6175930991bf9a5927d16ec6fcc69287e2ee7ca4a",
"recovery_url": "http://dpp.cool/neosupdate/recovery-97c27e6ed04ed6bb0608b845a2d4100912093f9380c3f2ba6b56bccd608e5f6e.img",
"recovery_len": 15861036,
"recovery_hash": "97c27e6ed04ed6bb0608b845a2d4100912093f9380c3f2ba6b56bccd608e5f6e"
"ota_url": "https://commadist.azureedge.net/neosupdate/ota-signed-7a0117425bc4a6673958d265312994e124654a566228f3cec2f0f9bc8120a9ab.zip",
"ota_hash": "7a0117425bc4a6673958d265312994e124654a566228f3cec2f0f9bc8120a9ab",
"recovery_url": "https://commadist.azureedge.net/neosupdate/recovery-3dc234d868c29a3739f6ca3bd47b1c2d3c570d9f478b6849a4fada129ee4af76.img",
"recovery_len": 15848748,
"recovery_hash": "3dc234d868c29a3739f6ca3bd47b1c2d3c570d9f478b6849a4fada129ee4af76"
}
+4 -2
View File
@@ -155,6 +155,8 @@ struct Updater {
TouchState touch;
int fb_w, fb_h;
EGLDisplay display;
EGLSurface surface;
FramebufferState *fb = NULL;
NVGcontext *vg = NULL;
@@ -196,7 +198,7 @@ struct Updater {
touch_init(&touch);
fb = framebuffer_init("updater", 0x00001000, false,
&fb_w, &fb_h);
&display, &surface, &fb_w, &fb_h);
assert(fb);
vg = nvgCreateGLES3(NVG_ANTIALIAS | NVG_STENCIL_STROKES | NVG_DEBUG);
@@ -706,7 +708,7 @@ struct Updater {
glDisable(GL_BLEND);
framebuffer_swap(fb);
eglSwapBuffers(display, surface);
assert(glGetError() == GL_NO_ERROR);
+18 -46
View File
@@ -6,54 +6,26 @@ export NUMEXPR_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
export VECLIB_MAXIMUM_THREADS=1
if [ -z "$BASEDIR" ]; then
BASEDIR="/data/openpilot"
fi
if [ -z "$PASSIVE" ]; then
export PASSIVE="1"
fi
STAGING_ROOT="/data/safe_staging"
function launch {
# Wifi scan
wpa_cli IFNAME=wlan0 SCAN
# Check to see if there's a valid overlay-based update available. Conditions
# are as follows:
#
# 1. The BASEDIR init file has to exist, with a newer modtime than anything in
# the BASEDIR Git repo. This checks for local development work or the user
# switching branches/forks, which should not be overwritten.
# 2. The FINALIZED consistent file has to exist, indicating there's an update
# that completed successfully and synced to disk.
if [ -f "${BASEDIR}/.overlay_init" ]; then
find ${BASEDIR}/.git -newer ${BASEDIR}/.overlay_init | grep -q '.' 2> /dev/null
if [ $? -eq 0 ]; then
echo "${BASEDIR} has been modified, skipping overlay update installation"
else
if [ -f "${STAGING_ROOT}/finalized/.overlay_consistent" ]; then
if [ ! -d /data/safe_staging/old_openpilot ]; then
echo "Valid overlay update found, installing"
LAUNCHER_LOCATION="${BASH_SOURCE[0]}"
mv $BASEDIR /data/safe_staging/old_openpilot
mv "${STAGING_ROOT}/finalized" $BASEDIR
# The mv changed our working directory to /data/safe_staging/old_openpilot
cd "${BASEDIR}"
echo "Restarting launch script ${LAUNCHER_LOCATION}"
exec "${LAUNCHER_LOCATION}"
else
echo "openpilot backup found, not updating"
# TODO: restore backup? This means the updater didn't start after swapping
fi
fi
fi
fi
# apply update
# if [ "$(git rev-parse HEAD)" != "$(git rev-parse @{u})" ]; then
# git reset --hard @{u} &&
# git clean -xdf &&
#
# # Touch all files on release2 after checkout to prevent rebuild
# BRANCH=$(git rev-parse --abbrev-ref HEAD)
# if [[ "$BRANCH" == "release2" ]]; then
# touch **
# fi
#
# exec "${BASH_SOURCE[0]}"
# fi
chmod 700 reset_update.sh
chmod 700 update_panda_firmware.sh
# no cpu rationing for now
echo 0-3 > /dev/cpuset/background/cpus
@@ -65,23 +37,23 @@ function launch {
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
# Remove old NEOS update file
# TODO: move this code to the updater
if [ -d /data/neoupdate ]; then
rm -rf /data/neoupdate
fi
# Check for NEOS update
if [ $(< /VERSION) != "14" ]; then
if [ $(< /VERSION) != "12" ]; then
if [ -f "$DIR/scripts/continue.sh" ]; then
cp "$DIR/scripts/continue.sh" "/data/data/com.termux/files/continue.sh"
fi
git clean -xdf
"$DIR/installer/updater/updater" "file://$DIR/installer/updater/update.json"
fi
# handle pythonpath
ln -sfn $(pwd) /data/pythonpath
ln -s /data/openpilot /data/pythonpath
export PYTHONPATH="$PWD"
# start manager
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-11
View File
@@ -1,13 +1,2 @@
*.pyc
*.os
*.tmp
*.dylib
.*.swp
.DS_Store
can/*.so
can/build/
can/obj/
can/packer_pyx.cpp
can/parser_pyx.cpp
can/packer_impl.cpp
-25
View File
@@ -1,25 +0,0 @@
from ubuntu:16.04
RUN apt-get update && apt-get install -y libzmq3-dev clang wget git autoconf libtool curl make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl
RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
ENV PATH="/root/.pyenv/bin:/root/.pyenv/shims:${PATH}"
RUN pyenv install 3.7.3
RUN pyenv global 3.7.3
RUN pyenv rehash
COPY requirements.txt /tmp/
RUN pip install -r /tmp/requirements.txt
ENV PYTHONPATH=/project
# TODO: Add tag to cereal
RUN git clone https://github.com/commaai/cereal.git /project/cereal
RUN /project/cereal/install_capnp.sh
WORKDIR /project
COPY SConstruct .
COPY . /project/opendbc
RUN scons -c && scons -j$(nproc)
+1 -4
View File
@@ -16,9 +16,6 @@ Wondering what's the DBC file format? [Here](http://www.socialledge.com/sjsu/ind
Use [panda](https://github.com/commaai/panda) to connect your car to a computer.
### How to use reverse engineered DBC
To create custom CAN simulations or send reverse engineered signals back to the car you can use [CANdevStudio](https://github.com/GENIVI/CANdevStudio) project.
### DBC file preprocessor
DBC files for different models of the same brand have a lot of overlap. Therefore, we wrote a preprocessor to create DBC files from a brand DBC file and a model specific DBC file. The source DBC files can be found in the generator folder. After changing one of the files run the generator.py script to regenerate the output files. These output files will be placed in the root of the opendbc repository and are suffixed by _generated.
@@ -45,7 +42,7 @@ For example:
SG_ VEHICLE_SPEED : 7|15@0+ (0.01,0) [0|250] "kph" PCM
```
- Signal size: always use the smallest amount of bits possible. For example, let's say I'm reverse engineering the gas pedal position and I've determined that it's in a 3 bytes message. For 0% pedal position I read a message value of `0x00 0x00 0x00`, while for 100% of pedal position I read `0x64 0x00 0x00`: clearly, the gas pedal position is within the first byte of the message and I might be tempted to define the signal `GAS_POS` as:
- Signal's size: always use the smallest amount of bits possible. For example, let's say I'm reverse engineering the gas pedal position and I've determined that it's in a 3 bytes message. For 0% pedal position I read a message value of `0x00 0x00 0x00`, while for 100% of pedal position I read `0x64 0x00 0x00`: clearly, the gas pedal position is within the first byte of the message and I might be tempted to define the signal `GAS_POS` as:
```
SG_ GAS_POS : 7|8@0+ (1,0) [0|100] "%" PCM
```
-57
View File
@@ -1,57 +0,0 @@
import os
import subprocess
zmq = 'zmq'
arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
cereal_dir = Dir('.')
cpppath = [
'#',
'#cereal',
"#cereal/messaging",
"#opendbc/can",
'/usr/lib/include',
]
AddOption('--test',
action='store_true',
help='build test files')
AddOption('--asan',
action='store_true',
help='turn on ASAN')
ccflags_asan = ["-fsanitize=address", "-fno-omit-frame-pointer"] if GetOption('asan') else []
ldflags_asan = ["-fsanitize=address"] if GetOption('asan') else []
env = Environment(
ENV=os.environ,
CC='clang',
CXX='clang++',
CCFLAGS=[
"-g",
"-fPIC",
"-O2",
"-Werror=implicit-function-declaration",
"-Werror=incompatible-pointer-types",
"-Werror=int-conversion",
"-Werror=return-type",
"-Werror=format-extra-args",
] + ccflags_asan,
LDFLAGS=ldflags_asan,
LINKFLAGS=ldflags_asan,
CFLAGS="-std=gnu11",
CXXFLAGS="-std=c++14",
CPPPATH=cpppath,
)
Export('env', 'zmq', 'arch')
cereal = [File('#cereal/libcereal.a')]
messaging = [File('#cereal/libmessaging.a')]
Export('cereal', 'messaging')
SConscript(['cereal/SConscript'])
SConscript(['opendbc/can/SConscript'])
+5 -15
View File
@@ -86,13 +86,6 @@ BO_ 420 VSA_STATUS: 8 VSA
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
BO_ 427 STEER_MOTOR_TORQUE: 3 EPS
SG_ CONFIG_VALID : 7|1@0+ (1,0) [0|1] "" EON
SG_ MOTOR_TORQUE : 1|10@0+ (1,0) [0|256] "" EON
SG_ OUTPUT_DISABLED : 22|1@0+ (1,0) [0|1] "" EON
SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" EON
BO_ 432 STANDSTILL: 7 VSA
SG_ CONTROLLED_STANDSTILL : 0|1@0+ (1,0) [0|1] "" EON
SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" EON
@@ -171,7 +164,7 @@ BO_ 780 ACC_HUD: 8 ADAS
SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY
SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY
SG_ FCM_OFF : 36|1@0+ (1,0) [0|1] "" BDY
SG_ FCM_OFF_2 : 35|1@0+ (1,0) [0|1] "" BDY
SG_ BOH_2 : 35|1@0+ (1,0) [0|1] "" BDY
SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY
SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY
SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY
@@ -181,12 +174,10 @@ BO_ 780 ACC_HUD: 8 ADAS
SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY
SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY
SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY
SG_ SET_ME_X01_2 : 55|1@0+ (1,0) [0|1] "" BDY
SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" BDY
SG_ HUD_DISTANCE_3 : 52|1@0+ (1,0) [0|1] "" BDY
SG_ CHIME : 51|3@0+ (1,0) [0|1] "" BDY
SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" BDY
SG_ SET_ME_X01_2 : 55|1@0+ (1,0) [0|1] "" BDY
SG_ SET_ME_X01 : 48|1@0+ (1,0) [0|1] "" BDY
SG_ ICONS : 63|2@0+ (1,0) [0|1] "" BDY
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" BDY
@@ -280,11 +271,10 @@ BO_ 342 STEERING_SENSORS: 6 EPS
SG_ CHECKSUM : 43|4@0+ (1,0) [0|3] "" EON
BO_ 399 STEER_STATUS: 7 EPS
SG_ STEER_TORQUE_SENSOR : 7|16@0- (-1,0) [-31000|31000] "tbd" EON
SG_ STEER_ANGLE_RATE : 23|16@0- (-0.1,0) [-31000|31000] "deg/s" EON
SG_ STEER_TORQUE_SENSOR : 7|16@0- (1,0) [-31000|31000] "tbd" EON
SG_ STEER_TORQUE_MOTOR : 23|16@0- (1,0) [-31000|31000] "tbd" EON
SG_ STEER_STATUS : 39|4@0+ (1,0) [0|15] "" EON
SG_ STEER_CONTROL_ACTIVE : 35|1@0+ (1,0) [0|1] "" EON
SG_ STEER_CONFIG_INDEX : 43|4@0+ (1,0) [0|15] "" EON
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON
+5 -14
View File
@@ -86,13 +86,6 @@ BO_ 420 VSA_STATUS: 8 VSA
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
BO_ 427 STEER_MOTOR_TORQUE: 3 EPS
SG_ CONFIG_VALID : 7|1@0+ (1,0) [0|1] "" EON
SG_ MOTOR_TORQUE : 1|10@0+ (1,0) [0|256] "" EON
SG_ OUTPUT_DISABLED : 22|1@0+ (1,0) [0|1] "" EON
SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" EON
BO_ 432 STANDSTILL: 7 VSA
SG_ CONTROLLED_STANDSTILL : 0|1@0+ (1,0) [0|1] "" EON
SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" EON
@@ -171,7 +164,7 @@ BO_ 780 ACC_HUD: 8 ADAS
SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY
SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY
SG_ FCM_OFF : 36|1@0+ (1,0) [0|1] "" BDY
SG_ FCM_OFF_2 : 35|1@0+ (1,0) [0|1] "" BDY
SG_ BOH_2 : 35|1@0+ (1,0) [0|1] "" BDY
SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY
SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY
SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY
@@ -181,12 +174,10 @@ BO_ 780 ACC_HUD: 8 ADAS
SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY
SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY
SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY
SG_ SET_ME_X01_2 : 55|1@0+ (1,0) [0|1] "" BDY
SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" BDY
SG_ HUD_DISTANCE_3 : 52|1@0+ (1,0) [0|1] "" BDY
SG_ CHIME : 51|3@0+ (1,0) [0|1] "" BDY
SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" BDY
SG_ SET_ME_X01_2 : 55|1@0+ (1,0) [0|1] "" BDY
SG_ SET_ME_X01 : 48|1@0+ (1,0) [0|1] "" BDY
SG_ ICONS : 63|2@0+ (1,0) [0|1] "" BDY
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" BDY
@@ -268,8 +259,8 @@ BO_ 392 GEARBOX: 6 XXX
SG_ GEAR : 36|5@0+ (1,0) [0|31] "" EON
BO_ 399 STEER_STATUS: 6 EPS
SG_ STEER_TORQUE_SENSOR : 7|12@0- (-1,0) [-2047.5|2047.5] "tbd" EON
SG_ STEER_ANGLE_RATE : 23|16@0- (-0.1,0) [-31000|31000] "deg/s" EON
SG_ STEER_TORQUE_SENSOR : 7|12@0- (1,0) [-2047.5|2047.5] "tbd" EON
SG_ STEER_TORQUE_MOTOR : 23|16@0- (1,0) [-31000|31000] "tbd" EON
SG_ STEER_STATUS : 35|4@0+ (1,0) [0|15] "" EON
SG_ STEER_CONTROL_ACTIVE : 36|1@0+ (1,0) [0|1] "" EON
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON
-19
View File
@@ -1,19 +0,0 @@
pr: none
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: |
set -e
docker build -t opendbc .
displayName: 'Build'
- script: |
docker run opendbc bash -c "python -m unittest discover opendbc"
displayName: 'Unit tests'
- script: |
docker run opendbc bash -c "cd opendbc/can/tests/linter_python; PYTHONPATH=/ ./flake8_opendbc.sh"
docker run opendbc bash -c "cd opendbc/can/tests/linter_python; PYTHONPATH=/ ./pylint_opendbc.sh"
displayName: 'Python linter'
- script: |
docker run opendbc bash -c "cd opendbc/can/tests/; PYTHONPATH=/ ./test_generator.sh"
displayName: 'Generator test'
-27
View File
@@ -1,27 +0,0 @@
Import('env', 'cereal')
import os
from opendbc.can.process_dbc import process
dbcs = []
for x in sorted(os.listdir('../')):
if x.endswith(".dbc"):
def compile_dbc(target, source, env):
process(source[0].path, target[0].path)
in_fn = [os.path.join('../', x), 'dbc_template.cc']
out_fn = os.path.join('dbc_out', x.replace(".dbc", ".cc"))
dbc = env.Command(out_fn, in_fn, compile_dbc)
dbcs.append(dbc)
libdbc = env.SharedLibrary('libdbc', ["dbc.cc", "parser.cc", "packer.cc", "common.cc"]+dbcs, LIBS=["capnp", "kj"])
# packer
env.Command(['packer_pyx.so'],
[libdbc, 'packer_pyx.pyx', 'packer_pyx_setup.py'],
"cd opendbc/can && python3 packer_pyx_setup.py build_ext --inplace")
# parser
env.Command(['parser_pyx.so'],
[libdbc, cereal, 'parser_pyx_setup.py', 'parser_pyx.pyx', 'common.pxd'],
"cd opendbc/can && python3 parser_pyx_setup.py build_ext --inplace")
-2
View File
@@ -1,2 +0,0 @@
from opendbc.can.parser_pyx import CANDefine # pylint: disable=no-name-in-module, import-error
assert CANDefine
-165
View File
@@ -1,165 +0,0 @@
#include "common.h"
unsigned int honda_checksum(unsigned int address, uint64_t d, int l) {
d >>= ((8-l)*8); // remove padding
d >>= 4; // remove checksum
int s = 0;
while (address) { s += (address & 0xF); address >>= 4; }
while (d) { s += (d & 0xF); d >>= 4; }
s = 8-s;
s &= 0xF;
return s;
}
unsigned int toyota_checksum(unsigned int address, uint64_t d, int l) {
d >>= ((8-l)*8); // remove padding
d >>= 8; // remove checksum
unsigned int s = l;
while (address) { s += address & 0xff; address >>= 8; }
while (d) { s += d & 0xff; d >>= 8; }
return s & 0xFF;
}
// Static lookup table for fast computation of CRC8 poly 0x2F, aka 8H2F/AUTOSAR
uint8_t crc8_lut_8h2f[256];
void gen_crc_lookup_table(uint8_t poly, uint8_t crc_lut[]) {
uint8_t crc;
int i, j;
for (i = 0; i < 256; i++) {
crc = i;
for (j = 0; j < 8; j++) {
if ((crc & 0x80) != 0)
crc = (uint8_t)((crc << 1) ^ poly);
else
crc <<= 1;
}
crc_lut[i] = crc;
}
}
void init_crc_lookup_tables() {
// At init time, set up static lookup tables for fast CRC computation.
gen_crc_lookup_table(0x2F, crc8_lut_8h2f); // CRC-8 8H2F/AUTOSAR for Volkswagen
}
unsigned int volkswagen_crc(unsigned int address, uint64_t d, int l) {
// Volkswagen uses standard CRC8 8H2F/AUTOSAR, but they compute it with
// a magic variable padding byte tacked onto the end of the payload.
// https://www.autosar.org/fileadmin/user_upload/standards/classic/4-3/AUTOSAR_SWS_CRCLibrary.pdf
uint8_t *dat = (uint8_t *)&d;
uint8_t crc = 0xFF; // Standard init value for CRC8 8H2F/AUTOSAR
// CRC the payload first, skipping over the first byte where the CRC lives.
for (int i = 1; i < l; i++) {
crc ^= dat[i];
crc = crc8_lut_8h2f[crc];
}
// Look up and apply the magic final CRC padding byte, which permutes by CAN
// address, and additionally (for SOME addresses) by the message counter.
uint8_t counter = dat[1] & 0x0F;
switch(address) {
case 0x86: // LWI_01 Steering Angle
crc ^= (uint8_t[]){0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86}[counter];
break;
case 0x9F: // EPS_01 Electric Power Steering
crc ^= (uint8_t[]){0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5}[counter];
break;
case 0xAD: // Getriebe_11 Automatic Gearbox
crc ^= (uint8_t[]){0x3F,0x69,0x39,0xDC,0x94,0xF9,0x14,0x64,0xD8,0x6A,0x34,0xCE,0xA2,0x55,0xB5,0x2C}[counter];
break;
case 0xFD: // ESP_21 Electronic Stability Program
crc ^= (uint8_t[]){0xB4,0xEF,0xF8,0x49,0x1E,0xE5,0xC2,0xC0,0x97,0x19,0x3C,0xC9,0xF1,0x98,0xD6,0x61}[counter];
break;
case 0x106: // ESP_05 Electronic Stability Program
crc ^= (uint8_t[]){0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07}[counter];
break;
case 0x117: // ACC_10 Automatic Cruise Control
crc ^= (uint8_t[]){0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC}[counter];
break;
case 0x122: // ACC_06 Automatic Cruise Control
crc ^= (uint8_t[]){0x37,0x7D,0xF3,0xA9,0x18,0x46,0x6D,0x4D,0x3D,0x71,0x92,0x9C,0xE5,0x32,0x10,0xB9}[counter];
break;
case 0x126: // HCA_01 Heading Control Assist
crc ^= (uint8_t[]){0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA}[counter];
break;
case 0x12B: // GRA_ACC_01 Steering wheel controls for ACC
crc ^= (uint8_t[]){0x6A,0x38,0xB4,0x27,0x22,0xEF,0xE1,0xBB,0xF8,0x80,0x84,0x49,0xC7,0x9E,0x1E,0x2B}[counter];
break;
case 0x187: // EV_Gearshift "Gear" selection data for EVs with no gearbox
crc ^= (uint8_t[]){0x7F,0xED,0x17,0xC2,0x7C,0xEB,0x44,0x21,0x01,0xFA,0xDB,0x15,0x4A,0x6B,0x23,0x05}[counter];
break;
case 0x30C: // ACC_02 Automatic Cruise Control
crc ^= (uint8_t[]){0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F}[counter];
break;
case 0x3C0: // Klemmen_Status_01 ignition and starting status
crc ^= (uint8_t[]){0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3}[counter];
break;
case 0x65D: // ESP_20 Electronic Stability Program
crc ^= (uint8_t[]){0xAC,0xB3,0xAB,0xEB,0x7A,0xE1,0x3B,0xF7,0x73,0xBA,0x7C,0x9E,0x06,0x5F,0x02,0xD9}[counter];
break;
default: // As-yet undefined CAN message, CRC check expected to fail
printf("Attempt to CRC check undefined Volkswagen message 0x%02X\n", address);
crc ^= (uint8_t[]){0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}[counter];
break;
}
crc = crc8_lut_8h2f[crc];
return crc ^ 0xFF; // Return after standard final XOR for CRC8 8H2F/AUTOSAR
}
unsigned int pedal_checksum(uint64_t d, int l) {
uint8_t crc = 0xFF;
uint8_t poly = 0xD5; // standard crc8
d >>= ((8-l)*8); // remove padding
d >>= 8; // remove checksum
uint8_t *dat = (uint8_t *)&d;
int i, j;
for (i = 0; i < l - 1; i++) {
crc ^= dat[i];
for (j = 0; j < 8; j++) {
if ((crc & 0x80) != 0) {
crc = (uint8_t)((crc << 1) ^ poly);
}
else {
crc <<= 1;
}
}
}
return crc;
}
uint64_t read_u64_be(const uint8_t* v) {
return (((uint64_t)v[0] << 56)
| ((uint64_t)v[1] << 48)
| ((uint64_t)v[2] << 40)
| ((uint64_t)v[3] << 32)
| ((uint64_t)v[4] << 24)
| ((uint64_t)v[5] << 16)
| ((uint64_t)v[6] << 8)
| (uint64_t)v[7]);
}
uint64_t read_u64_le(const uint8_t* v) {
return ((uint64_t)v[0]
| ((uint64_t)v[1] << 8)
| ((uint64_t)v[2] << 16)
| ((uint64_t)v[3] << 24)
| ((uint64_t)v[4] << 32)
| ((uint64_t)v[5] << 40)
| ((uint64_t)v[6] << 48)
| ((uint64_t)v[7] << 56));
}
-70
View File
@@ -1,70 +0,0 @@
#pragma once
#include <vector>
#include <map>
#include <unordered_map>
#include "common_dbc.h"
#include <capnp/serialize.h>
#include "cereal/gen/cpp/log.capnp.h"
#define MAX_BAD_COUNTER 5
// Helper functions
unsigned int honda_checksum(unsigned int address, uint64_t d, int l);
unsigned int toyota_checksum(unsigned int address, uint64_t d, int l);
void init_crc_lookup_tables();
unsigned int volkswagen_crc(unsigned int address, uint64_t d, int l);
unsigned int pedal_checksum(uint64_t d, int l);
uint64_t read_u64_be(const uint8_t* v);
uint64_t read_u64_le(const uint8_t* v);
class MessageState {
public:
uint32_t address;
unsigned int size;
std::vector<Signal> parse_sigs;
std::vector<double> vals;
uint16_t ts;
uint64_t seen;
uint64_t check_threshold;
uint8_t counter;
uint8_t counter_fail;
bool parse(uint64_t sec, uint16_t ts_, uint8_t * dat);
bool update_counter_generic(int64_t v, int cnt_size);
};
class CANParser {
private:
const int bus;
const DBC *dbc = NULL;
std::unordered_map<uint32_t, MessageState> message_states;
public:
bool can_valid = false;
uint64_t last_sec = 0;
CANParser(int abus, const std::string& dbc_name,
const std::vector<MessageParseOptions> &options,
const std::vector<SignalParseOptions> &sigoptions);
void UpdateCans(uint64_t sec, const capnp::List<cereal::CanData>::Reader& cans);
void UpdateValid(uint64_t sec);
void update_string(std::string data, bool sendcan);
std::vector<SignalValue> query_latest();
};
class CANPacker {
private:
const DBC *dbc = NULL;
std::map<std::pair<uint32_t, std::string>, Signal> signal_lookup;
std::map<uint32_t, Msg> message_lookup;
public:
CANPacker(const std::string& dbc_name);
uint64_t pack(uint32_t address, const std::vector<SignalPackValue> &signals, int counter);
};
-82
View File
@@ -1,82 +0,0 @@
# distutils: language = c++
#cython: language_level=3
from libc.stdint cimport uint32_t, uint64_t, uint16_t
from libcpp.vector cimport vector
from libcpp.map cimport map
from libcpp.string cimport string
from libcpp.unordered_set cimport unordered_set
from libcpp cimport bool
cdef extern from "common_dbc.h":
ctypedef enum SignalType:
DEFAULT,
HONDA_CHECKSUM,
HONDA_COUNTER,
TOYOTA_CHECKSUM,
PEDAL_CHECKSUM,
PEDAL_COUNTER,
VOLKSWAGEN_CHECKSUM,
VOLKSWAGEN_COUNTER
cdef struct Signal:
const char* name
int b1, b2, bo
bool is_signed
double factor, offset
SignalType type
cdef struct Msg:
const char* name
uint32_t address
unsigned int size
size_t num_sigs
const Signal *sigs
cdef struct Val:
const char* name
uint32_t address
const char* def_val
const Signal *sigs
cdef struct DBC:
const char* name
size_t num_msgs
const Msg *msgs
const Val *vals
size_t num_vals
cdef struct SignalParseOptions:
uint32_t address
const char* name
double default_value
cdef struct MessageParseOptions:
uint32_t address
int check_frequency
cdef struct SignalValue:
uint32_t address
uint16_t ts
const char* name
double value
cdef struct SignalPackValue:
const char * name
double value
cdef extern from "common.h":
cdef const DBC* dbc_lookup(const string);
cdef cppclass CANParser:
bool can_valid
CANParser(int, string, vector[MessageParseOptions], vector[SignalParseOptions])
void update_string(string, bool)
vector[SignalValue] query_latest()
cdef cppclass CANPacker:
CANPacker(string)
uint64_t pack(uint32_t, vector[SignalPackValue], int counter)
-108
View File
@@ -1,108 +0,0 @@
#include <cassert>
#include <utility>
#include <algorithm>
#include <map>
#include <cmath>
#include "common.h"
#define WARN printf
// this is the same as read_u64_le, but uses uint64_t as in/out
uint64_t ReverseBytes(uint64_t x) {
return ((x & 0xff00000000000000ull) >> 56) |
((x & 0x00ff000000000000ull) >> 40) |
((x & 0x0000ff0000000000ull) >> 24) |
((x & 0x000000ff00000000ull) >> 8) |
((x & 0x00000000ff000000ull) << 8) |
((x & 0x0000000000ff0000ull) << 24) |
((x & 0x000000000000ff00ull) << 40) |
((x & 0x00000000000000ffull) << 56);
}
uint64_t set_value(uint64_t ret, Signal sig, int64_t ival){
int shift = sig.is_little_endian? sig.b1 : sig.bo;
uint64_t mask = ((1ULL << sig.b2)-1) << shift;
uint64_t dat = (ival & ((1ULL << sig.b2)-1)) << shift;
if (sig.is_little_endian) {
dat = ReverseBytes(dat);
mask = ReverseBytes(mask);
}
ret &= ~mask;
ret |= dat;
return ret;
}
CANPacker::CANPacker(const std::string& dbc_name) {
dbc = dbc_lookup(dbc_name);
assert(dbc);
for (int i=0; i<dbc->num_msgs; i++) {
const Msg* msg = &dbc->msgs[i];
message_lookup[msg->address] = *msg;
for (int j=0; j<msg->num_sigs; j++) {
const Signal* sig = &msg->sigs[j];
signal_lookup[std::make_pair(msg->address, std::string(sig->name))] = *sig;
}
}
init_crc_lookup_tables();
}
uint64_t CANPacker::pack(uint32_t address, const std::vector<SignalPackValue> &signals, int counter) {
uint64_t ret = 0;
for (const auto& sigval : signals) {
std::string name = std::string(sigval.name);
double value = sigval.value;
auto sig_it = signal_lookup.find(std::make_pair(address, name));
if (sig_it == signal_lookup.end()) {
WARN("undefined signal %s - %d\n", name.c_str(), address);
continue;
}
auto sig = sig_it->second;
int64_t ival = (int64_t)(round((value - sig.offset) / sig.factor));
if (ival < 0) {
ival = (1ULL << sig.b2) + ival;
}
ret = set_value(ret, sig, ival);
}
if (counter >= 0){
auto sig_it = signal_lookup.find(std::make_pair(address, "COUNTER"));
if (sig_it == signal_lookup.end()) {
WARN("COUNTER not defined\n");
return ret;
}
auto sig = sig_it->second;
if ((sig.type != SignalType::HONDA_COUNTER) && (sig.type != SignalType::VOLKSWAGEN_COUNTER)) {
WARN("COUNTER signal type not valid\n");
}
ret = set_value(ret, sig, counter);
}
auto sig_it_checksum = signal_lookup.find(std::make_pair(address, "CHECKSUM"));
if (sig_it_checksum != signal_lookup.end()) {
auto sig = sig_it_checksum->second;
if (sig.type == SignalType::HONDA_CHECKSUM) {
unsigned int chksm = honda_checksum(address, ret, message_lookup[address].size);
ret = set_value(ret, sig, chksm);
} else if (sig.type == SignalType::TOYOTA_CHECKSUM) {
unsigned int chksm = toyota_checksum(address, ret, message_lookup[address].size);
ret = set_value(ret, sig, chksm);
} else if (sig.type == SignalType::VOLKSWAGEN_CHECKSUM) {
// FIXME: Hackish fix for an endianness issue. The message is in reverse byte order
// until later in the pack process. Checksums can be run backwards, CRCs not so much.
// The correct fix is unclear but this works for the moment.
unsigned int chksm = volkswagen_crc(address, ReverseBytes(ret), message_lookup[address].size);
ret = set_value(ret, sig, chksm);
} else {
//WARN("CHECKSUM signal type not valid\n");
}
}
return ret;
}
-3
View File
@@ -1,3 +0,0 @@
# pylint: skip-file
from opendbc.can.packer_pyx import CANPacker
assert CANPacker
-67
View File
@@ -1,67 +0,0 @@
# distutils: language = c++
# cython: c_string_encoding=ascii, language_level=3
from libc.stdint cimport uint32_t, uint64_t
from libcpp.vector cimport vector
from libcpp.map cimport map
from libcpp.string cimport string
from libcpp cimport bool
from posix.dlfcn cimport dlopen, dlsym, RTLD_LAZY
from common cimport CANPacker as cpp_CANPacker
from common cimport dbc_lookup, SignalPackValue, DBC
cdef class CANPacker:
cdef:
cpp_CANPacker *packer
const DBC *dbc
map[string, (int, int)] name_to_address_and_size
map[int, int] address_to_size
def __init__(self, dbc_name):
self.packer = new cpp_CANPacker(dbc_name)
self.dbc = dbc_lookup(dbc_name)
num_msgs = self.dbc[0].num_msgs
for i in range(num_msgs):
msg = self.dbc[0].msgs[i]
self.name_to_address_and_size[string(msg.name)] = (msg.address, msg.size)
self.address_to_size[msg.address] = msg.size
cdef uint64_t pack(self, addr, values, counter):
cdef vector[SignalPackValue] values_thing
cdef SignalPackValue spv
names = []
for name, value in values.iteritems():
n = name.encode('utf8')
names.append(n) # TODO: find better way to keep reference to temp string arround
spv.name = n
spv.value = value
values_thing.push_back(spv)
return self.packer.pack(addr, values_thing, counter)
cdef inline uint64_t ReverseBytes(self, uint64_t x):
return (((x & 0xff00000000000000ull) >> 56) |
((x & 0x00ff000000000000ull) >> 40) |
((x & 0x0000ff0000000000ull) >> 24) |
((x & 0x000000ff00000000ull) >> 8) |
((x & 0x00000000ff000000ull) << 8) |
((x & 0x0000000000ff0000ull) << 24) |
((x & 0x000000000000ff00ull) << 40) |
((x & 0x00000000000000ffull) << 56))
cpdef make_can_msg(self, name_or_addr, bus, values, counter=-1):
cdef int addr, size
if type(name_or_addr) == int:
addr = name_or_addr
size = self.address_to_size[name_or_addr]
else:
addr, size = self.name_to_address_and_size[name_or_addr.encode('utf8')]
cdef uint64_t val = self.pack(addr, values, counter)
val = self.ReverseBytes(val)
return [addr, 0, (<char *>&val)[:size], bus]
-69
View File
@@ -1,69 +0,0 @@
import os
import sysconfig
import subprocess
import platform
from distutils.core import Extension, setup # pylint: disable=import-error,no-name-in-module
from Cython.Build import cythonize
from Cython.Distutils import build_ext
BASEDIR = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../"))
def get_ext_filename_without_platform_suffix(filename):
name, ext = os.path.splitext(filename)
ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
if ext_suffix == ext:
return filename
ext_suffix = ext_suffix.replace(ext, '')
idx = name.find(ext_suffix)
if idx == -1:
return filename
else:
return name[:idx] + ext
class BuildExtWithoutPlatformSuffix(build_ext):
def get_ext_filename(self, ext_name):
filename = super().get_ext_filename(ext_name)
return get_ext_filename_without_platform_suffix(filename)
sourcefiles = ['packer_pyx.pyx']
extra_compile_args = ["-std=c++11"]
ARCH = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip() # pylint: disable=unexpected-keyword-arg
if ARCH == "aarch64":
extra_compile_args += ["-Wno-deprecated-register"]
if platform.system() == "Darwin":
libdbc = "libdbc.dylib"
else:
libdbc = "libdbc.so"
setup(name='CAN packer',
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
ext_modules=cythonize(
Extension(
"packer_pyx",
language="c++",
sources=sourcefiles,
extra_compile_args=extra_compile_args,
include_dirs=[
BASEDIR,
os.path.join(BASEDIR, 'phonelibs', 'capnp-cpp/include'),
],
extra_link_args=[
os.path.join(BASEDIR, 'opendbc', 'can', libdbc),
],
)
),
nthreads=4,
)
if platform.system() == "Darwin":
os.system("install_name_tool -change opendbc/can/libdbc.dylib "+BASEDIR+"/opendbc/can/libdbc.dylib packer_pyx.so")
-239
View File
@@ -1,239 +0,0 @@
#include <cassert>
#include <cstring>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <algorithm>
#include "common.h"
#define DEBUG(...)
// #define DEBUG printf
#define INFO printf
bool MessageState::parse(uint64_t sec, uint16_t ts_, uint8_t * dat) {
uint64_t dat_le = read_u64_le(dat);
uint64_t dat_be = read_u64_be(dat);
for (int i=0; i < parse_sigs.size(); i++) {
auto& sig = parse_sigs[i];
int64_t tmp;
if (sig.is_little_endian){
tmp = (dat_le >> sig.b1) & ((1ULL << sig.b2)-1);
} else {
tmp = (dat_be >> sig.bo) & ((1ULL << sig.b2)-1);
}
if (sig.is_signed) {
tmp -= (tmp >> (sig.b2-1)) ? (1ULL << sig.b2) : 0; //signed
}
DEBUG("parse 0x%X %s -> %lld\n", address, sig.name, tmp);
if (sig.type == SignalType::HONDA_CHECKSUM) {
if (honda_checksum(address, dat_be, size) != tmp) {
INFO("0x%X CHECKSUM FAIL\n", address);
return false;
}
} else if (sig.type == SignalType::HONDA_COUNTER) {
if (!update_counter_generic(tmp, sig.b2)) {
return false;
}
} else if (sig.type == SignalType::TOYOTA_CHECKSUM) {
if (toyota_checksum(address, dat_be, size) != tmp) {
INFO("0x%X CHECKSUM FAIL\n", address);
return false;
}
} else if (sig.type == SignalType::VOLKSWAGEN_CHECKSUM) {
if (volkswagen_crc(address, dat_le, size) != tmp) {
INFO("0x%X CRC FAIL\n", address);
return false;
}
} else if (sig.type == SignalType::VOLKSWAGEN_COUNTER) {
if (!update_counter_generic(tmp, sig.b2)) {
return false;
}
} else if (sig.type == SignalType::PEDAL_CHECKSUM) {
if (pedal_checksum(dat_be, size) != tmp) {
INFO("0x%X PEDAL CHECKSUM FAIL\n", address);
return false;
}
} else if (sig.type == SignalType::PEDAL_COUNTER) {
if (!update_counter_generic(tmp, sig.b2)) {
return false;
}
}
vals[i] = tmp * sig.factor + sig.offset;
}
ts = ts_;
seen = sec;
return true;
}
bool MessageState::update_counter_generic(int64_t v, int cnt_size) {
uint8_t old_counter = counter;
counter = v;
if (((old_counter+1) & ((1 << cnt_size) -1)) != v) {
counter_fail += 1;
if (counter_fail > 1) {
INFO("0x%X COUNTER FAIL %d -- %d vs %d\n", address, counter_fail, old_counter, (int)v);
}
if (counter_fail >= MAX_BAD_COUNTER) {
return false;
}
} else if (counter_fail > 0) {
counter_fail--;
}
return true;
}
CANParser::CANParser(int abus, const std::string& dbc_name,
const std::vector<MessageParseOptions> &options,
const std::vector<SignalParseOptions> &sigoptions)
: bus(abus) {
dbc = dbc_lookup(dbc_name);
assert(dbc);
init_crc_lookup_tables();
for (const auto& op : options) {
MessageState state = {
.address = op.address,
// .check_frequency = op.check_frequency,
};
// msg is not valid if a message isn't received for 10 consecutive steps
if (op.check_frequency > 0) {
state.check_threshold = (1000000000ULL / op.check_frequency) * 10;
}
const Msg* msg = NULL;
for (int i=0; i<dbc->num_msgs; i++) {
if (dbc->msgs[i].address == op.address) {
msg = &dbc->msgs[i];
break;
}
}
if (!msg) {
fprintf(stderr, "CANParser: could not find message 0x%X in DBC %s\n", op.address, dbc_name.c_str());
assert(false);
}
state.size = msg->size;
// track checksums and counters for this message
for (int i=0; i<msg->num_sigs; i++) {
const Signal *sig = &msg->sigs[i];
if (sig->type != SignalType::DEFAULT) {
state.parse_sigs.push_back(*sig);
state.vals.push_back(0);
}
}
// track requested signals for this message
for (const auto& sigop : sigoptions) {
if (sigop.address != op.address) continue;
for (int i=0; i<msg->num_sigs; i++) {
const Signal *sig = &msg->sigs[i];
if (strcmp(sig->name, sigop.name) == 0
&& sig->type == SignalType::DEFAULT) {
state.parse_sigs.push_back(*sig);
state.vals.push_back(sigop.default_value);
break;
}
}
}
message_states[state.address] = state;
}
}
void CANParser::UpdateCans(uint64_t sec, const capnp::List<cereal::CanData>::Reader& cans) {
int msg_count = cans.size();
uint64_t p;
DEBUG("got %d messages\n", msg_count);
// parse the messages
for (int i = 0; i < msg_count; i++) {
auto cmsg = cans[i];
if (cmsg.getSrc() != bus) {
// DEBUG("skip %d: wrong bus\n", cmsg.getAddress());
continue;
}
auto state_it = message_states.find(cmsg.getAddress());
if (state_it == message_states.end()) {
// DEBUG("skip %d: not specified\n", cmsg.getAddress());
continue;
}
if (cmsg.getDat().size() > 8) continue; //shouldnt ever happen
uint8_t dat[8] = {0};
memcpy(dat, cmsg.getDat().begin(), cmsg.getDat().size());
state_it->second.parse(sec, cmsg.getBusTime(), dat);
}
}
void CANParser::UpdateValid(uint64_t sec) {
can_valid = true;
for (const auto& kv : message_states) {
const auto& state = kv.second;
if (state.check_threshold > 0 && (sec - state.seen) > state.check_threshold) {
if (state.seen > 0) {
DEBUG("0x%X TIMEOUT\n", state.address);
}
can_valid = false;
}
}
}
void CANParser::update_string(std::string data, bool sendcan) {
// format for board, make copy due to alignment issues, will be freed on out of scope
auto amsg = kj::heapArray<capnp::word>((data.length() / sizeof(capnp::word)) + 1);
memcpy(amsg.begin(), data.data(), data.length());
// extract the messages
capnp::FlatArrayMessageReader cmsg(amsg);
cereal::Event::Reader event = cmsg.getRoot<cereal::Event>();
last_sec = event.getLogMonoTime();
auto cans = sendcan? event.getSendcan() : event.getCan();
UpdateCans(last_sec, cans);
UpdateValid(last_sec);
}
std::vector<SignalValue> CANParser::query_latest() {
std::vector<SignalValue> ret;
for (const auto& kv : message_states) {
const auto& state = kv.second;
if (last_sec != 0 && state.seen != last_sec) continue;
for (int i=0; i<state.parse_sigs.size(); i++) {
const Signal &sig = state.parse_sigs[i];
ret.push_back((SignalValue){
.address = state.address,
.ts = state.ts,
.name = sig.name,
.value = state.vals[i],
});
}
}
return ret;
}
-2
View File
@@ -1,2 +0,0 @@
from opendbc.can.parser_pyx import CANParser # pylint: disable=no-name-in-module, import-error
assert CANParser
-69
View File
@@ -1,69 +0,0 @@
import os
import subprocess
import sysconfig
import platform
from distutils.core import Extension, setup # pylint: disable=import-error,no-name-in-module
from Cython.Build import cythonize
from Cython.Distutils import build_ext
BASEDIR = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../"))
def get_ext_filename_without_platform_suffix(filename):
name, ext = os.path.splitext(filename)
ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
if ext_suffix == ext:
return filename
ext_suffix = ext_suffix.replace(ext, '')
idx = name.find(ext_suffix)
if idx == -1:
return filename
else:
return name[:idx] + ext
class BuildExtWithoutPlatformSuffix(build_ext):
def get_ext_filename(self, ext_name):
filename = super().get_ext_filename(ext_name)
return get_ext_filename_without_platform_suffix(filename)
sourcefiles = ['parser_pyx.pyx']
extra_compile_args = ["-std=c++11"]
ARCH = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip() # pylint: disable=unexpected-keyword-arg
if ARCH == "aarch64":
extra_compile_args += ["-Wno-deprecated-register"]
if platform.system() == "Darwin":
libdbc = "libdbc.dylib"
else:
libdbc = "libdbc.so"
setup(name='CAN parser',
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
ext_modules=cythonize(
Extension(
"parser_pyx",
language="c++",
sources=sourcefiles,
extra_compile_args=extra_compile_args,
include_dirs=[
BASEDIR,
os.path.join(BASEDIR, 'phonelibs', 'capnp-cpp/include'),
],
extra_link_args=[
os.path.join(BASEDIR, 'opendbc', 'can', libdbc),
],
)
),
nthreads=4,
)
if platform.system() == "Darwin":
os.system("install_name_tool -change opendbc/can/libdbc.dylib "+BASEDIR+"/opendbc/can/libdbc.dylib parser_pyx.so")
-112
View File
@@ -1,112 +0,0 @@
#!/usr/bin/env python3
from __future__ import print_function
import os
import sys
import jinja2
from collections import Counter
from opendbc.can.dbc import dbc
def process(in_fn, out_fn):
dbc_name = os.path.split(out_fn)[-1].replace('.cc', '')
#print("processing %s: %s -> %s" % (dbc_name, in_fn, out_fn))
template_fn = os.path.join(os.path.dirname(__file__), "dbc_template.cc")
with open(template_fn, "r") as template_f:
template = jinja2.Template(template_f.read(), trim_blocks=True, lstrip_blocks=True)
can_dbc = dbc(in_fn)
msgs = [(address, msg_name, msg_size, sorted(msg_sigs, key=lambda s: s.name not in ("COUNTER", "CHECKSUM"))) # process counter and checksums first
for address, ((msg_name, msg_size), msg_sigs) in sorted(can_dbc.msgs.items()) if msg_sigs]
def_vals = {a: sorted(set(b)) for a, b in can_dbc.def_vals.items()} # remove duplicates
def_vals = sorted(def_vals.items())
if can_dbc.name.startswith(("honda_", "acura_")):
checksum_type = "honda"
checksum_size = 4
counter_size = 2
checksum_start_bit = 3
counter_start_bit = 5
little_endian = False
elif can_dbc.name.startswith(("toyota_", "lexus_")):
checksum_type = "toyota"
checksum_size = 8
counter_size = None
checksum_start_bit = 7
counter_start_bit = None
little_endian = False
elif can_dbc.name.startswith(("vw_", "volkswagen_", "audi_", "seat_", "skoda_")):
checksum_type = "volkswagen"
checksum_size = 8
counter_size = 4
checksum_start_bit = 0
counter_start_bit = 0
little_endian = True
else:
checksum_type = None
checksum_size = None
counter_size = None
checksum_start_bit = None
counter_start_bit = None
little_endian = None
# sanity checks on expected COUNTER and CHECKSUM rules, as packer and parser auto-compute those signals
for address, msg_name, msg_size, sigs in msgs:
dbc_msg_name = dbc_name + " " + msg_name
for sig in sigs:
if checksum_type is not None:
# checksum rules
if sig.name == "CHECKSUM":
if sig.size != checksum_size:
sys.exit("%s: CHECKSUM is not %d bits long" % (dbc_msg_name, checksum_size))
if sig.start_bit % 8 != checksum_start_bit:
sys.exit("%s: CHECKSUM starts at wrong bit" % dbc_msg_name)
if little_endian != sig.is_little_endian:
sys.exit("%s: CHECKSUM has wrong endianess" % dbc_msg_name)
# counter rules
if sig.name == "COUNTER":
if counter_size is not None and sig.size != counter_size:
sys.exit("%s: COUNTER is not %d bits long" % (dbc_msg_name, counter_size))
if counter_start_bit is not None and sig.start_bit % 8 != counter_start_bit:
print(counter_start_bit, sig.start_bit)
sys.exit("%s: COUNTER starts at wrong bit" % dbc_msg_name)
if little_endian != sig.is_little_endian:
sys.exit("%s: COUNTER has wrong endianess" % dbc_msg_name)
# pedal rules
if address in [0x200, 0x201]:
if sig.name == "COUNTER_PEDAL" and sig.size != 4:
sys.exit("%s: PEDAL COUNTER is not 4 bits long" % dbc_msg_name)
if sig.name == "CHECKSUM_PEDAL" and sig.size != 8:
sys.exit("%s: PEDAL CHECKSUM is not 8 bits long" % dbc_msg_name)
# Fail on duplicate message names
c = Counter([msg_name for address, msg_name, msg_size, sigs in msgs])
for name, count in c.items():
if count > 1:
sys.exit("%s: Duplicate message name in DBC file %s" % (dbc_name, name))
parser_code = template.render(dbc=can_dbc, checksum_type=checksum_type, msgs=msgs, def_vals=def_vals, len=len)
with open(out_fn, "w") as out_f:
out_f.write(parser_code)
def main():
if len(sys.argv) != 3:
print("usage: %s dbc_directory output_filename" % (sys.argv[0],))
sys.exit(0)
dbc_dir = sys.argv[1]
out_fn = sys.argv[2]
dbc_name = os.path.split(out_fn)[-1].replace('.cc', '')
in_fn = os.path.join(dbc_dir, dbc_name + '.dbc')
process(in_fn, out_fn)
if __name__ == '__main__':
main()

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