mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-13 06:14:47 +08:00
Compare commits
14 Commits
0.7.7-i18n
...
0.8.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce48b03678 | ||
|
|
446fb5f857 | ||
|
|
e55185a7bb | ||
|
|
4bf7baabe6 | ||
|
|
91ade81972 | ||
|
|
22a4193109 | ||
|
|
29d9e1ce69 | ||
|
|
0b384ea101 | ||
|
|
8369e11417 | ||
|
|
26bccbdcc8 | ||
|
|
db336329c5 | ||
|
|
7a7f343978 | ||
|
|
49d82d6ac1 | ||
|
|
0aa4867be4 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -53,6 +53,7 @@ one
|
||||
openpilot
|
||||
notebooks
|
||||
xx
|
||||
hyperthneed
|
||||
panda_jungle
|
||||
apks
|
||||
openpilot-apks
|
||||
@@ -66,3 +67,4 @@ pandaextra
|
||||
flycheck_*
|
||||
|
||||
cppcheck_report.txt
|
||||
comma.sh
|
||||
|
||||
@@ -1,3 +1,121 @@
|
||||
dragonpilot 0.8.1
|
||||
========================
|
||||
* 基於最新 openpilot 0.8.1 devel.
|
||||
* Based on latest openpilot 0.8.1 devel.
|
||||
* 加入行車記錄按鈕。(感謝 @toyboxZ 提供)
|
||||
* Added REC screen button. (Thanks to @toyboxZ)
|
||||
|
||||
dragonpilot 0.8.0
|
||||
========================
|
||||
* 基於最新 openpilot 0.8.0 devel.
|
||||
* Based on latest openpilot 0.8.0 devel.
|
||||
* 加入 git 錯誤修正。(感謝 @toyboxZ 提供)
|
||||
* Added git error fix. (Thanks to @toyboxZ)
|
||||
|
||||
dragonpilot 0.7.10.1
|
||||
========================
|
||||
* HYUNDAI_GENESIS 使用 INDI 控制器。(感謝 @donfyffe 提供)
|
||||
* HYUNDAI_GENESIS uses INDI controller. (Thanks to @donfyffe)
|
||||
* HYUNDAI_GENESIS 加入 Cruise 按紐 和 lkMode 支援。(感謝 @donfyffe 建議)
|
||||
* HYUNDAI_GENESIS added Cruise button event and lkMode feature. (Thanks to @donfyffe)
|
||||
* 支援台灣版 2018 Huyndai IONIQ + smart MDPS (dp_hkg_smart_mdps) (感謝 @andy741217 提供)
|
||||
* Support 2018 Taiwan Hyundai IONIQ + smart MDPS (dp_hkg_smart_mdps) (Thanks to @andy741217)
|
||||
* 使用 openpilot v0.8 的模型。(感謝 @eisenheim)
|
||||
* Use openpilot v0.8 model. (Thanks to @eisenheim)
|
||||
* 加入 0.8 測試版的部分優化。
|
||||
* Added optimizations from pre-0.8.
|
||||
* 加入 dp_honda_eps_mod 設定來使用更高的扭力 (需 eps mod)。(感謝 @Wuxl_369 提供)
|
||||
* Added dp_honda_eps_mod setting to enable higher torque (eps mod required). (Thanks to @Wuxl_369)
|
||||
* 修正 VW 對白/灰熊的支援 (感謝 @lirudy 提供)
|
||||
* Fixed issue with white/grey panda support for VW (Thanks to @lirudy)
|
||||
* GENESIS_G70 優化 (感謝 @sebastian4k 提供)
|
||||
* GENESIS_G70 Optimisation (Thanks to @sebastian4k)
|
||||
* HYUNDAI_GENESIS 優化 (感謝 @donfyffe 提供)
|
||||
* HYUNDAI_GENESIS Optimisation (Thanks to @donfyffe)
|
||||
* 加入 Dynamic gas Lite。(感謝 @toyboxZ 提供)
|
||||
* Added Dynamic Gas Lite. (Thanks to @toyboxZ)
|
||||
* 加入來自 afa 的 Honda inspire, accord, crv SnG 優化。(感謝 @menwenliang 提供)
|
||||
* Added Honda inspire, accord, crv SnG optimisation from afa fork. (Thanks to @menwenliang)
|
||||
* 加入 dp_toyota_lowest_cruise_override_vego。(感謝 @toyboxZ 提供)
|
||||
* Added dp_toyota_lowest_cruise_override_vego. (Thanks to @toyboxZ)
|
||||
|
||||
dragonpilot 0.7.10.0
|
||||
========================
|
||||
* 基於最新 openpilot 0.7.10 devel.
|
||||
* Based on latest openpilot 0.7.10 devel.
|
||||
* 修正 Prius 特定情況下無法操控方向盤的問題。
|
||||
* Fixed unable to regain Prius steering control under certain condition.
|
||||
* 更新 VW MQB 的支援。(需執行 scripts/vw.sh 腳本)
|
||||
* Updated support of VW MQB. (scripts/vw.sh script required)
|
||||
* 新增 2018 China Toyota CHR 指紋v2。(感謝 @xiaohongcheung 提供)
|
||||
* Added 2018 China Toyota CHR FPv2. (Thanks to @xiaohongcheung)
|
||||
* 加入 Headunit Reloaded Android Auto App 支援。(感謝 @Ninjaa 提供)
|
||||
* Added Headunit Reloaded Android Auto App Support. (Thanks to @Ninjaa)
|
||||
* 優化 nanovg。(感謝 @piggy 提供)
|
||||
* Optomized nanovg. (Thanks to @piggy)
|
||||
* 加入 complete_setup.sh (感謝 @深鲸希西 提供)
|
||||
* Added complete_setup.sh (Thanks to @深鲸希西)
|
||||
* Based on latest openpilot 0.7.10 devel.
|
||||
* 修正 EON 接 PC/USB 充電器時仍會自動關機的錯誤。(感謝 @小愛 回報)
|
||||
* Fixed auto shutdown issue when EON connect to PC/USB Charger. (Thanks to @LOVEChen)
|
||||
* HYUNDAI_GENESIS 使用 INDI 控制器。(感謝 @donfyffe 提供)
|
||||
* HYUNDAI_GENESIS uses INDI controller. (Thanks to @donfyffe)
|
||||
|
||||
dragonpilot 0.7.8.3
|
||||
========================
|
||||
* VW 加入 6 分鐘時間方向盤控制限制輔助方案。(特別感謝 @actuallylemoncurd 提供代碼)
|
||||
* VW added 6 minutes timebomb assist. (dp_timebomb_assist, special thanks to @actuallylemoncurd)
|
||||
|
||||
dragonpilot 0.7.8.2
|
||||
========================
|
||||
* 修正在沒網路的情況下,開機超過五分鐘的問題。
|
||||
* Fixed 5+ minutes boot time issue when there is no internet connection.
|
||||
* 錯誤回傳改使用 dp 的主機。
|
||||
* Used dp server for error reporting.
|
||||
* 更新服務改使用 gitee 的 IP 檢查連線狀態。
|
||||
* updated service uses gitee IP address instead.
|
||||
|
||||
dragonpilot 0.7.8.1
|
||||
========================
|
||||
* 加入 ko-KR 翻譯。
|
||||
* Added ko-KR translation.
|
||||
* 加入 Honda Jade 支援。(感謝 @李俊灝)
|
||||
* Added Honda Jade support. (Thanks to @lijunhao731)
|
||||
* 修正 ui.cc 內存越界的問題。(感謝 @piggy 提供)
|
||||
* Fixed ui.cc memory out of bound issue. (Thanks to @piggy)
|
||||
* gpxd 記錄改自動存成 zip 格式。
|
||||
* gpxd now store in zip format.
|
||||
* 強制關閉 panda 檢查 DOS 硬體。
|
||||
* Force disabled DOS hardware check in panda.
|
||||
|
||||
dragonpilot 0.7.8.0
|
||||
========================
|
||||
* 基於最新 openpilot 0.7.8 devel.
|
||||
* Based on latest openpilot 0.7.8 devel.
|
||||
* 加入重置 DP 設定按鈕。(感謝 @LOVEChen 建議)
|
||||
* Added "Reset DP Settings" button. (Thanks to @LOVEChen)
|
||||
* 將警示訊息更改為類似於概念 UI 的設計。
|
||||
* Alert messages changed to concept UI alike design.
|
||||
* 當 manager 出現錯誤後,按 Exit 按鈕會執行 reset_update 腳本。
|
||||
* Added ability to execute reset_update.sh when press "Exit" button once manager returned errors.
|
||||
|
||||
dragonpilot 0.7.7.3
|
||||
========================
|
||||
* 修正方向盤監控。
|
||||
* Fixed steering monitor timer param.
|
||||
* 修正行駛時關閉畫面導致當機的錯誤。(感謝 @salmankhan, @stevej99, @bobbydough 回報)
|
||||
* Fixed screen frozen issue when "screen off while driving" toggle is enabled. (Thanks to @salmankhan, @stevej99, @bobbydough)
|
||||
* 加回 Dev Mini UI 開關。(感謝 @Ninjaa 建議)
|
||||
* Re-added Dev Mini UI. (Thanks to @Ninjaa)
|
||||
* 新增 (dp_reset_live_parameters_on_start) 每次發車重設 LiveParameters 值。(感謝 @eisenheim)
|
||||
* Added ability (dp_reset_live_param_on_start) to reset LiveParameters on each start. (Thanks @eisenheim)
|
||||
* 修正同時開啟 dp_toyota_zss 和 dp_lqr 產生的錯誤。(感謝 @bobbydough)
|
||||
* Fixed error cuased by enabling both dp_toyota_zss and dp_lqr at the same time. (Thanks to @bobbydough)
|
||||
* 新增 (dp_gpxd) 將 GPS 軌跡導出至 GPX 格式 (/sdcard/gpx_logs/)的功能。 (感謝 @mageymoo1)
|
||||
* Added ability (dp_gpxd) to export GPS track into GPX files (/sdcard/gpx_logs/). (Thanks to @mageymoo1)
|
||||
* 使用德國的車道寬度估算值。 (感謝 @arne182)
|
||||
* Used lane width estimate value from Germany. (Thanks to @arne182)
|
||||
|
||||
dragonpilot 0.7.7.2
|
||||
========================
|
||||
* 加入 d_poly offset。 (感謝 @ShaneSmiskol)
|
||||
|
||||
@@ -1,35 +1,98 @@
|
||||
dragonpilot 0.7.7
|
||||
dragonpilot 0.8.1
|
||||
========================
|
||||
* 基於 openpilot 0.7.7 devel.
|
||||
* Based on openpilot 0.7.7 devel.
|
||||
* 基於最新 openpilot 0.8.1 devel.
|
||||
* Based on latest openpilot 0.8.1 devel.
|
||||
* 加入行車記錄按鈕。(感謝 @toyboxZ 提供)
|
||||
* Added REC screen button. (Thanks to @toyboxZ)
|
||||
|
||||
dragonpilot 0.8.0
|
||||
========================
|
||||
* 基於最新 openpilot 0.8.0 devel.
|
||||
* Based on latest openpilot 0.8.0 devel.
|
||||
* 加入 git 錯誤修正。(感謝 @toyboxZ 提供)
|
||||
* Added git error fix. (Thanks to @toyboxZ)
|
||||
|
||||
dragonpilot 0.7.10.0
|
||||
========================
|
||||
* 基於最新 openpilot 0.7.10 devel.
|
||||
* Based on latest openpilot 0.7.10 devel.
|
||||
* 修正 Prius 特定情況下無法操控方向盤的問題。
|
||||
* Fixed unable to regain Prius steering control under certain condition.
|
||||
* 更新 VW MQB 的支援。(需執行 scripts/vw.sh 腳本)
|
||||
* Updated support of VW MQB. (scripts/vw.sh script required)
|
||||
* 新增 2018 China Toyota CHR 指紋v2。(感謝 @xiaohongcheung 提供)
|
||||
* Added 2018 China Toyota CHR FPv2. (Thanks to @xiaohongcheung)
|
||||
* 加入 Headunit Reloaded Android Auto App 支援。(感謝 @Ninjaa 提供)
|
||||
* Added Headunit Reloaded Android Auto App Support. (Thanks to @Ninjaa)
|
||||
* 優化 nanovg。(感謝 @piggy 提供)
|
||||
* Optomized nanovg. (Thanks to @piggy)
|
||||
* 加入 complete_setup.sh (感謝 @深鲸希西 提供)
|
||||
* Added complete_setup.sh (Thanks to @深鲸希西)
|
||||
* Based on latest openpilot 0.7.10 devel.
|
||||
* 修正 EON 接 PC/USB 充電器時仍會自動關機的錯誤。(感謝 @小愛 回報)
|
||||
* Fixed auto shutdown issue when EON connect to PC/USB Charger. (Thanks to @LOVEChen)
|
||||
* HYUNDAI_GENESIS 使用 INDI 控制器。(感謝 @donfyffe 提供)
|
||||
* HYUNDAI_GENESIS uses INDI controller. (Thanks to @donfyffe)
|
||||
* HYUNDAI_GENESIS 加入 Cruise 按紐 和 lkMode 支援。(感謝 @donfyffe 建議)
|
||||
* HYUNDAI_GENESIS added Cruise button event and lkMode feature. (Thanks to @donfyffe)
|
||||
* 支援台灣版 2018 Huyndai IONIQ + smart MDPS (dp_hkg_smart_mdps) (感謝 @andy741217 提供)
|
||||
* Support 2018 Taiwan Hyundai IONIQ + smart MDPS (dp_hkg_smart_mdps) (Thanks to @andy741217)
|
||||
* 使用 openpilot v0.8 的模型。(感謝 @eisenheim)
|
||||
* Use openpilot v0.8 model. (Thanks to @eisenheim)
|
||||
* 加入 0.8 測試版的部分優化。
|
||||
* Added optimizations from pre-0.8.
|
||||
* 加入 dp_honda_eps_mod 設定來使用更高的扭力 (需 eps mod)。(感謝 @Wuxl_369 提供)
|
||||
* Added dp_honda_eps_mod setting to enable higher torque (eps mod required). (Thanks to @Wuxl_369)
|
||||
* 修正 VW 對白/灰熊的支援 (感謝 @lirudy 提供)
|
||||
* Fixed issue with white/grey panda support for VW (Thanks to @lirudy)
|
||||
* GENESIS_G70 優化 (感謝 @sebastian4k 提供)
|
||||
* GENESIS_G70 Optimisation (Thanks to @sebastian4k)
|
||||
* HYUNDAI_GENESIS 優化 (感謝 @donfyffe 提供)
|
||||
* HYUNDAI_GENESIS Optimisation (Thanks to @donfyffe)
|
||||
* 加入 Dynamic gas Lite。(感謝 @toyboxZ 提供)
|
||||
* Added Dynamic Gas Lite. (Thanks to @toyboxZ)
|
||||
* 加入來自 afa 的 Honda inspire, accord, crv SnG 優化。(感謝 @menwenliang 提供)
|
||||
* Added Honda inspire, accord, crv SnG optimisation from afa fork. (Thanks to @menwenliang)
|
||||
* 加入 dp_toyota_lowest_cruise_override_vego。(感謝 @toyboxZ 提供)
|
||||
* Added dp_toyota_lowest_cruise_override_vego. (Thanks to @toyboxZ)
|
||||
|
||||
dragonpilot 0.7.8
|
||||
========================
|
||||
* 基於最新 openpilot 0.7.8 devel.
|
||||
* Based on latest openpilot 0.7.8 devel.
|
||||
* 加入重置 DP 設定按鈕。(感謝 @LOVEChen 建議)
|
||||
* Added "Reset DP Settings" button. (Thanks to @LOVEChen)
|
||||
* 將警示訊息更改為類似於概念 UI 的設計。
|
||||
* Alert messages changed to concept UI alike design.
|
||||
* 當 manager 出現錯誤後,按 Exit 按鈕會執行 reset_update 腳本。
|
||||
* Added ability to execute reset_update.sh when press "Exit" button once manager returned errors.
|
||||
* 加入 ko-KR 翻譯。
|
||||
* Added ko-KR translation.
|
||||
* 加入 Honda Jade 支援。(感謝 @李俊灝)
|
||||
* Added Honda Jade support. (Thanks to @lijunhao731)
|
||||
* 修正 ui.cc 內存越界的問題。(感謝 @piggy 提供)
|
||||
* Fixed ui.cc memory out of bound issue. (Thanks to @piggy)
|
||||
* gpxd 記錄改自動存成 zip 格式。
|
||||
* gpxd now store in zip format.
|
||||
* 強制關閉 panda 檢查 DOS 硬體。
|
||||
* Force disabled DOS hardware check in panda.
|
||||
* 修正在沒網路的情況下,開機超過五分鐘的問題。
|
||||
* Fixed 5+ minutes boot time issue when there is no internet connection.
|
||||
* 錯誤回傳改使用 dp 的主機。
|
||||
* Used dp server for error reporting.
|
||||
* 更新服務改使用 gitee 的 IP 檢查連線狀態。
|
||||
* updated service uses gitee IP address instead.
|
||||
* VW 加入 6 分鐘時間方向盤控制限制輔助方案。(特別感謝 @actuallylemoncurd 提供代碼)
|
||||
* VW added 6 minutes timebomb assist. (dp_timebomb_assist, special thanks to @actuallylemoncurd)
|
||||
|
||||
dragonpilot 0.7.7.0
|
||||
========================
|
||||
* 基於最新 openpilot 0.7.7 devel.
|
||||
* Based on latest openpilot 0.7.7 devel.
|
||||
* 當 Manager 出現錯誤時,顯示 IP 位置。(感謝 @dingliangxue)
|
||||
* When Manager failed, display IP address. (Thanks to @dingliangxue)
|
||||
* 加回 sr learner 開關。
|
||||
* Re-added sr learner toggle.
|
||||
* 加回 加速模式 開關。
|
||||
* Re-added Accel Profile toggle.
|
||||
* Toyota 加入改寫最低巡航速度功能。(感謝 @Mojo)
|
||||
* Added Toyota to override lowerest cruise speed. (Thanks to @Mojo)
|
||||
* 介面加入盲點偵測顯示。(感謝 @wabes)
|
||||
* Added BSM indicator to UI. (Thanks to @wabes)
|
||||
* 加回彎道減速功能。(感謝 @Mojo)
|
||||
* re-added Slow On Curve functionality. (Thanks to @Mojo)
|
||||
* 加入 C2 風扇靜音模式。(感謝 @dingliangxue)
|
||||
* Added C2 quiet fan mode. (Thanks to @dingliangxue)
|
||||
* 加入「輔助換道最低啟動速度」、「自動換道最低啟動速度」設定。
|
||||
* Added "Assisted Lane Change Min Engage Speed" and "Auto Lane Change Min Engage Speed" settings.
|
||||
* 加入回調校介面。(感謝 @Kent)
|
||||
* Re-added Dev UI. (Thanks to @Kent)
|
||||
* 加入 "dp_lqr" 設定來強制使用 RAV4 的 lqr 調校。(感謝 @eisenheim)
|
||||
* Added "dp_lqr" setting to force enable lqr tuning from RAV4. (Thanks to eisenheim)
|
||||
* 加入 d_poly offset。 (感謝 @ShaneSmiskol)
|
||||
* Added d_poly offset. (Thanks to @ShaneSmiskol)
|
||||
* 加入 ZSS 支援。(感謝 @bobbydough, @WilliamPrius 建議, @bobbydough 測試)
|
||||
* Added ZSS support. (Thanks to @bobbydough, @WilliamPrius for recommendation, @bobbydough for testing)
|
||||
* 加入錯誤記錄至 /sdcard/crash_logs/ (感謝 @ShaneSmiskol 提供代碼)
|
||||
* Added error logs to /sdcard/crash_logs/ (Special Thanks to @ShaneSmiskol)
|
||||
* 加入 LQR 控制器開關進設定畫面。
|
||||
* Added LQR Controller toggle to settings.
|
||||
|
||||
dragonpilot 0.7.6
|
||||
========================
|
||||
|
||||
186
CHANGELOGS.md
186
CHANGELOGS.md
@@ -1,3 +1,189 @@
|
||||
2021-01-11 (0.8.1.0)
|
||||
========================
|
||||
* 修正 honda 剎車錯誤顯示。(感謝 @深鲸希西 提供)
|
||||
* Fixed Honda display incorrect brake display. (Thanks to @深鲸希西)
|
||||
|
||||
2021-01-02 (0.8.1.0)
|
||||
========================
|
||||
* 加入行車記錄按鈕。(感謝 @toyboxZ 提供)
|
||||
* Added REC screen button. (Thanks to @toyboxZ)
|
||||
|
||||
2020-12-23 (0.8.1.0)
|
||||
========================
|
||||
* 基於最新 openpilot 0.8.1 devel.
|
||||
* Based on latest openpilot 0.8.1 devel.
|
||||
|
||||
2020-12-07 (0.8.0.0)
|
||||
========================
|
||||
* 錯誤修正。
|
||||
* Bug fixes.
|
||||
|
||||
2020-12-04 (0.8.0.0)
|
||||
========================
|
||||
* 加入 git 錯誤修正。(感謝 @toyboxZ 提供)
|
||||
* Added git error fix. (Thanks to @toyboxZ)
|
||||
|
||||
2020-12-02 (0.8.0.0)
|
||||
========================
|
||||
* 基於最新 openpilot 0.8.0 devel.
|
||||
* Based on latest openpilot 0.8.0 devel.
|
||||
|
||||
2020-11-28 (0.7.10.0)
|
||||
========================
|
||||
* 加入來自 afa 的 Honda inspire, accord, crv SnG 優化。(感謝 @menwenliang 提供)
|
||||
* Added Honda inspire, accord, crv SnG optimisation from afa fork. (Thanks to @menwenliang)
|
||||
* 加入 dp_toyota_lowest_cruise_override_vego。(感謝 @toyboxZ 提供)
|
||||
* Added dp_toyota_lowest_cruise_override_vego. (Thanks to @toyboxZ)
|
||||
|
||||
2020-11-20 (0.7.10.0)
|
||||
========================
|
||||
* 加入 Dynamic gas Lite。(感謝 @toyboxZ 提供)
|
||||
* Added Dynamic Gas Lite. (Thanks to @toyboxZ)
|
||||
|
||||
2020-11-19 (0.7.10.0)
|
||||
========================
|
||||
* 更新所有 honda/hyunda/toyota 指紋。
|
||||
* Updated all honda/hyunda/toyota fingerprints.
|
||||
|
||||
2020-11-18 (0.7.10.0)
|
||||
========================
|
||||
* 支援台灣版 2018 Huyndai IONIQ + smart MDPS (dp_hkg_smart_mdps) (感謝 @andy741217 提供)
|
||||
* Support 2018 Taiwan Hyundai IONIQ + smart MDPS (dp_hkg_smart_mdps) (Thanks to @andy741217)
|
||||
* 使用 openpilot v0.8 的模型。(感謝 @eisenheim)
|
||||
* Use openpilot v0.8 model. (Thanks to @eisenheim)
|
||||
* 加入 0.8 測試版的部分優化。
|
||||
* Added optimizations from pre-0.8.
|
||||
* 加入 dp_honda_eps_mod 設定來使用更高的扭力 (需 eps mod)。(感謝 @Wuxl_369 提供)
|
||||
* Added dp_honda_eps_mod setting to enable higher torque (eps mod required). (Thanks to @Wuxl_369)
|
||||
* 修正 VW 對白/灰熊的支援 (感謝 @lirudy 提供)
|
||||
* Fixed issue with white/grey panda support for VW (Thanks to @lirudy)
|
||||
* GENESIS_G70 優化 (感謝 @sebastian4k 提供)
|
||||
* GENESIS_G70 Optimisation (Thanks to @sebastian4k)
|
||||
* HYUNDAI_GENESIS 優化 (感謝 @donfyffe 提供)
|
||||
* HYUNDAI_GENESIS Optimisation (Thanks to @donfyffe)
|
||||
|
||||
2020-11-05 (0.7.10.0)
|
||||
========================
|
||||
* HYUNDAI_GENESIS 加入 Cruise 按紐 和 lkMode 支援。(感謝 @donfyffe 建議)
|
||||
* HYUNDAI_GENESIS added Cruise button event and lkMode feature. (Thanks to @donfyffe)
|
||||
|
||||
2020-11-04 (0.7.10.0)
|
||||
========================
|
||||
* HYUNDAI_GENESIS 使用 INDI 控制器。(感謝 @donfyffe 提供)
|
||||
* HYUNDAI_GENESIS uses INDI controller. (Thanks to @donfyffe)
|
||||
|
||||
2020-10-30 (0.7.10.0)
|
||||
========================
|
||||
* 基於最新 openpilot 0.7.10 devel.
|
||||
* Based on latest openpilot 0.7.10 devel.
|
||||
* 修正 EON 接 PC/USB 充電器時仍會自動關機的錯誤。(感謝 @小愛 回報)
|
||||
* Fixed auto shutdown issue when EON connect to PC/USB Charger. (Thanks to @LOVEChen)
|
||||
* 新增大陸版 2018 Inspire 指紋。(感謝 @)
|
||||
* Added China Camry Hybrid FPv2. (Thanks to @杜子腾)
|
||||
|
||||
2020-10-23 (0.7.9.0)
|
||||
========================
|
||||
* 加入 Headunit Reloaded Android Auto 斷線偵側。
|
||||
* Added Disconnect detection for Headunit Reloaded Android Auto.
|
||||
* 加入 complete_setup.sh (感謝 @深鲸希西 提供)
|
||||
* Added complete_setup.sh (Thanks to @深鲸希西)
|
||||
|
||||
2020-10-21 (0.7.9.0)
|
||||
========================
|
||||
* 基於最新 openpilot 0.7.9 devel.
|
||||
* Based on latest openpilot 0.7.9 devel.
|
||||
* 修正 Prius 特定情況下無法操控方向盤的問題。
|
||||
* Fixed unable to regain Prius steering control under certain condition.
|
||||
* 更新 VW MQB 的支援。(需執行 scripts/vw.sh 腳本)
|
||||
* Updated support of VW MQB. (scripts/vw.sh script required)
|
||||
* 加入 HKG mdps/sas 的支援。(需執行 scripts/hkg.sh 腳本)
|
||||
* Added support to HKG mdps/sas. (scripts/hkg.sh script required)
|
||||
* 新增 2018 China Toyota CHR 指紋v2。(感謝 @xiaohongcheung 提供)
|
||||
* Added 2018 China Toyota CHR FPv2. (Thanks to @xiaohongcheung)
|
||||
* 加入 Headunit Reloaded Android Auto App 支援。(感謝 @Ninjaa 提供)
|
||||
* Added Headunit Reloaded Android Auto App Support. (Thanks to @Ninjaa)
|
||||
* 優化 nanovg。(感謝 @piggy 提供)
|
||||
* Optomized nanovg. (Thanks to @piggy)
|
||||
|
||||
2020-09-25 (0.7.8.0)
|
||||
========================
|
||||
* VW 加入 6 分鐘時間方向盤控制限制輔助方案。(特別感謝 @actuallylemoncurd 提供代碼)
|
||||
* VW added 6 minutes timebomb assist. (dp_timebomb_assist, special thanks to @actuallylemoncurd)
|
||||
|
||||
2020-09-23 (0.7.8.0)
|
||||
========================
|
||||
* 修正在沒網路的情況下,開機超過五分鐘的問題。
|
||||
* Fixed 5+ minutes boot time issue when there is no internet connection.
|
||||
* 錯誤回傳改使用 dp 的主機。
|
||||
* Used dp server for error reporting.
|
||||
* 更新服務改使用 gitee 的 IP 檢查連線狀態。
|
||||
* updated service uses gitee IP address instead.
|
||||
|
||||
2020-09-21 (0.7.8.0)
|
||||
========================
|
||||
* 強制關閉 panda 檢查 DOS 硬體。
|
||||
* Force disabled DOS hardware check in panda.
|
||||
|
||||
2020-09-18 (0.7.8.0)
|
||||
========================
|
||||
* gpxd 記錄改自動存成 zip 格式。
|
||||
* gpxd now store in zip format.
|
||||
|
||||
2020-09-15 (0.7.8.0)
|
||||
========================
|
||||
* 加入 Honda Jade 支援。(感謝 @李俊灝)
|
||||
* Added Honda Jade support. (Thanks to @lijunhao731)
|
||||
* 修正 ui.cc 內存越界的問題。(感謝 @piggy 提供)
|
||||
* Fixed ui.cc memory out of bound issue. (Thanks to @piggy)
|
||||
|
||||
2020-09-01 (0.7.8.0)
|
||||
========================
|
||||
* 加入 ko-KR 翻譯。
|
||||
* Added ko-KR translation.
|
||||
|
||||
2020-08-21 (0.7.8.0)
|
||||
========================
|
||||
* 基於最新 openpilot 0.7.8 devel.
|
||||
* Based on latest openpilot 0.7.8 devel.
|
||||
* 加入重置 DP 設定按鈕。(感謝 @LOVEChen 建議)
|
||||
* Added "Reset DP Settings" button. (Thanks to @LOVEChen)
|
||||
* 將警示訊息更改為類似於概念 UI 的設計。
|
||||
* Alert messages changed to concept UI alike design.
|
||||
* 當 manager 出現錯誤後,按 Exit 按鈕會執行 reset_update 腳本。
|
||||
* Added ability to execute reset_update.sh when press "Exit" button once manager returned errors.
|
||||
|
||||
2020-08-18 (0.7.7.0)
|
||||
========================
|
||||
* gpxd 不再切換至 GCJ-02 格式。(感謝 @arne182 建議)
|
||||
* gpxd no longer switch to GCJ-02 format automatically. (Thanks to @arne182)
|
||||
* 修正方向盤監控。
|
||||
* Fixed steering monitor timer param.
|
||||
* 修正行駛時關閉畫面導致當機的錯誤。(感謝 @salmankhan, @stevej99, @bobbydough 回報)
|
||||
* Fixed screen frozen issue when "screen off while driving" toggle is enabled. (Thanks to @salmankhan, @stevej99, @bobbydough)
|
||||
* 加回 Dev Mini UI 開關。(感謝 @Ninjaa 建議)
|
||||
* Re-added Dev Mini UI. (Thanks to @Ninjaa)
|
||||
|
||||
2020-08-17 (0.7.7.0)
|
||||
========================
|
||||
* gpxd 只儲存高精度數據。(感謝 @arne182)
|
||||
* gpxd now only stored high accuracy data. (Thanks to @arne182)
|
||||
* gpxd 加入自動切換成 GCJ-02 格式。
|
||||
* added ability to switch to GCJ-02 format in gpxd.
|
||||
* 新增 (dp_reset_live_parameters_on_start) 每次發車重設 LiveParameters 值。(感謝 @eisenheim)
|
||||
* Added ability (dp_reset_live_param_on_start) to reset LiveParameters on each start. (Thanks @eisenheim)
|
||||
|
||||
2020-08-12 (0.7.7.0)
|
||||
========================
|
||||
* 修正同時開啟 dp_toyota_zss 和 dp_lqr 產生的錯誤。(感謝 @bobbydough)
|
||||
* Fixed error cuased by enabling both dp_toyota_zss and dp_lqr at the same time. (Thanks to @bobbydough)
|
||||
|
||||
2020-08-12 (0.7.7.0)
|
||||
========================
|
||||
* 新增 (dp_gpxd) 將 GPS 軌跡導出至 GPX 格式 (/sdcard/gpx_logs/)的功能。 (感謝 @mageymoo1)
|
||||
* Added ability (dp_gpxd) to export GPS track into GPX files (/sdcard/gpx_logs/). (Thanks to @mageymoo1)
|
||||
* 使用德國的車道寬度估算值。 (感謝 @arne182)
|
||||
* Used lane width estimate value from Germany. (Thanks to @arne182)
|
||||
|
||||
2020-08-11 (0.7.7.0)
|
||||
========================
|
||||
* 加入 d_poly offset。 (感謝 @ShaneSmiskol)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Our software is open source so you can solve your own problems without needing help from others. And if you solve a problem and are so kind, you can upstream it for the rest of the world to use.
|
||||
|
||||
Most open source development activity is coordinated through our [Discord](https://discord.comma.ai). A lot of documentation is available on our [medium](https://medium.com/@comma_ai/).
|
||||
Most open source development activity is coordinated through our [GitHub Discussions](https://github.com/commaai/openpilot/discussions) and [Discord](https://discord.comma.ai). A lot of documentation is available on our [medium](https://medium.com/@comma_ai/).
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -12,23 +12,19 @@ Most open source development activity is coordinated through our [Discord](https
|
||||
|
||||
## Testing
|
||||
|
||||
### Local Testing
|
||||
|
||||
You can test your changes on your machine by running `run_docker_tests.sh`. This will run some automated tests in docker against your code.
|
||||
|
||||
### Automated Testing
|
||||
|
||||
All PRs and commits are automatically checked by Github Actions. Check out `.github/workflows/` for what Github Actions runs. Any new tests sould be added to Github Actions.
|
||||
All PRs and commits are automatically checked by GitHub Actions. Check out `.github/workflows/` for what GitHub Actions runs. Any new tests should be added to GitHub Actions.
|
||||
|
||||
### Code Style and Linting
|
||||
|
||||
Code is automatically checked for style by Github Actions as part of the automated tests. You can also run these tests yourself by running `pre-commit run --all`.
|
||||
Code is automatically checked for style by GitHub Actions as part of the automated tests. You can also run these tests yourself by running `pre-commit run --all`.
|
||||
|
||||
## Car Ports (openpilot)
|
||||
|
||||
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)
|
||||
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).
|
||||
|
||||
## Pull Requests
|
||||
|
||||
@@ -38,12 +34,10 @@ git clone https://github.com/commaai/openpilot.git --recursive
|
||||
```
|
||||
Or alternatively, when on the master branch:
|
||||
```
|
||||
git submodule init
|
||||
git submodule update
|
||||
git submodule update --init
|
||||
```
|
||||
The reasons for having submodules on a dedicated repository and our new development philosophy can be found in our [post about externalization](https://medium.com/@comma_ai/a-2020-theme-externalization-13b33326d8b3).
|
||||
Modules that are in seperate repositories include:
|
||||
* apks
|
||||
* cereal
|
||||
* laika
|
||||
* opendbc
|
||||
|
||||
163
Jenkinsfile
vendored
163
Jenkinsfile
vendored
@@ -1,86 +1,157 @@
|
||||
pipeline {
|
||||
agent {
|
||||
docker {
|
||||
image 'python:3.7.3'
|
||||
args '--user=root'
|
||||
def phone(String ip, String step_label, String cmd) {
|
||||
def ci_env = "CI=1 TEST_DIR=${env.TEST_DIR} GIT_BRANCH=${env.GIT_BRANCH} GIT_COMMIT=${env.GIT_COMMIT}"
|
||||
|
||||
withCredentials([file(credentialsId: 'id_rsa_public', variable: 'key_file')]) {
|
||||
sh label: step_label,
|
||||
script: """
|
||||
ssh -tt -o StrictHostKeyChecking=no -i ${key_file} -p 8022 root@${ip} '${ci_env} /usr/bin/bash -le' <<'EOF'
|
||||
echo \$\$ > /dev/cpuset/app/tasks || true
|
||||
echo \$PPID > /dev/cpuset/app/tasks || true
|
||||
mkdir -p /dev/shm
|
||||
chmod 777 /dev/shm
|
||||
cd ${env.TEST_DIR} || true
|
||||
${cmd}
|
||||
exit 0
|
||||
EOF"""
|
||||
}
|
||||
}
|
||||
|
||||
def phone_steps(String device_type, steps) {
|
||||
lock(resource: "", label: device_type, inversePrecedence: true, variable: 'device_ip', quantity: 1) {
|
||||
timeout(time: 60, unit: 'MINUTES') {
|
||||
phone(device_ip, "kill old processes", "pkill -f comma || true")
|
||||
phone(device_ip, "git checkout", readFile("selfdrive/test/setup_device_ci.sh"),)
|
||||
steps.each { item ->
|
||||
phone(device_ip, item[0], item[1])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pipeline {
|
||||
agent none
|
||||
environment {
|
||||
COMMA_JWT = credentials('athena-test-jwt')
|
||||
TEST_DIR = "/data/openpilot"
|
||||
}
|
||||
options {
|
||||
timeout(time: 1, unit: 'HOURS')
|
||||
}
|
||||
|
||||
stages {
|
||||
|
||||
stage('Release Build') {
|
||||
agent {
|
||||
docker {
|
||||
image 'python:3.7.3'
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
when {
|
||||
branch 'devel-staging'
|
||||
}
|
||||
steps {
|
||||
lock(resource: "", label: 'eon-build', inversePrecedence: true, variable: 'eon_ip', quantity: 1){
|
||||
timeout(time: 60, unit: 'MINUTES') {
|
||||
dir(path: 'selfdrive/test') {
|
||||
sh 'pip install paramiko'
|
||||
sh 'python phone_ci.py "cd release && PUSH=1 ./build_release2.sh"'
|
||||
}
|
||||
}
|
||||
}
|
||||
phone_steps("eon-build", [
|
||||
["build release2-staging and dashcam-staging", "cd release && PUSH=1 ./build_release2.sh"],
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
stage('On-device Tests') {
|
||||
stage('openpilot tests') {
|
||||
when {
|
||||
not {
|
||||
anyOf {
|
||||
branch 'master-ci'; branch 'devel'; branch 'devel-staging'; branch 'release2'; branch 'release2-staging'; branch 'dashcam'; branch 'dashcam-staging'
|
||||
branch 'master-ci'; branch 'devel'; branch 'devel-staging'; branch 'release2'; branch 'release2-staging'; branch 'dashcam'; branch 'dashcam-staging'; branch 'testing-closet*'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parallel {
|
||||
|
||||
stage('Build') {
|
||||
environment {
|
||||
CI_PUSH = "${env.BRANCH_NAME == 'master' ? 'master-ci' : ''}"
|
||||
stages {
|
||||
|
||||
/*
|
||||
stage('PC tests') {
|
||||
agent {
|
||||
dockerfile {
|
||||
filename 'Dockerfile.openpilotci'
|
||||
args '--privileged --shm-size=1G --user=root'
|
||||
}
|
||||
}
|
||||
|
||||
steps {
|
||||
lock(resource: "", label: 'eon', inversePrecedence: true, variable: 'eon_ip', quantity: 1){
|
||||
timeout(time: 60, unit: 'MINUTES') {
|
||||
dir(path: 'selfdrive/test') {
|
||||
sh 'pip install paramiko'
|
||||
sh 'python phone_ci.py "cd release && ./build_devel.sh"'
|
||||
}
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh 'scons -j$(nproc)'
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
// fix permissions since docker runs as another user
|
||||
sh "chmod -R 777 ."
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
stage('Replay Tests') {
|
||||
steps {
|
||||
lock(resource: "", label: 'eon2', inversePrecedence: true, variable: 'eon_ip', quantity: 1){
|
||||
timeout(time: 60, unit: 'MINUTES') {
|
||||
dir(path: 'selfdrive/test') {
|
||||
sh 'pip install paramiko'
|
||||
sh 'python phone_ci.py "cd selfdrive/test/process_replay && ./camera_replay.py"'
|
||||
stage('On-device Tests') {
|
||||
agent {
|
||||
docker {
|
||||
image 'python:3.7.3'
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('parallel tests') {
|
||||
parallel {
|
||||
|
||||
stage('Devel Build') {
|
||||
environment {
|
||||
CI_PUSH = "${env.BRANCH_NAME == 'master' ? 'master-ci' : ' '}"
|
||||
}
|
||||
steps {
|
||||
phone_steps("eon", [
|
||||
["build devel", "cd release && CI_PUSH=${env.CI_PUSH} ./build_devel.sh"],
|
||||
["test openpilot", "nosetests -s selfdrive/test/test_openpilot.py"],
|
||||
["test cpu usage", "cd selfdrive/test/ && ./test_cpu_usage.py"],
|
||||
["test car interfaces", "cd selfdrive/car/tests/ && ./test_car_interfaces.py"],
|
||||
["test spinner build", "cd selfdrive/ui/spinner && make clean && make"],
|
||||
["test text window build", "cd selfdrive/ui/text && make clean && make"],
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
stage('Replay Tests') {
|
||||
steps {
|
||||
phone_steps("eon2", [
|
||||
["camerad/modeld replay", "QCOM_REPLAY=1 scons -j4 && cd selfdrive/test/process_replay && ./camera_replay.py"],
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
stage('HW + Unit Tests') {
|
||||
steps {
|
||||
phone_steps("eon", [
|
||||
["build", "SCONS_CACHE=1 scons -j4"],
|
||||
["test sounds", "nosetests -s selfdrive/test/test_sounds.py"],
|
||||
["test boardd loopback", "nosetests -s selfdrive/boardd/tests/test_boardd_loopback.py"],
|
||||
["test loggerd", "CI=1 python selfdrive/loggerd/tests/test_loggerd.py"],
|
||||
//["test camerad", "CI=1 python selfdrive/camerad/test/test_camerad.py"], // wait for shelf refactor
|
||||
//["test updater", "python installer/updater/test_updater.py"],
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('HW Tests') {
|
||||
steps {
|
||||
lock(resource: "", label: 'eon', inversePrecedence: true, variable: 'eon_ip', quantity: 1){
|
||||
timeout(time: 60, unit: 'MINUTES') {
|
||||
dir(path: 'selfdrive/test') {
|
||||
sh 'pip install paramiko'
|
||||
sh 'python phone_ci.py "SCONS_CACHE=1 scons -j3 cereal/ && \
|
||||
nosetests -s selfdrive/test/test_sounds.py && \
|
||||
nosetests -s selfdrive/boardd/tests/test_boardd_loopback.py"'
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
cleanWs()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
104
README.md
104
README.md
@@ -64,58 +64,59 @@ 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>1</sup> | 25mph |
|
||||
| Acura | ILX 2016-19 | AcuraWatch Plus | openpilot | 25mph<sup>1</sup> | 25mph |
|
||||
| Acura | RDX 2016-18 | AcuraWatch Plus | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Honda | Accord 2018-19 | All | Stock | 0mph | 3mph |
|
||||
| Acura | RDX 2020 | All | Stock | 0mph | 3mph |
|
||||
| Honda | Accord 2018-20 | All | Stock | 0mph | 3mph |
|
||||
| Honda | Accord Hybrid 2018-20 | All | Stock | 0mph | 3mph |
|
||||
| Honda | Civic Hatchback 2017-19 | Honda Sensing | Stock | 0mph | 12mph |
|
||||
| Honda | Civic Hatchback 2017-21 | Honda Sensing | Stock | 0mph | 12mph |
|
||||
| Honda | Civic Sedan/Coupe 2016-18 | Honda Sensing | openpilot | 0mph | 12mph |
|
||||
| Honda | Civic Sedan/Coupe 2019-20 | Honda Sensing | Stock | 0mph | 2mph<sup>2</sup> |
|
||||
| Honda | Civic Sedan/Coupe 2019-20 | All | Stock | 0mph | 2mph<sup>2</sup> |
|
||||
| Honda | CR-V 2015-16 | Touring | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Honda | CR-V 2017-20 | 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>1</sup> | 12mph |
|
||||
| Honda | HR-V 2019 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Honda | Insight 2019 | Honda Sensing | Stock | 0mph | 3mph |
|
||||
| Honda | HR-V 2019-20 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Honda | Insight 2019-20 | All | Stock | 0mph | 3mph |
|
||||
| Honda | Inspire 2018 | All | Stock | 0mph | 3mph |
|
||||
| Honda | Odyssey 2018-20 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 0mph |
|
||||
| Honda | Passport 2019 | All | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Honda | Pilot 2016-18 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Honda | Pilot 2019 | All | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Honda | Pilot 2016-19 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Honda | Ridgeline 2017-20 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Hyundai | Sonata 2020 | All | Stock | 0mph | 0mph |
|
||||
| Lexus | CT Hybrid 2017-18 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Lexus | ES 2019 | All | openpilot | 0mph | 0mph |
|
||||
| Hyundai | Palisade 2020 | All | Stock | 0mph | 0mph |
|
||||
| Hyundai | Sonata 2020-21 | All | Stock | 0mph | 0mph |
|
||||
| Lexus | CT Hybrid 2017-18 | LSS | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Lexus | ES 2019-20 | 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 | NX 2018 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Lexus | NX Hybrid 2018 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Lexus | RX 2016-17 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Lexus | RX 2020 | All | openpilot | 0mph | 0mph |
|
||||
| Lexus | RX 2016-18 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Lexus | RX 2020-21 | All | openpilot | 0mph | 0mph |
|
||||
| Lexus | RX Hybrid 2016-19 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Lexus | RX Hybrid 2020 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Avalon 2016 | TSS-P | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
|
||||
| Toyota | Avalon 2017-18 | All | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
|
||||
| Toyota | Avalon 2016-18 | TSS-P | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
|
||||
| Toyota | Camry 2018-20 | All | Stock | 0mph<sup>4</sup> | 0mph |
|
||||
| Toyota | Camry Hybrid 2018-19 | All | Stock | 0mph<sup>4</sup> | 0mph |
|
||||
| Toyota | Camry 2021 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Camry Hybrid 2018-20 | All | Stock | 0mph<sup>4</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>3</sup>| 20mph<sup>1</sup> | 0mph |
|
||||
| Toyota | Corolla 2020 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Corolla 2020-21 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Corolla Hatchback 2019-20 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Corolla Hybrid 2020 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Corolla Hybrid 2020-21 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Highlander 2017-19 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Toyota | Highlander 2020-21 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Highlander Hybrid 2017-19 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Toyota | Highlander 2020 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Highlander Hybrid 2020 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Prius 2016 | TSS-P | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Toyota | Prius 2017-20 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Toyota | Highlander Hybrid 2020-21 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Prius 2016-20 | TSS-P | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Toyota | Prius 2021 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Prius Prime 2017-20 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Toyota | Rav4 2016 | TSS-P | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
|
||||
| Toyota | Rav4 2017-18 | All | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
|
||||
| Toyota | Rav4 2019-20 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Rav4 Hybrid 2016 | TSS-P | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Toyota | Rav4 Hybrid 2017-18 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Toyota | Rav4 Hybrid 2019-20 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Rav4 2016-18 | TSS-P | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
|
||||
| Toyota | Rav4 2019-21 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Rav4 Hybrid 2016-18 | TSS-P | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Toyota | Rav4 Hybrid 2019-21 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Sienna 2018-20 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
|
||||
<sup>1</sup>[Comma Pedal](https://github.com/commaai/openpilot/wiki/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. ***NOTE: The Comma Pedal is not officially supported by [comma](https://comma.ai).*** <br />
|
||||
@@ -136,37 +137,38 @@ Community Maintained Cars and Features
|
||||
| Chrysler | Pacifica 2020 | Adaptive Cruise | Stock | 0mph | 39mph |
|
||||
| Chrysler | Pacifica Hybrid 2017-18 | Adaptive Cruise | Stock | 0mph | 9mph |
|
||||
| Chrysler | Pacifica Hybrid 2019-20 | Adaptive Cruise | Stock | 0mph | 39mph |
|
||||
| Genesis | G70 2018 | All | Stock | 0mph | 0mph |
|
||||
| Genesis | G80 2018 | All | Stock | 0mph | 0mph |
|
||||
| Genesis | G90 2018 | All | Stock | 0mph | 0mph |
|
||||
| GMC | Acadia Denali 2018<sup>2</sup>| Adaptive Cruise | openpilot | 0mph | 7mph |
|
||||
| GMC | Acadia 2018<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
|
||||
| Holden | Astra 2017<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
|
||||
| Hyundai | Elantra 2017-19 | SCC + LKAS | Stock | 19mph | 34mph |
|
||||
| Hyundai | Genesis 2015-16 | SCC + LKAS | Stock | 19mph | 37mph |
|
||||
| Hyundai | Ioniq Electric Premium SE 2020| SCC + LKAS | Stock | 0mph | 32mph |
|
||||
| Hyundai | Ioniq Electric Limited 2019 | SCC + LKAS | Stock | 0mph | 32mph |
|
||||
| Hyundai | Kona 2017-19 | SCC + LKAS | Stock | 22mph | 0mph |
|
||||
| Hyundai | Ioniq Electric 2019 | SCC + LKAS | Stock | 0mph | 32mph |
|
||||
| Hyundai | Ioniq Electric 2020 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Kona 2020 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Kona EV 2019 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Palisade 2020 | All | Stock | 0mph | 0mph |
|
||||
| Hyundai | Santa Fe 2019 | All | Stock | 0mph | 0mph |
|
||||
| Hyundai | Sonata 2019 | All | Stock | 0mph | 0mph |
|
||||
| Hyundai | Sonata 2019 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Veloster 2019 | SCC + LKAS | Stock | 5mph | 0mph |
|
||||
| Jeep | Grand Cherokee 2016-18 | Adaptive Cruise | Stock | 0mph | 9mph |
|
||||
| Jeep | Grand Cherokee 2019-20 | Adaptive Cruise | Stock | 0mph | 39mph |
|
||||
| Kia | Forte 2018-19 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Optima 2017 | SCC + LKAS/LDWS | Stock | 0mph | 32mph |
|
||||
| Kia | Niro EV 2020 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Optima 2017 | SCC + LKAS | Stock | 0mph | 32mph |
|
||||
| Kia | Optima 2019 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Sorento 2018 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Stinger 2018 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Nissan | Leaf 2018-19<sup>2</sup> | Propilot | Stock | 0mph | 0mph |
|
||||
| Nissan | Rogue 2019<sup>2</sup> | Propilot | Stock | 0mph | 0mph |
|
||||
| Nissan | X-Trail 2017<sup>2</sup> | Propilot | Stock | 0mph | 0mph |
|
||||
| Nissan | Leaf 2018-20 | ProPILOT | Stock | 0mph | 0mph |
|
||||
| Nissan | Rogue 2018-19 | ProPILOT | Stock | 0mph | 0mph |
|
||||
| Nissan | X-Trail 2017 | ProPILOT | Stock | 0mph | 0mph |
|
||||
| Subaru | Ascent 2019 | EyeSight | Stock | 0mph | 0mph |
|
||||
| Subaru | Crosstrek 2018-19 | EyeSight | Stock | 0mph | 0mph |
|
||||
| Subaru | Forester 2019 | EyeSight | Stock | 0mph | 0mph |
|
||||
| Subaru | Forester 2019-20 | EyeSight | Stock | 0mph | 0mph |
|
||||
| Subaru | Impreza 2017-19 | EyeSight | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Golf 2015-19 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
|
||||
<sup>1</sup>Requires an [OBD-II car harness](https://comma.ai/shop/products/comma-car-harness) and [community built giraffe](https://github.com/commaai/openpilot/wiki/GM). ***NOTE: disconnecting the ASCM disables Automatic Emergency Braking (AEB).*** <br />
|
||||
<sup>2</sup>Requires a custom connector for the developer [car harness](https://comma.ai/shop/products/car-harness) <br />
|
||||
<sup>1</sup>Requires an [OBD-II car harness](https://comma.ai/shop/products/comma-car-harness) and [community built ASCM harness](https://github.com/commaai/openpilot/wiki/GM#hardware). ***NOTE: disconnecting the ASCM disables Automatic Emergency Braking (AEB).*** <br />
|
||||
|
||||
Although it's not upstream, there's a community of people getting openpilot to run on Tesla's [here](https://tinkla.us/)
|
||||
|
||||
@@ -242,7 +244,6 @@ Many factors can impact the performance of openpilot DM, causing it to be unable
|
||||
* Low light conditions, such as driving at night or in dark tunnels.
|
||||
* Bright light (due to oncoming headlights, direct sunlight, etc.).
|
||||
* The driver's 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.
|
||||
@@ -272,8 +273,23 @@ Safety and Testing
|
||||
|
||||
Testing on PC
|
||||
------
|
||||
For simplified development and experimentation, openpilot can be run in the CARLA driving simulator, which allows you to develop openpilot without a car. The whole setup should only take a few minutes.
|
||||
|
||||
Steps:
|
||||
1) Start the CARLA server on first terminal
|
||||
```
|
||||
bash -c "$(curl https://raw.githubusercontent.com/commaai/openpilot/master/tools/sim/start_carla.sh)"
|
||||
```
|
||||
2) Start openpilot on second terminal
|
||||
```
|
||||
bash -c "$(curl https://raw.githubusercontent.com/commaai/openpilot/master/tools/sim/start_openpilot_docker.sh)"
|
||||
```
|
||||
3) Press 1 to engage openpilot
|
||||
|
||||
See the full [README](tools/sim/README.md)
|
||||
|
||||
You should also take a look at the tools directory in master: lots of tools you can use to replay driving data, test, and develop openpilot from your 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
|
||||
------
|
||||
@@ -298,7 +314,7 @@ Directory Structure
|
||||
├── phonelibs # Libraries used on NEOS devices
|
||||
├── pyextra # Libraries used on NEOS devices
|
||||
└── selfdrive # Code needed to drive the car
|
||||
├── assets # Fonts, images, and sounds for UI
|
||||
├── assets # Fonts, images and sounds for UI
|
||||
├── athena # Allows communication with the app
|
||||
├── boardd # Daemon to talk to the board
|
||||
├── camerad # Driver to capture images from the camera sensors
|
||||
|
||||
173
RELEASES.md
173
RELEASES.md
@@ -1,3 +1,50 @@
|
||||
Version 0.8.1 (2020-12-21)
|
||||
========================
|
||||
* Original EON is deprecated, upgrade to comma two
|
||||
* Better model performance in heavy rain
|
||||
* Better lane positioning in turns
|
||||
* Fixed bug where model would cut turns on empty roads at night
|
||||
* Fixed issue where some Toyotas would not completely stop thanks to briskspirit!
|
||||
* Toyota Camry 2021 with TSS2.5 support
|
||||
* Hyundai Ioniq Electric 2020 support thanks to baldwalker!
|
||||
|
||||
Version 0.8.0 (2020-11-30)
|
||||
========================
|
||||
* New driving model: fully 3D and improved cut-in detection
|
||||
* UI draws 2 road edges, 4 lanelines and paths in 3D
|
||||
* Major fixes to cut-in detection for openpilot longitudinal
|
||||
* Grey panda is no longer supported, upgrade to comma two or black panda
|
||||
* Lexus NX 2018 support thanks to matt12eagles!
|
||||
* Kia Niro EV 2020 support thanks to nickn17!
|
||||
* Toyota Prius 2021 support thanks to rav4kumar!
|
||||
* Improved lane positioning with uncertain lanelines, wide lanes and exits
|
||||
* Improved lateral control for Prius and Subaru
|
||||
|
||||
Version 0.7.10 (2020-10-29)
|
||||
========================
|
||||
* Grey panda is deprecated, upgrade to comma two or black panda
|
||||
* NEOS update: update to Python 3.8.2 and lower CPU frequency
|
||||
* Improved thermals due to reduced CPU frequency
|
||||
* Update SNPE to 1.41.0
|
||||
* Reduced offroad power consumption
|
||||
* Various system stability improvements
|
||||
* Acura RDX 2020 support thanks to csouers!
|
||||
|
||||
Version 0.7.9 (2020-10-09)
|
||||
========================
|
||||
* Improved car battery power management
|
||||
* Improved updater robustness
|
||||
* Improved realtime performance
|
||||
* Reduced UI and modeld lags
|
||||
* Increased torque on 2020 Hyundai Sonata and Palisade
|
||||
|
||||
Version 0.7.8 (2020-08-19)
|
||||
========================
|
||||
* New driver monitoring model: improved face detection and better compatibility with sunglasses
|
||||
* Download NEOS operating system updates in the background
|
||||
* Improved updater reliability and responsiveness
|
||||
* Hyundai Kona 2020, Veloster 2019, and Genesis G70 2018 support thanks to xps-genesis!
|
||||
|
||||
Version 0.7.7 (2020-07-20)
|
||||
========================
|
||||
* White panda is no longer supported, upgrade to comma two or black panda
|
||||
@@ -14,24 +61,24 @@ Version 0.7.7 (2020-07-20)
|
||||
|
||||
Version 0.7.6.1 (2020-06-16)
|
||||
========================
|
||||
* Hotfix: update kernel on some comma twos (orders #8570-#8680)
|
||||
* Hotfix: update kernel on some comma twos (orders #8570-#8680)
|
||||
|
||||
Version 0.7.6 (2020-06-05)
|
||||
========================
|
||||
* White panda is deprecated, upgrade to comma two or black panda
|
||||
* 2017 Nissan X-Trail, 2018-19 Leaf and 2019 Rogue support thanks to avolmensky!
|
||||
* 2017 Mazda CX-5 support in dashcam mode thanks to Jafaral!
|
||||
* Huge CPU savings in modeld by using thneed!
|
||||
* Lots of code cleanup and refactors
|
||||
* White panda is deprecated, upgrade to comma two or black panda
|
||||
* 2017 Nissan X-Trail, 2018-19 Leaf and 2019 Rogue support thanks to avolmensky!
|
||||
* 2017 Mazda CX-5 support in dashcam mode thanks to Jafaral!
|
||||
* Huge CPU savings in modeld by using thneed!
|
||||
* Lots of code cleanup and refactors
|
||||
|
||||
Version 0.7.5 (2020-05-13)
|
||||
========================
|
||||
* Right-Hand Drive support for both driving and driver monitoring!
|
||||
* New driving model: improved at sharp turns and lead speed estimation
|
||||
* New driver monitoring model: overall improvement on comma two
|
||||
* Driver camera preview in settings to improve mounting position
|
||||
* Added support for many Hyundai, Kia, Genesis models thanks to xx979xx!
|
||||
* Improved lateral tuning for 2020 Toyota Rav 4 (hybrid)
|
||||
* Right-Hand Drive support for both driving and driver monitoring!
|
||||
* New driving model: improved at sharp turns and lead speed estimation
|
||||
* New driver monitoring model: overall improvement on comma two
|
||||
* Driver camera preview in settings to improve mounting position
|
||||
* Added support for many Hyundai, Kia, Genesis models thanks to xx979xx!
|
||||
* Improved lateral tuning for 2020 Toyota Rav 4 (hybrid)
|
||||
|
||||
Version 0.7.4 (2020-03-20)
|
||||
========================
|
||||
@@ -467,96 +514,96 @@ Version 0.3.4 (2017-07-28)
|
||||
|
||||
Version 0.3.3 (2017-06-28)
|
||||
===========================
|
||||
* Improved model trained on more data
|
||||
* Alpha CR-V support thanks to energee and johnnwvs!
|
||||
* Using the opendbc project for DBC files
|
||||
* Minor performance improvements
|
||||
* UI update thanks to pjlao307
|
||||
* Power off button
|
||||
* 6% more torque on the Civic
|
||||
* Improved model trained on more data
|
||||
* Alpha CR-V support thanks to energee and johnnwvs!
|
||||
* Using the opendbc project for DBC files
|
||||
* Minor performance improvements
|
||||
* UI update thanks to pjlao307
|
||||
* Power off button
|
||||
* 6% more torque on the Civic
|
||||
|
||||
Version 0.3.2 (2017-05-22)
|
||||
===========================
|
||||
* Minor stability bugfixes
|
||||
* Added metrics and rear view mirror disable to settings
|
||||
* Update model with more crowdsourced data
|
||||
* Minor stability bugfixes
|
||||
* Added metrics and rear view mirror disable to settings
|
||||
* Update model with more crowdsourced data
|
||||
|
||||
Version 0.3.1 (2017-05-17)
|
||||
===========================
|
||||
* visiond stability bugfix
|
||||
* Add logging for angle and flashing
|
||||
* visiond stability bugfix
|
||||
* Add logging for angle and flashing
|
||||
|
||||
Version 0.3.0 (2017-05-12)
|
||||
===========================
|
||||
* Add CarParams struct to improve the abstraction layer
|
||||
* Refactor visiond IPC to support multiple clients
|
||||
* Add raw GPS and beginning support for navigation
|
||||
* Improve model in visiond using crowdsourced data
|
||||
* Add improved system logging to diagnose instability
|
||||
* Rewrite baseui in React Native
|
||||
* Moved calibration to the cloud
|
||||
* Add CarParams struct to improve the abstraction layer
|
||||
* Refactor visiond IPC to support multiple clients
|
||||
* Add raw GPS and beginning support for navigation
|
||||
* Improve model in visiond using crowdsourced data
|
||||
* Add improved system logging to diagnose instability
|
||||
* Rewrite baseui in React Native
|
||||
* Moved calibration to the cloud
|
||||
|
||||
Version 0.2.9 (2017-03-01)
|
||||
===========================
|
||||
* Retain compatibility with NEOS v1
|
||||
* Retain compatibility with NEOS v1
|
||||
|
||||
Version 0.2.8 (2017-02-27)
|
||||
===========================
|
||||
* Fix bug where frames were being dropped in minute 71
|
||||
* Fix bug where frames were being dropped in minute 71
|
||||
|
||||
Version 0.2.7 (2017-02-08)
|
||||
===========================
|
||||
* Better performance and pictures at night
|
||||
* Fix ptr alignment issue in boardd
|
||||
* Fix brake error light, fix crash if too cold
|
||||
* Better performance and pictures at night
|
||||
* Fix ptr alignment issue in boardd
|
||||
* Fix brake error light, fix crash if too cold
|
||||
|
||||
Version 0.2.6 (2017-01-31)
|
||||
===========================
|
||||
* Fix bug in visiond model execution
|
||||
* Fix bug in visiond model execution
|
||||
|
||||
Version 0.2.5 (2017-01-30)
|
||||
===========================
|
||||
* Fix race condition in manager
|
||||
* Fix race condition in manager
|
||||
|
||||
Version 0.2.4 (2017-01-27)
|
||||
===========================
|
||||
* OnePlus 3T support
|
||||
* Enable installation as NEOS app
|
||||
* Various minor bugfixes
|
||||
* OnePlus 3T support
|
||||
* Enable installation as NEOS app
|
||||
* Various minor bugfixes
|
||||
|
||||
Version 0.2.3 (2017-01-11)
|
||||
===========================
|
||||
* Reduce space usage by 80%
|
||||
* Add better logging
|
||||
* Add Travis CI
|
||||
* Reduce space usage by 80%
|
||||
* Add better logging
|
||||
* Add Travis CI
|
||||
|
||||
Version 0.2.2 (2017-01-10)
|
||||
===========================
|
||||
* Board triggers started signal on CAN messages
|
||||
* Improved autoexposure
|
||||
* Handle out of space, improve upload status
|
||||
* Board triggers started signal on CAN messages
|
||||
* Improved autoexposure
|
||||
* Handle out of space, improve upload status
|
||||
|
||||
Version 0.2.1 (2016-12-14)
|
||||
===========================
|
||||
* Performance improvements, removal of more numpy
|
||||
* Fix boardd process priority
|
||||
* Make counter timer reset on use of steering wheel
|
||||
* Performance improvements, removal of more numpy
|
||||
* Fix boardd process priority
|
||||
* Make counter timer reset on use of steering wheel
|
||||
|
||||
Version 0.2 (2016-12-12)
|
||||
=========================
|
||||
* Car/Radar abstraction layers have shipped, see cereal/car.capnp
|
||||
* controlsd has been refactored
|
||||
* Shipped plant model and testing maneuvers
|
||||
* visiond exits more gracefully now
|
||||
* Hardware encoder in visiond should always init
|
||||
* ui now turns off the screen after 30 seconds
|
||||
* Switch to openpilot release branch for future releases
|
||||
* Added preliminary Docker container to run tests on PC
|
||||
* Car/Radar abstraction layers have shipped, see cereal/car.capnp
|
||||
* controlsd has been refactored
|
||||
* Shipped plant model and testing maneuvers
|
||||
* visiond exits more gracefully now
|
||||
* Hardware encoder in visiond should always init
|
||||
* ui now turns off the screen after 30 seconds
|
||||
* Switch to openpilot release branch for future releases
|
||||
* Added preliminary Docker container to run tests on PC
|
||||
|
||||
Version 0.1 (2016-11-29)
|
||||
=========================
|
||||
* Initial release of openpilot
|
||||
* Adaptive cruise control is working
|
||||
* Lane keep assist is working
|
||||
* Support for Acura ILX 2016 with AcuraWatch Plus
|
||||
* Support for Honda Civic 2016 Touring Edition
|
||||
* Initial release of openpilot
|
||||
* Adaptive cruise control is working
|
||||
* Lane keep assist is working
|
||||
* Support for Acura ILX 2016 with AcuraWatch Plus
|
||||
* Support for Honda Civic 2016 Touring Edition
|
||||
|
||||
85
SConstruct
85
SConstruct
@@ -2,7 +2,12 @@ import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import sysconfig
|
||||
import platform
|
||||
import numpy as np
|
||||
|
||||
TICI = os.path.isfile('/TICI')
|
||||
Decider('MD5-timestamp')
|
||||
|
||||
AddOption('--test',
|
||||
action='store_true',
|
||||
@@ -12,13 +17,14 @@ AddOption('--asan',
|
||||
action='store_true',
|
||||
help='turn on ASAN')
|
||||
|
||||
arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
|
||||
real_arch = arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
|
||||
if platform.system() == "Darwin":
|
||||
arch = "Darwin"
|
||||
if arch == "aarch64" and not os.path.isdir("/system"):
|
||||
|
||||
if arch == "aarch64" and TICI:
|
||||
arch = "larch64"
|
||||
|
||||
webcam = bool(ARGUMENTS.get("use_webcam", 0))
|
||||
USE_WEBCAM = os.getenv("USE_WEBCAM") is not None
|
||||
QCOM_REPLAY = arch == "aarch64" and os.getenv("QCOM_REPLAY") is not None
|
||||
|
||||
if arch == "aarch64" or arch == "larch64":
|
||||
@@ -38,7 +44,6 @@ if arch == "aarch64" or arch == "larch64":
|
||||
|
||||
libpath = [
|
||||
"/usr/lib",
|
||||
"/data/data/com.termux/files/usr/lib",
|
||||
"/system/vendor/lib64",
|
||||
"/system/comma/usr/lib",
|
||||
"#phonelibs/nanovg",
|
||||
@@ -56,11 +61,12 @@ if arch == "aarch64" or arch == "larch64":
|
||||
else:
|
||||
libpath += [
|
||||
"#phonelibs/snpe/aarch64",
|
||||
"#phonelibs/libyuv/lib"
|
||||
"#phonelibs/libyuv/lib",
|
||||
"/system/vendor/lib64"
|
||||
]
|
||||
cflags = ["-DQCOM", "-mcpu=cortex-a57"]
|
||||
cxxflags = ["-DQCOM", "-mcpu=cortex-a57"]
|
||||
rpath = ["/system/vendor/lib64"]
|
||||
rpath = []
|
||||
|
||||
if QCOM_REPLAY:
|
||||
cflags += ["-DQCOM_REPLAY"]
|
||||
@@ -99,6 +105,7 @@ else:
|
||||
]
|
||||
|
||||
rpath = [
|
||||
"phonelibs/snpe/x86_64-linux-clang",
|
||||
"external/tensorflow/lib",
|
||||
"cereal",
|
||||
"selfdrive/common"
|
||||
@@ -125,8 +132,12 @@ env = Environment(
|
||||
"-O2",
|
||||
"-Wunused",
|
||||
"-Werror",
|
||||
"-Wno-unknown-warning-option",
|
||||
"-Wno-deprecated-register",
|
||||
"-Wno-register",
|
||||
"-Wno-inconsistent-missing-override",
|
||||
"-Wno-c99-designator",
|
||||
"-Wno-reorder-init-list",
|
||||
] + cflags + ccflags_asan,
|
||||
|
||||
CPPPATH=cpppath + [
|
||||
@@ -137,7 +148,6 @@ env = Environment(
|
||||
"#phonelibs/openmax/include",
|
||||
"#phonelibs/json11",
|
||||
"#phonelibs/curl/include",
|
||||
#"#phonelibs/opencv/include", # use opencv4 instead
|
||||
"#phonelibs/libgralloc/include",
|
||||
"#phonelibs/android_frameworks_native/include",
|
||||
"#phonelibs/android_hardware_libhardware/include",
|
||||
@@ -145,11 +155,14 @@ env = Environment(
|
||||
"#phonelibs/linux/include",
|
||||
"#phonelibs/snpe/include",
|
||||
"#phonelibs/nanovg",
|
||||
"#selfdrive/boardd",
|
||||
"#selfdrive/common",
|
||||
"#selfdrive/camerad",
|
||||
"#selfdrive/camerad/include",
|
||||
"#selfdrive/loggerd/include",
|
||||
"#selfdrive/modeld",
|
||||
"#selfdrive/sensord",
|
||||
"#selfdrive/ui",
|
||||
"#cereal/messaging",
|
||||
"#cereal",
|
||||
"#opendbc/can",
|
||||
@@ -162,27 +175,30 @@ env = Environment(
|
||||
RPATH=rpath,
|
||||
|
||||
CFLAGS=["-std=gnu11"] + cflags,
|
||||
CXXFLAGS=["-std=c++14"] + cxxflags,
|
||||
CXXFLAGS=["-std=c++1z"] + cxxflags,
|
||||
LIBPATH=libpath + [
|
||||
"#cereal",
|
||||
"#selfdrive/common",
|
||||
"#phonelibs",
|
||||
]
|
||||
"#opendbc/can",
|
||||
"#selfdrive/boardd",
|
||||
"#selfdrive/common",
|
||||
],
|
||||
CYTHONCFILESUFFIX=".cpp",
|
||||
COMPILATIONDB_USE_ABSPATH=True,
|
||||
tools=["default", "cython", "compilation_db"],
|
||||
)
|
||||
|
||||
if GetOption('test'):
|
||||
env.CompilationDatabase('compile_commands.json')
|
||||
|
||||
if os.environ.get('SCONS_CACHE'):
|
||||
cache_dir = '/tmp/scons_cache'
|
||||
if TICI:
|
||||
cache_dir = '/data/scons_cache'
|
||||
|
||||
if os.getenv('CI'):
|
||||
branch = os.getenv('GIT_BRANCH')
|
||||
if QCOM_REPLAY:
|
||||
cache_dir = '/tmp/scons_cache_qcom_replay'
|
||||
|
||||
if QCOM_REPLAY:
|
||||
cache_dir = '/tmp/scons_cache_qcom_replay'
|
||||
elif branch is not None and branch != 'master':
|
||||
cache_dir_branch = '/tmp/scons_cache_' + branch
|
||||
if not os.path.isdir(cache_dir_branch) and os.path.isdir(cache_dir):
|
||||
shutil.copytree(cache_dir, cache_dir_branch)
|
||||
cache_dir = cache_dir_branch
|
||||
CacheDir(cache_dir)
|
||||
|
||||
node_interval = 5
|
||||
@@ -206,9 +222,26 @@ def abspath(x):
|
||||
# rpath works elsewhere
|
||||
return x[0].path.rsplit("/", 1)[1][:-3]
|
||||
|
||||
# Cython build enviroment
|
||||
py_include = sysconfig.get_paths()['include']
|
||||
envCython = env.Clone()
|
||||
envCython["CPPPATH"] += [py_include, np.get_include()]
|
||||
envCython["CCFLAGS"] += ["-Wno-#warnings", "-Wno-deprecated-declarations"]
|
||||
|
||||
envCython["LIBS"] = []
|
||||
if arch == "Darwin":
|
||||
envCython["LINKFLAGS"] = ["-bundle", "-undefined", "dynamic_lookup"]
|
||||
elif arch == "aarch64":
|
||||
envCython["LINKFLAGS"] = ["-shared"]
|
||||
envCython["LIBS"] = [os.path.basename(py_include)]
|
||||
else:
|
||||
envCython["LINKFLAGS"] = ["-pthread", "-shared"]
|
||||
|
||||
Export('envCython')
|
||||
|
||||
# still needed for apks
|
||||
zmq = 'zmq'
|
||||
Export('env', 'arch', 'zmq', 'SHARED', 'webcam', 'QCOM_REPLAY')
|
||||
Export('env', 'arch', 'real_arch', 'zmq', 'SHARED', 'USE_WEBCAM', 'QCOM_REPLAY')
|
||||
|
||||
# cereal and messaging are shared with the system
|
||||
SConscript(['cereal/SConscript'])
|
||||
@@ -249,16 +282,18 @@ SConscript(['selfdrive/controls/lib/longitudinal_mpc_model/SConscript'])
|
||||
|
||||
SConscript(['selfdrive/boardd/SConscript'])
|
||||
SConscript(['selfdrive/proclogd/SConscript'])
|
||||
SConscript(['selfdrive/clocksd/SConscript'])
|
||||
|
||||
SConscript(['selfdrive/ui/SConscript'])
|
||||
SConscript(['selfdrive/loggerd/SConscript'])
|
||||
|
||||
SConscript(['selfdrive/locationd/SConscript'])
|
||||
SConscript(['selfdrive/locationd/models/SConscript'])
|
||||
SConscript(['selfdrive/sensord/SConscript'])
|
||||
SConscript(['selfdrive/ui/SConscript'])
|
||||
|
||||
if arch == "aarch64":
|
||||
if arch != "Darwin":
|
||||
SConscript(['selfdrive/logcatd/SConscript'])
|
||||
SConscript(['selfdrive/sensord/SConscript'])
|
||||
SConscript(['selfdrive/clocksd/SConscript'])
|
||||
else:
|
||||
|
||||
if arch == "x86_64":
|
||||
SConscript(['tools/lib/index_log/SConscript'])
|
||||
|
||||
|
||||
Binary file not shown.
1
cereal/.gitignore
vendored
1
cereal/.gitignore
vendored
@@ -1,6 +1,7 @@
|
||||
gen
|
||||
node_modules
|
||||
package-lock.json
|
||||
*.tmp
|
||||
*.pyc
|
||||
__pycache__
|
||||
.*.swp
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
Import('env', 'arch', 'zmq')
|
||||
Import('env', 'envCython', 'arch', 'zmq')
|
||||
|
||||
import shutil
|
||||
|
||||
cereal_dir = Dir('.')
|
||||
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/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
|
||||
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'],
|
||||
f"capnpc --src-prefix={cereal_dir.path} $SOURCES -o c++:{gen_dir.path}/cpp/")
|
||||
|
||||
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/')
|
||||
env.Command(['gen/java/Car.java', 'gen/java/Log.java'],
|
||||
['car.capnp', 'log.capnp'],
|
||||
f"capnpc $SOURCES --src-prefix={cereal_dir.path} -o java:{gen_dir.path}/java/")
|
||||
|
||||
# TODO: remove non shared cereal and messaging
|
||||
cereal_objects = env.SharedObject([
|
||||
'gen/cpp/car.capnp.c++',
|
||||
'gen/cpp/log.capnp.c++',
|
||||
])
|
||||
'gen/cpp/car.capnp.c++',
|
||||
'gen/cpp/log.capnp.c++',
|
||||
])
|
||||
|
||||
env.Library('cereal', cereal_objects)
|
||||
env.SharedLibrary('cereal_shared', cereal_objects)
|
||||
|
||||
cereal_dir = Dir('.')
|
||||
services_h = env.Command(
|
||||
['services.h'],
|
||||
['service_list.yaml', 'services.py'],
|
||||
'python3 ' + cereal_dir.path + '/services.py > $TARGET')
|
||||
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',
|
||||
@@ -55,11 +55,7 @@ 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")
|
||||
|
||||
envCython.Program('messaging/messaging_pyx.so', 'messaging/messaging_pyx.pyx', LIBS=envCython["LIBS"]+[messaging_lib, "zmq"])
|
||||
|
||||
if GetOption('test'):
|
||||
env.Program('messaging/test_runner', ['messaging/test_runner.cc', 'messaging/msgq_tests.cc'], LIBS=[messaging_lib])
|
||||
|
||||
@@ -25,7 +25,6 @@ struct CarEvent @0x9b1657f34caf3ad3 {
|
||||
canError @0;
|
||||
steerUnavailable @1;
|
||||
brakeUnavailable @2;
|
||||
gasUnavailable @3;
|
||||
wrongGear @4;
|
||||
doorOpen @5;
|
||||
seatbeltNotLatched @6;
|
||||
@@ -38,7 +37,6 @@ struct CarEvent @0x9b1657f34caf3ad3 {
|
||||
pedalPressed @13;
|
||||
cruiseDisabled @14;
|
||||
radarCanError @15;
|
||||
dataNeededDEPRECATED @16;
|
||||
speedTooLow @17;
|
||||
outOfSpace @18;
|
||||
overheat @19;
|
||||
@@ -49,29 +47,22 @@ struct CarEvent @0x9b1657f34caf3ad3 {
|
||||
pcmDisable @24;
|
||||
noTarget @25;
|
||||
radarFault @26;
|
||||
modelCommIssueDEPRECATED @27;
|
||||
brakeHold @28;
|
||||
parkBrake @29;
|
||||
manualRestart @30;
|
||||
lowSpeedLockout @31;
|
||||
plannerError @32;
|
||||
ipasOverrideDEPRECATED @33;
|
||||
debugAlert @34;
|
||||
steerTempUnavailableMute @35;
|
||||
resumeRequired @36;
|
||||
preDriverDistracted @37;
|
||||
promptDriverDistracted @38;
|
||||
driverDistracted @39;
|
||||
geofenceDEPRECATED @40;
|
||||
driverMonitorOnDEPRECATED @41;
|
||||
driverMonitorOffDEPRECATED @42;
|
||||
preDriverUnresponsive @43;
|
||||
promptDriverUnresponsive @44;
|
||||
driverUnresponsive @45;
|
||||
belowSteerSpeed @46;
|
||||
calibrationProgressDEPRECATED @47;
|
||||
lowBattery @48;
|
||||
invalidGiraffeHondaDEPRECATED @49;
|
||||
vehicleModelInvalid @50;
|
||||
controlsFailed @51;
|
||||
sensorDataInvalid @52;
|
||||
@@ -82,7 +73,6 @@ struct CarEvent @0x9b1657f34caf3ad3 {
|
||||
preLaneChangeLeft @57;
|
||||
preLaneChangeRight @58;
|
||||
laneChange @59;
|
||||
invalidGiraffeToyota @60;
|
||||
internetConnectivityNeeded @61;
|
||||
communityFeatureDisallowed @62;
|
||||
lowMemory @63;
|
||||
@@ -103,23 +93,43 @@ struct CarEvent @0x9b1657f34caf3ad3 {
|
||||
startupMaster @78;
|
||||
fcw @79;
|
||||
steerSaturated @80;
|
||||
whitePandaUnsupported @81;
|
||||
startupWhitePanda @82;
|
||||
canErrorPersistentDEPRECATED @83;
|
||||
belowEngageSpeed @84;
|
||||
noGps @85;
|
||||
focusRecoverActive @86;
|
||||
wrongCruiseMode @87;
|
||||
neosUpdateRequired @88;
|
||||
modeldLagging @89;
|
||||
deviceFalling @90;
|
||||
fanMalfunction @91;
|
||||
cameraMalfunction @92;
|
||||
|
||||
startupOneplus @82;
|
||||
|
||||
gasUnavailableDEPRECATED @3;
|
||||
dataNeededDEPRECATED @16;
|
||||
modelCommIssueDEPRECATED @27;
|
||||
ipasOverrideDEPRECATED @33;
|
||||
geofenceDEPRECATED @40;
|
||||
driverMonitorOnDEPRECATED @41;
|
||||
driverMonitorOffDEPRECATED @42;
|
||||
calibrationProgressDEPRECATED @47;
|
||||
invalidGiraffeHondaDEPRECATED @49;
|
||||
invalidGiraffeToyotaDEPRECATED @60;
|
||||
whitePandaUnsupportedDEPRECATED @81;
|
||||
commIssueWarningDEPRECATED @83;
|
||||
focusRecoverActiveDEPRECATED @86;
|
||||
neosUpdateRequiredDEPRECATED @88;
|
||||
modelLagWarningDEPRECATED @93;
|
||||
|
||||
#dp
|
||||
preLaneChangeLeftALC @90;
|
||||
preLaneChangeRightALC @91;
|
||||
laneChangeALC @92;
|
||||
manualSteeringRequired @93;
|
||||
manualSteeringRequiredBlinkersOn @94;
|
||||
leadCarMoving @95;
|
||||
preLaneChangeLeftALC @94;
|
||||
preLaneChangeRightALC @95;
|
||||
manualSteeringRequired @96;
|
||||
manualSteeringRequiredBlinkersOn @97;
|
||||
leadCarMoving @98;
|
||||
|
||||
# timebomb assist
|
||||
timebombWarn @99;
|
||||
timebombBypassing @100;
|
||||
timebombBypassed @101;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,6 +199,7 @@ struct CarState {
|
||||
|
||||
# dp
|
||||
lkMode @37 :Bool;
|
||||
stopSteering @38 :Bool; # timebomb - stopSteering
|
||||
|
||||
struct WheelSpeeds {
|
||||
# optional wheel speeds
|
||||
@@ -404,6 +415,9 @@ struct CarParams {
|
||||
steerRateCost @33 :Float32; # Lateral MPC cost on steering rate
|
||||
steerControlType @34 :SteerControlType;
|
||||
radarOffCan @35 :Bool; # True when radar objects aren't visible on CAN
|
||||
minSpeedCan @51 :Float32; # Minimum vehicle speed from CAN (below this value drops to 0)
|
||||
stoppingBrakeRate @52 :Float32; # brake_travel/s while trying to stop
|
||||
startingBrakeRate @53 :Float32; # brake_travel/s while releasing on restart
|
||||
|
||||
steerActuatorDelay @36 :Float32; # Steering wheel actuator delay in seconds
|
||||
openpilotLongitudinalControl @37 :Bool; # is openpilot doing the longitudinal control?
|
||||
@@ -485,6 +499,7 @@ struct CarParams {
|
||||
volkswagenPq @21;
|
||||
subaruLegacy @22; # pre-Global platform
|
||||
hyundaiLegacy @23;
|
||||
hyundaiCommunity @24;
|
||||
}
|
||||
|
||||
enum SteerControlType {
|
||||
|
||||
260
cereal/log.capnp
260
cereal/log.capnp
@@ -49,6 +49,8 @@ struct InitData {
|
||||
neo @1;
|
||||
chffrAndroid @2;
|
||||
chffrIos @3;
|
||||
tici @4;
|
||||
pc @5;
|
||||
}
|
||||
|
||||
struct AndroidBuildInfo {
|
||||
@@ -186,6 +188,7 @@ struct SensorEventData {
|
||||
gyroUncalibrated @12 :SensorVec;
|
||||
proximity @13: Float32;
|
||||
light @14: Float32;
|
||||
temperature @15: Float32;
|
||||
}
|
||||
source @8 :SensorSource;
|
||||
|
||||
@@ -203,6 +206,8 @@ struct SensorEventData {
|
||||
lsm6ds3 @5; # accelerometer (c2)
|
||||
bmp280 @6; # barometer (c2)
|
||||
mmc3416x @7; # magnetometer (c2)
|
||||
bmx055 @8;
|
||||
rpr0521 @9;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,14 +272,15 @@ struct CanData {
|
||||
}
|
||||
|
||||
struct ThermalData {
|
||||
cpu0 @0 :UInt16;
|
||||
cpu1 @1 :UInt16;
|
||||
cpu2 @2 :UInt16;
|
||||
cpu3 @3 :UInt16;
|
||||
mem @4 :UInt16;
|
||||
gpu @5 :UInt16;
|
||||
bat @6 :UInt32;
|
||||
pa0 @21 :UInt16;
|
||||
# Deprecated
|
||||
cpu0DEPRECATED @0 :UInt16;
|
||||
cpu1DEPRECATED @1 :UInt16;
|
||||
cpu2DEPRECATED @2 :UInt16;
|
||||
cpu3DEPRECATED @3 :UInt16;
|
||||
memDEPRECATED @4 :UInt16;
|
||||
gpuDEPRECATED @5 :UInt16;
|
||||
batDEPRECATED @6 :UInt32;
|
||||
pa0DEPRECATED @21 :UInt16;
|
||||
|
||||
# not thermal
|
||||
freeSpace @7 :Float32;
|
||||
@@ -286,6 +292,7 @@ struct ThermalData {
|
||||
networkType @22 :NetworkType;
|
||||
offroadPowerUsage @23 :UInt32; # Power usage since going offroad in uWh
|
||||
networkStrength @24 :NetworkStrength;
|
||||
carBatteryCapacity @25 :UInt32; # Estimated remaining car battery capacity in uWh
|
||||
|
||||
fanSpeed @10 :UInt16;
|
||||
started @11 :Bool;
|
||||
@@ -298,6 +305,12 @@ struct ThermalData {
|
||||
memUsedPercent @19 :Int8;
|
||||
cpuPerc @20 :Int8;
|
||||
|
||||
cpu @26 :List(Float32);
|
||||
gpu @27 :List(Float32);
|
||||
mem @28 :Float32;
|
||||
bat @29 :Float32;
|
||||
ambient @30 :Float32;
|
||||
|
||||
enum ThermalStatus {
|
||||
green @0; # all processes run
|
||||
yellow @1; # critical processes run (kill uploader), engage still allowed
|
||||
@@ -373,6 +386,8 @@ struct HealthData {
|
||||
interruptRateTim3 @17;
|
||||
registerDivergent @18;
|
||||
interruptRateKlineInit @19;
|
||||
interruptRateClockSource @20;
|
||||
interruptRateTim9 @21;
|
||||
# Update max fault type in boardd when adding faults
|
||||
}
|
||||
|
||||
@@ -441,18 +456,22 @@ struct RadarState @0x9a185389d6fdd05f {
|
||||
struct LiveCalibrationData {
|
||||
# deprecated
|
||||
warpMatrix @0 :List(Float32);
|
||||
|
||||
# camera_frame_from_model_frame
|
||||
warpMatrix2 @5 :List(Float32);
|
||||
warpMatrixBig @6 :List(Float32);
|
||||
|
||||
calStatus @1 :Int8;
|
||||
calCycle @2 :Int32;
|
||||
calPerc @3 :Int8;
|
||||
validBlocks @9 :Int32;
|
||||
|
||||
# view_frame_from_road_frame
|
||||
# ui's is inversed needs new
|
||||
extrinsicMatrix @4 :List(Float32);
|
||||
# the direction of travel vector in device frame
|
||||
rpyCalib @7 :List(Float32);
|
||||
rpyCalibSpread @8 :List(Float32);
|
||||
}
|
||||
|
||||
struct LiveTracks {
|
||||
@@ -554,7 +573,7 @@ struct ControlsState @0x97ff69c53601abf1 {
|
||||
|
||||
enum AlertStatus {
|
||||
normal @0; # low priority alert for user's convenience
|
||||
userPrompt @1; # mid piority alert that might require user intervention
|
||||
userPrompt @1; # mid priority alert that might require user intervention
|
||||
critical @2; # high priority alert that needs immediate user intervention
|
||||
}
|
||||
|
||||
@@ -598,7 +617,7 @@ struct ControlsState @0x97ff69c53601abf1 {
|
||||
output @3 :Float32;
|
||||
lqrOutput @4 :Float32;
|
||||
saturated @5 :Bool;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct LiveEventData {
|
||||
@@ -611,6 +630,9 @@ struct ModelData {
|
||||
frameAge @12 :UInt32;
|
||||
frameDropPerc @13 :Float32;
|
||||
timestampEof @9 :UInt64;
|
||||
modelExecutionTime @14 :Float32;
|
||||
gpuExecutionTime @16 :Float32;
|
||||
rawPred @15 :Data;
|
||||
|
||||
path @1 :PathData;
|
||||
leftLane @2 :PathData;
|
||||
@@ -671,6 +693,57 @@ struct ModelData {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct ModelDataV2 {
|
||||
frameId @0 :UInt32;
|
||||
frameAge @1 :UInt32;
|
||||
frameDropPerc @2 :Float32;
|
||||
timestampEof @3 :UInt64;
|
||||
modelExecutionTime @15 :Float32;
|
||||
gpuExecutionTime @17 :Float32;
|
||||
rawPred @16 :Data;
|
||||
|
||||
position @4 :XYZTData;
|
||||
orientation @5 :XYZTData;
|
||||
velocity @6 :XYZTData;
|
||||
orientationRate @7 :XYZTData;
|
||||
laneLines @8 :List(XYZTData);
|
||||
laneLineProbs @9 :List(Float32);
|
||||
laneLineStds @13 :List(Float32);
|
||||
roadEdges @10 :List(XYZTData);
|
||||
roadEdgeStds @14 :List(Float32);
|
||||
leads @11 :List(LeadDataV2);
|
||||
|
||||
meta @12 :MetaData;
|
||||
|
||||
struct XYZTData {
|
||||
x @0 :List(Float32);
|
||||
y @1 :List(Float32);
|
||||
z @2 :List(Float32);
|
||||
t @3 :List(Float32);
|
||||
xStd @4 :List(Float32);
|
||||
yStd @5 :List(Float32);
|
||||
zStd @6 :List(Float32);
|
||||
}
|
||||
|
||||
struct LeadDataV2 {
|
||||
prob @0 :Float32;
|
||||
t @1 :Float32;
|
||||
xyva @2 :List(Float32);
|
||||
xyvaStd @3 :List(Float32);
|
||||
}
|
||||
|
||||
struct MetaData {
|
||||
engagedProb @0 :Float32;
|
||||
desirePrediction @1 :List(Float32);
|
||||
brakeDisengageProb @2 :Float32;
|
||||
gasDisengageProb @3 :Float32;
|
||||
steerOverrideProb @4 :Float32;
|
||||
desireState @5 :List(Float32);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct CalibrationFeatures {
|
||||
frameId @0 :UInt32;
|
||||
|
||||
@@ -691,6 +764,8 @@ struct EncodeIndex {
|
||||
segmentId @4 :UInt32;
|
||||
# index into camera file in segment in encode order
|
||||
segmentIdEncode @5 :UInt32;
|
||||
timestampSof @6 :UInt64;
|
||||
timestampEof @7 :UInt64;
|
||||
|
||||
enum Type {
|
||||
bigBoxLossless @0; # rcamera.mkv
|
||||
@@ -867,6 +942,7 @@ struct LiveLocationKalman {
|
||||
posenetOK @18 :Bool = true;
|
||||
gpsOK @19 :Bool = true;
|
||||
sensorsOK @21 :Bool = true;
|
||||
deviceStable @22 :Bool = true;
|
||||
|
||||
enum Status {
|
||||
uninitialized @0;
|
||||
@@ -1882,6 +1958,10 @@ struct OrbKeyFrame {
|
||||
|
||||
struct DriverState {
|
||||
frameId @0 :UInt32;
|
||||
modelExecutionTime @14 :Float32;
|
||||
dspExecutionTime @16 :Float32;
|
||||
rawPred @15 :Data;
|
||||
|
||||
descriptorDEPRECATED @1 :List(Float32);
|
||||
stdDEPRECATED @2 :Float32;
|
||||
faceOrientation @3 :List(Float32);
|
||||
@@ -1904,7 +1984,6 @@ struct DMonitoringState {
|
||||
isDistracted @2 :Bool;
|
||||
awarenessStatus @3 :Float32;
|
||||
isRHD @4 :Bool;
|
||||
rhdChecked @5 :Bool;
|
||||
posePitchOffset @6 :Float32;
|
||||
posePitchValidCount @7 :UInt32;
|
||||
poseYawOffset @8 :Float32;
|
||||
@@ -1915,12 +1994,15 @@ struct DMonitoringState {
|
||||
isLowStd @13 :Bool;
|
||||
hiStdCount @14 :UInt32;
|
||||
isPreview @15 :Bool;
|
||||
|
||||
rhdCheckedDEPRECATED @5 :Bool;
|
||||
}
|
||||
|
||||
struct Boot {
|
||||
wallTimeNanos @0 :UInt64;
|
||||
lastKmsg @1 :Data;
|
||||
lastPmsg @2 :Data;
|
||||
launchLog @3 :Text;
|
||||
}
|
||||
|
||||
struct LiveParametersData {
|
||||
@@ -2056,86 +2138,92 @@ struct Event {
|
||||
thumbnail @66: Thumbnail;
|
||||
carEvents @68: List(Car.CarEvent);
|
||||
carParams @69: Car.CarParams;
|
||||
frontFrame @70: FrameData;
|
||||
frontFrame @70: FrameData; # driver facing camera
|
||||
dMonitoringState @71: DMonitoringState;
|
||||
liveLocationKalman @72 :LiveLocationKalman;
|
||||
sentinel @73 :Sentinel;
|
||||
dragonConf @74 :DragonConf;
|
||||
wideFrame @74: FrameData;
|
||||
modelV2 @75 :ModelDataV2;
|
||||
frontEncodeIdx @76 :EncodeIndex; # driver facing camera
|
||||
wideEncodeIdx @77 :EncodeIndex;
|
||||
dragonConf @78 :DragonConf;
|
||||
}
|
||||
}
|
||||
|
||||
# dp
|
||||
struct DragonConf {
|
||||
dpAtl @0 :Bool;
|
||||
dpAppWaze @1 :Bool;
|
||||
dpAppWazeManual @2 :Int8;
|
||||
dpDashcam @3 :Bool;
|
||||
dpDashcamHoursStored @4 :UInt8;
|
||||
dpAutoShutdown @5 :Bool;
|
||||
dpAutoShutdownIn @6 :UInt16;
|
||||
dpAthenad @7 :Bool;
|
||||
dpUploader @8 :Bool;
|
||||
dpUploadOnMobile @9 :Bool;
|
||||
dpUploadOnHotspot @10 :Bool;
|
||||
dpLatCtrl @11 :Bool;
|
||||
dpSteeringLimitAlert @12 :Bool;
|
||||
dpSteeringOnSignal @13 :Bool;
|
||||
dpSignalOffDelay @14 :UInt8;
|
||||
dpAssistedLcMinMph @15 :UInt8;
|
||||
dpAutoLc @16 :Bool;
|
||||
dpAutoLcCont @17 :Bool;
|
||||
dpAutoLcMinMph @18 :UInt8;
|
||||
dpAutoLcDelay @19 :UInt8;
|
||||
dpSlowOnCurve @20 :Bool;
|
||||
dpAllowGas @21 :Bool;
|
||||
dpMaxCtrlSpeed @22 :Float32;
|
||||
dpLeadCarAlert @23 :Bool;
|
||||
dpDynamicFollow @24 :UInt8;
|
||||
dpAccelProfile @25 :UInt8;
|
||||
dpDriverMonitor @26 :Bool;
|
||||
dpSteeringMonitor @27 :Bool;
|
||||
dpSteeringMonitorTimer @28 :UInt8;
|
||||
dpGearCheck @29 :Bool;
|
||||
dpTempMonitor @30 :Bool;
|
||||
dpDrivingUi @31 :Bool;
|
||||
dpUiScreenOffReversing @32 :Bool;
|
||||
dpUiScreenOffDriving @33 :Bool;
|
||||
dpUiSpeed @34 :Bool;
|
||||
dpUiEvent @35 :Bool;
|
||||
dpUiMaxSpeed @36 :Bool;
|
||||
dpUiFace @37 :Bool;
|
||||
dpUiLane @38 :Bool;
|
||||
dpUiPath @39 :Bool;
|
||||
dpUiLead @40 :Bool;
|
||||
dpUiDev @41 :Bool;
|
||||
dpUiBlinker @42 :Bool;
|
||||
dpUiBrightness @43 :UInt8;
|
||||
dpUiVolumeBoost @44 :Int8;
|
||||
dpAppAutoUpdate @45 :Bool;
|
||||
dpAppExtGps @46 :Bool;
|
||||
dpAppTomtom @47 :Bool;
|
||||
dpAppTomtomAuto @48 :Bool;
|
||||
dpAppTomtomManual @49 :Int8;
|
||||
dpAppAutonavi @50 :Bool;
|
||||
dpAppAutonaviAuto @51 :Bool;
|
||||
dpAppAutonaviManual @52 :Int8;
|
||||
dpAppAegis @53 :Bool;
|
||||
dpAppAegisAuto @54 :Bool;
|
||||
dpAppAegisManual @55 :Int8;
|
||||
dpAppMixplorer @56 :Bool;
|
||||
dpAppMixplorerManual @57 :Int8;
|
||||
dpToyotaLdw @58 :Bool;
|
||||
dpToyotaSng @59 :Bool;
|
||||
dpToyotaLowestCruiseOverride @60 :Bool;
|
||||
dpToyotaLowestCruiseOverrideAt @61 :Float32;
|
||||
dpToyotaLowestCruiseOverrideSpeed @62 :Float32;
|
||||
dpIpAddr @63 :Text;
|
||||
dpCameraOffset @64 :Int8;
|
||||
dpLocale @65 :Text;
|
||||
dpChargingCtrl @66 :Bool;
|
||||
dpChargingAt @67 :UInt8;
|
||||
dpDischargingAt @68 :UInt8;
|
||||
dpIsUpdating @69 :Bool;
|
||||
dpThermalStarted @70 :Bool;
|
||||
dpThermalOverheat @71 :Bool;
|
||||
dpThermalStarted @0 :Bool;
|
||||
dpThermalOverheat @1 :Bool;
|
||||
dpVw @2 :Bool;
|
||||
dpAtl @3 :Bool;
|
||||
dpAppWaze @4 :Bool;
|
||||
dpAppWazeManual @5 :Int8;
|
||||
dpAppHr @6 :Bool;
|
||||
dpAppHrManual @7 :Int8;
|
||||
dpDashcam @8 :Bool;
|
||||
dpDashcamUi @9 :Bool;
|
||||
dpAutoShutdown @10 :Bool;
|
||||
dpAthenad @11 :Bool;
|
||||
dpUploader @12 :Bool;
|
||||
dpLatCtrl @13 :Bool;
|
||||
dpSteeringLimitAlert @14 :Bool;
|
||||
dpSteeringOnSignal @15 :Bool;
|
||||
dpSignalOffDelay @16 :UInt8;
|
||||
dpAssistedLcMinMph @17 :Float32;
|
||||
dpAutoLc @18 :Bool;
|
||||
dpAutoLcCont @19 :Bool;
|
||||
dpAutoLcMinMph @20 :Float32;
|
||||
dpAutoLcDelay @21 :Float32;
|
||||
dpSlowOnCurve @22 :Bool;
|
||||
dpAllowGas @23 :Bool;
|
||||
dpMaxCtrlSpeed @24 :Float32;
|
||||
dpLeadCarAlert @25 :Bool;
|
||||
dpDynamicFollow @26 :UInt8;
|
||||
dpAccelProfile @27 :UInt8;
|
||||
dpDriverMonitor @28 :Bool;
|
||||
dpSteeringMonitor @29 :Bool;
|
||||
dpSteeringMonitorTimer @30 :UInt8;
|
||||
dpGearCheck @31 :Bool;
|
||||
dpDrivingUi @32 :Bool;
|
||||
dpUiScreenOffReversing @33 :Bool;
|
||||
dpUiScreenOffDriving @34 :Bool;
|
||||
dpUiSpeed @35 :Bool;
|
||||
dpUiEvent @36 :Bool;
|
||||
dpUiMaxSpeed @37 :Bool;
|
||||
dpUiFace @38 :Bool;
|
||||
dpUiLane @39 :Bool;
|
||||
dpUiPath @40 :Bool;
|
||||
dpUiLead @41 :Bool;
|
||||
dpUiDev @42 :Bool;
|
||||
dpUiDevMini @43 :Bool;
|
||||
dpUiBlinker @44 :Bool;
|
||||
dpUiBrightness @45 :UInt8;
|
||||
dpUiVolumeBoost @46 :Int8;
|
||||
dpAppAutoUpdate @47 :Bool;
|
||||
dpAppExtGps @48 :Bool;
|
||||
dpAppTomtom @49 :Bool;
|
||||
dpAppTomtomAuto @50 :Bool;
|
||||
dpAppTomtomManual @51 :Int8;
|
||||
dpAppAutonavi @52 :Bool;
|
||||
dpAppAutonaviAuto @53 :Bool;
|
||||
dpAppAutonaviManual @54 :Int8;
|
||||
dpAppAegis @55 :Bool;
|
||||
dpAppAegisAuto @56 :Bool;
|
||||
dpAppAegisManual @57 :Int8;
|
||||
dpAppMixplorer @58 :Bool;
|
||||
dpAppMixplorerManual @59 :Int8;
|
||||
dpCarDetected @60 :Text;
|
||||
dpToyotaLdw @61 :Bool;
|
||||
dpToyotaSng @62 :Bool;
|
||||
dpToyotaLowestCruiseOverride @63 :Bool;
|
||||
dpToyotaLowestCruiseOverrideVego @64 :Bool;
|
||||
dpToyotaLowestCruiseOverrideAt @65 :Float32;
|
||||
dpToyotaLowestCruiseOverrideSpeed @66 :Float32;
|
||||
dpIpAddr @67 :Text;
|
||||
dpCameraOffset @68 :Int8;
|
||||
dpLocale @69 :Text;
|
||||
dpChargingCtrl @70 :Bool;
|
||||
dpChargingAt @71 :UInt8;
|
||||
dpDischargingAt @72 :UInt8;
|
||||
dpIsUpdating @73 :Bool;
|
||||
dpTimebombAssist @74 :Bool;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ from .messaging_pyx import Context, Poller, SubSocket, PubSocket # pylint: disa
|
||||
from .messaging_pyx import MultiplePublishersError, MessagingError # pylint: disable=no-name-in-module, import-error
|
||||
import capnp
|
||||
|
||||
from typing import Optional, List, Union
|
||||
|
||||
from cereal import log
|
||||
from cereal.services import service_list
|
||||
|
||||
@@ -19,7 +21,7 @@ except ImportError:
|
||||
|
||||
context = Context()
|
||||
|
||||
def new_message(service=None, size=None):
|
||||
def new_message(service: Optional[str] = None, size: Optional[int] = None) -> capnp.lib.capnp._DynamicStructBuilder:
|
||||
dat = log.Event.new_message()
|
||||
dat.logMonoTime = int(sec_since_boot() * 1e9)
|
||||
dat.valid = True
|
||||
@@ -30,15 +32,15 @@ def new_message(service=None, size=None):
|
||||
dat.init(service, size)
|
||||
return dat
|
||||
|
||||
def pub_sock(endpoint):
|
||||
def pub_sock(endpoint: str) -> PubSocket:
|
||||
sock = PubSocket()
|
||||
sock.connect(context, endpoint)
|
||||
return sock
|
||||
|
||||
def sub_sock(endpoint, poller=None, addr="127.0.0.1", conflate=False, timeout=None):
|
||||
def sub_sock(endpoint: str, poller: Optional[Poller] = None, addr: str = "127.0.0.1",
|
||||
conflate: bool = False, timeout: Optional[int] = None) -> SubSocket:
|
||||
sock = SubSocket()
|
||||
addr = addr.encode('utf8')
|
||||
sock.connect(context, endpoint, addr, conflate)
|
||||
sock.connect(context, endpoint, addr.encode('utf8'), conflate)
|
||||
|
||||
if timeout is not None:
|
||||
sock.setTimeout(timeout)
|
||||
@@ -48,9 +50,9 @@ def sub_sock(endpoint, poller=None, addr="127.0.0.1", conflate=False, timeout=No
|
||||
return sock
|
||||
|
||||
|
||||
def drain_sock_raw(sock, wait_for_one=False):
|
||||
def drain_sock_raw(sock: SubSocket, wait_for_one: bool = False) -> List[bytes]:
|
||||
"""Receive all message currently available on the queue"""
|
||||
ret = []
|
||||
ret: List[bytes] = []
|
||||
while 1:
|
||||
if wait_for_one and len(ret) == 0:
|
||||
dat = sock.receive()
|
||||
@@ -64,9 +66,9 @@ def drain_sock_raw(sock, wait_for_one=False):
|
||||
|
||||
return ret
|
||||
|
||||
def drain_sock(sock, wait_for_one=False):
|
||||
def drain_sock(sock: SubSocket, wait_for_one: bool = False) -> List[capnp.lib.capnp._DynamicStructReader]:
|
||||
"""Receive all message currently available on the queue"""
|
||||
ret = []
|
||||
ret: List[capnp.lib.capnp._DynamicStructReader] = []
|
||||
while 1:
|
||||
if wait_for_one and len(ret) == 0:
|
||||
dat = sock.receive()
|
||||
@@ -83,7 +85,7 @@ def drain_sock(sock, wait_for_one=False):
|
||||
|
||||
|
||||
# TODO: print when we drop packets?
|
||||
def recv_sock(sock, wait=False):
|
||||
def recv_sock(sock: SubSocket, wait: bool = False) -> Union[None, capnp.lib.capnp._DynamicStructReader]:
|
||||
"""Same as drain sock, but only returns latest message. Consider using conflate instead."""
|
||||
dat = None
|
||||
|
||||
@@ -103,35 +105,28 @@ def recv_sock(sock, wait=False):
|
||||
|
||||
return dat
|
||||
|
||||
def recv_one(sock):
|
||||
def recv_one(sock: SubSocket) -> Union[None, capnp.lib.capnp._DynamicStructReader]:
|
||||
dat = sock.receive()
|
||||
if dat is not None:
|
||||
dat = log.Event.from_bytes(dat)
|
||||
return dat
|
||||
|
||||
def recv_one_or_none(sock):
|
||||
def recv_one_or_none(sock: SubSocket) -> Union[None, capnp.lib.capnp._DynamicStructReader]:
|
||||
dat = sock.receive(non_blocking=True)
|
||||
if dat is not None:
|
||||
dat = log.Event.from_bytes(dat)
|
||||
return dat
|
||||
|
||||
def recv_one_retry(sock):
|
||||
def recv_one_retry(sock: SubSocket) -> capnp.lib.capnp._DynamicStructReader:
|
||||
"""Keep receiving until we get a message"""
|
||||
while True:
|
||||
dat = sock.receive()
|
||||
if dat is not None:
|
||||
return log.Event.from_bytes(dat)
|
||||
|
||||
# TODO: This does not belong in messaging
|
||||
def get_one_can(logcan):
|
||||
while True:
|
||||
can = recv_one_retry(logcan)
|
||||
if len(can.can) > 0:
|
||||
return can
|
||||
|
||||
class SubMaster():
|
||||
def __init__(self, services, ignore_alive=None, addr="127.0.0.1"):
|
||||
self.poller = Poller()
|
||||
def __init__(self, services: List[str], poll: Optional[List[str]] = None,
|
||||
ignore_alive: Optional[List[str]] = None, addr:str ="127.0.0.1"):
|
||||
self.frame = -1
|
||||
self.updated = {s: False for s in services}
|
||||
self.rcv_time = {s: 0. for s in services}
|
||||
@@ -140,8 +135,12 @@ class SubMaster():
|
||||
self.sock = {}
|
||||
self.freq = {}
|
||||
self.data = {}
|
||||
self.logMonoTime = {}
|
||||
self.valid = {}
|
||||
self.logMonoTime = {}
|
||||
|
||||
self.poller = Poller()
|
||||
self.non_polled_services = [s for s in services if poll is not None and
|
||||
len(poll) and s not in poll]
|
||||
|
||||
if ignore_alive is not None:
|
||||
self.ignore_alive = ignore_alive
|
||||
@@ -150,30 +149,33 @@ class SubMaster():
|
||||
|
||||
for s in services:
|
||||
if addr is not None:
|
||||
self.sock[s] = sub_sock(s, poller=self.poller, addr=addr, conflate=True)
|
||||
p = self.poller if s not in self.non_polled_services else None
|
||||
self.sock[s] = sub_sock(s, poller=p, addr=addr, conflate=True)
|
||||
self.freq[s] = service_list[s].frequency
|
||||
|
||||
try:
|
||||
data = new_message(s)
|
||||
except capnp.lib.capnp.KjException: # pylint: disable=c-extension-no-member
|
||||
# lists
|
||||
data = new_message(s, 0)
|
||||
data = new_message(s, 0) # lists
|
||||
|
||||
self.data[s] = getattr(data, s)
|
||||
self.logMonoTime[s] = 0
|
||||
self.valid[s] = data.valid
|
||||
|
||||
def __getitem__(self, s):
|
||||
def __getitem__(self, s: str) -> capnp.lib.capnp._DynamicStructReader:
|
||||
return self.data[s]
|
||||
|
||||
def update(self, timeout=1000):
|
||||
def update(self, timeout: int = 1000) -> None:
|
||||
msgs = []
|
||||
for sock in self.poller.poll(timeout):
|
||||
msgs.append(recv_one_or_none(sock))
|
||||
|
||||
# non-blocking receive for non-polled sockets
|
||||
for s in self.non_polled_services:
|
||||
msgs.append(recv_one_or_none(self.sock[s]))
|
||||
self.update_msgs(sec_since_boot(), msgs)
|
||||
|
||||
def update_msgs(self, cur_time, msgs):
|
||||
# TODO: add optional input that specify the service to wait for
|
||||
def update_msgs(self, cur_time: float, msgs: List[capnp.lib.capnp._DynamicStructReader]) -> None:
|
||||
self.frame += 1
|
||||
self.updated = dict.fromkeys(self.updated, False)
|
||||
for msg in msgs:
|
||||
@@ -196,30 +198,28 @@ class SubMaster():
|
||||
else:
|
||||
self.alive[s] = True
|
||||
|
||||
def all_alive(self, service_list=None):
|
||||
def all_alive(self, service_list=None) -> bool:
|
||||
if service_list is None: # check all
|
||||
service_list = self.alive.keys()
|
||||
return all(self.alive[s] for s in service_list if s not in self.ignore_alive)
|
||||
|
||||
def all_valid(self, service_list=None):
|
||||
def all_valid(self, service_list=None) -> bool:
|
||||
if service_list is None: # check all
|
||||
service_list = self.valid.keys()
|
||||
return all(self.valid[s] for s in service_list)
|
||||
|
||||
def all_alive_and_valid(self, service_list=None):
|
||||
def all_alive_and_valid(self, service_list=None) -> bool:
|
||||
if service_list is None: # check all
|
||||
service_list = self.alive.keys()
|
||||
return self.all_alive(service_list=service_list) and self.all_valid(service_list=service_list)
|
||||
|
||||
|
||||
class PubMaster():
|
||||
def __init__(self, services):
|
||||
def __init__(self, services: List[str]):
|
||||
self.sock = {}
|
||||
for s in services:
|
||||
self.sock[s] = pub_sock(s)
|
||||
|
||||
def send(self, s, dat):
|
||||
# accept either bytes or capnp builder
|
||||
def send(self, s: str, dat: Union[bytes, capnp.lib.capnp._DynamicStructBuilder]) -> None:
|
||||
if not isinstance(dat, bytes):
|
||||
dat = dat.to_bytes()
|
||||
self.sock[s].send(dat)
|
||||
|
||||
@@ -15,6 +15,18 @@ void sig_handler(int signal) {
|
||||
msgq_do_exit = 1;
|
||||
}
|
||||
|
||||
static size_t get_size(std::string endpoint){
|
||||
size_t sz = DEFAULT_SEGMENT_SIZE;
|
||||
|
||||
#if !defined(QCOM) && !defined(QCOM2)
|
||||
if (endpoint == "frame" || endpoint == "frontFrame" || endpoint == "wideFrame"){
|
||||
sz *= 10;
|
||||
}
|
||||
#endif
|
||||
|
||||
return sz;
|
||||
}
|
||||
|
||||
|
||||
MSGQContext::MSGQContext() {
|
||||
}
|
||||
@@ -49,13 +61,12 @@ 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);
|
||||
int r = msgq_new_queue(q, endpoint.c_str(), get_size(endpoint));
|
||||
if (r != 0){
|
||||
return r;
|
||||
}
|
||||
@@ -143,7 +154,7 @@ int MSGQPubSocket::connect(Context *context, std::string endpoint){
|
||||
assert(context);
|
||||
|
||||
q = new msgq_queue_t;
|
||||
int r = msgq_new_queue(q, endpoint.c_str(), DEFAULT_SEGMENT_SIZE);
|
||||
int r = msgq_new_queue(q, endpoint.c_str(), get_size(endpoint));
|
||||
if (r != 0){
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
#include <capnp/serialize.h>
|
||||
#include "../gen/cpp/log.capnp.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define CLOCK_BOOTTIME CLOCK_MONOTONIC
|
||||
#endif
|
||||
|
||||
#define MSG_MULTIPLE_PUBLISHERS 100
|
||||
|
||||
class Context {
|
||||
@@ -59,34 +63,59 @@ public:
|
||||
};
|
||||
|
||||
class SubMaster {
|
||||
public:
|
||||
public:
|
||||
SubMaster(const std::initializer_list<const char *> &service_list,
|
||||
const char *address = nullptr, const std::initializer_list<const char *> &ignore_alive = {});
|
||||
int update(int timeout = 1000);
|
||||
inline bool allAlive(const std::initializer_list<const char *> &service_list = {}) { return all_(service_list, false, true); }
|
||||
inline bool allValid(const std::initializer_list<const char *> &service_list = {}) { return all_(service_list, true, false); }
|
||||
inline bool allAliveAndValid(const std::initializer_list<const char *> &service_list = {}) { return all_(service_list, true, true); }
|
||||
bool updated(const char *name) const;
|
||||
void drain();
|
||||
cereal::Event::Reader &operator[](const char *name);
|
||||
~SubMaster();
|
||||
|
||||
private:
|
||||
uint64_t frame = 0;
|
||||
bool updated(const char *name) const;
|
||||
uint64_t rcv_frame(const char *name) const;
|
||||
cereal::Event::Reader &operator[](const char *name);
|
||||
|
||||
private:
|
||||
bool all_(const std::initializer_list<const char *> &service_list, bool valid, bool alive);
|
||||
Poller *poller_ = nullptr;
|
||||
uint64_t frame_ = 0;
|
||||
struct SubMessage;
|
||||
std::map<SubSocket *, SubMessage *> messages_;
|
||||
std::map<std::string, SubMessage *> services_;
|
||||
};
|
||||
|
||||
class MessageBuilder : public capnp::MallocMessageBuilder {
|
||||
public:
|
||||
MessageBuilder() = default;
|
||||
|
||||
cereal::Event::Builder initEvent(bool valid = true) {
|
||||
cereal::Event::Builder event = initRoot<cereal::Event>();
|
||||
struct timespec t;
|
||||
clock_gettime(CLOCK_BOOTTIME, &t);
|
||||
uint64_t current_time = t.tv_sec * 1000000000ULL + t.tv_nsec;
|
||||
event.setLogMonoTime(current_time);
|
||||
event.setValid(valid);
|
||||
return event;
|
||||
}
|
||||
|
||||
kj::ArrayPtr<capnp::byte> toBytes() {
|
||||
heapArray_ = capnp::messageToFlatArray(*this);
|
||||
return heapArray_.asBytes();
|
||||
}
|
||||
|
||||
private:
|
||||
kj::Array<capnp::word> heapArray_;
|
||||
};
|
||||
|
||||
class PubMaster {
|
||||
public:
|
||||
public:
|
||||
PubMaster(const std::initializer_list<const char *> &service_list);
|
||||
inline int send(const char *name, capnp::byte *data, size_t size) { return sockets_.at(name)->send((char *)data, size); }
|
||||
int send(const char *name, capnp::MessageBuilder &msg);
|
||||
int send(const char *name, MessageBuilder &msg);
|
||||
~PubMaster();
|
||||
|
||||
private:
|
||||
private:
|
||||
std::map<std::string, PubSocket *> sockets_;
|
||||
};
|
||||
|
||||
@@ -7,11 +7,11 @@ 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
|
||||
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):
|
||||
@@ -59,12 +59,12 @@ cdef class Poller:
|
||||
cdef int t = timeout
|
||||
|
||||
with nogil:
|
||||
result = self.poller.poll(t)
|
||||
result = self.poller.poll(t)
|
||||
|
||||
for s in result:
|
||||
socket = SubSocket()
|
||||
socket.setPtr(s)
|
||||
sockets.append(socket)
|
||||
socket = SubSocket()
|
||||
socket.setPtr(s)
|
||||
sockets.append(socket)
|
||||
|
||||
return sockets
|
||||
|
||||
@@ -140,9 +140,9 @@ cdef class PubSocket:
|
||||
else:
|
||||
raise MessagingError
|
||||
|
||||
def send(self, string data):
|
||||
def send(self, bytes data):
|
||||
length = len(data)
|
||||
r = self.socket.send(<char*>data.c_str(), length)
|
||||
r = self.socket.send(<char*>data, length)
|
||||
|
||||
if r != length:
|
||||
if errno.errno == errno.EADDRINUSE:
|
||||
|
||||
@@ -1,57 +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++14"]
|
||||
libraries = ['zmq']
|
||||
ARCH = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip() # pylint: disable=unexpected-keyword-arg
|
||||
|
||||
if ARCH == "aarch64" and os.path.isdir("/system"):
|
||||
# android
|
||||
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,
|
||||
)
|
||||
@@ -21,6 +21,8 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "services.h"
|
||||
|
||||
#include "msgq.hpp"
|
||||
|
||||
void sigusr2_handler(int signal) {
|
||||
@@ -81,11 +83,20 @@ void msgq_wait_for_subscriber(msgq_queue_t *q){
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
bool service_exists(std::string path){
|
||||
for (const auto& it : services) {
|
||||
if (it.name == path) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if (!service_exists(std::string(path))){
|
||||
std::cout << "Warning, " << std::string(path) << " is not in service list." << std::endl;
|
||||
}
|
||||
std::signal(SIGUSR2, sigusr2_handler);
|
||||
|
||||
const char * prefix = "/dev/shm/";
|
||||
@@ -102,15 +113,16 @@ int msgq_new_queue(msgq_queue_t * q, const char * path, size_t size){
|
||||
delete[] full_path;
|
||||
|
||||
int rc = ftruncate(fd, size + sizeof(msgq_header_t));
|
||||
if (rc < 0)
|
||||
if (rc < 0){
|
||||
close(fd);
|
||||
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)
|
||||
if (mem == NULL){
|
||||
return -1;
|
||||
|
||||
}
|
||||
q->mmap_p = mem;
|
||||
|
||||
msgq_header_t *header = (msgq_header_t *)mem;
|
||||
@@ -418,8 +430,6 @@ int msgq_msg_recv(msgq_msg_t * msg, msgq_queue_t * q){
|
||||
|
||||
|
||||
int msgq_poll(msgq_pollitem_t * items, size_t nitems, int timeout){
|
||||
assert(timeout >= 0);
|
||||
|
||||
int num = 0;
|
||||
|
||||
// Check if messages ready
|
||||
|
||||
@@ -2,20 +2,20 @@
|
||||
#include <time.h>
|
||||
#include "messaging.hpp"
|
||||
#include "services.h"
|
||||
#ifdef __APPLE__
|
||||
#define CLOCK_BOOTTIME CLOCK_MONOTONIC
|
||||
#endif
|
||||
|
||||
static inline uint64_t nanos_since_boot() {
|
||||
struct timespec t;
|
||||
clock_gettime(CLOCK_BOOTTIME, &t);
|
||||
return t.tv_sec * 1000000000ULL + t.tv_nsec;
|
||||
}
|
||||
|
||||
static const service *get_service(const char *name) {
|
||||
for (const auto &it : services) {
|
||||
if (strcmp(it.name, name) == 0) return ⁢
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static inline bool inList(const std::initializer_list<const char *> &list, const char *value) {
|
||||
for (auto &v : list) {
|
||||
if (strcmp(value, v) == 0) return true;
|
||||
@@ -24,7 +24,7 @@ static inline bool inList(const std::initializer_list<const char *> &list, const
|
||||
}
|
||||
|
||||
class MessageContext {
|
||||
public:
|
||||
public:
|
||||
MessageContext() { ctx_ = Context::create(); }
|
||||
~MessageContext() { delete ctx_; }
|
||||
Context *ctx_;
|
||||
@@ -53,18 +53,18 @@ SubMaster::SubMaster(const std::initializer_list<const char *> &service_list, co
|
||||
assert(socket != 0);
|
||||
poller_->registerSocket(socket);
|
||||
SubMessage *m = new SubMessage{
|
||||
.socket = socket,
|
||||
.freq = serv->frequency,
|
||||
.ignore_alive = inList(ignore_alive, name),
|
||||
.allocated_msg_reader = malloc(sizeof(capnp::FlatArrayMessageReader)),
|
||||
.buf = kj::heapArray<capnp::word>(1024)};
|
||||
.socket = socket,
|
||||
.freq = serv->frequency,
|
||||
.ignore_alive = inList(ignore_alive, name),
|
||||
.allocated_msg_reader = malloc(sizeof(capnp::FlatArrayMessageReader)),
|
||||
.buf = kj::heapArray<capnp::word>(1024)};
|
||||
messages_[socket] = m;
|
||||
services_[name] = m;
|
||||
}
|
||||
}
|
||||
|
||||
int SubMaster::update(int timeout) {
|
||||
if (++frame_ == UINT64_MAX) frame_ = 1;
|
||||
if (++frame == UINT64_MAX) frame = 1;
|
||||
for (auto &kv : messages_) kv.second->updated = false;
|
||||
|
||||
int updated = 0;
|
||||
@@ -89,7 +89,7 @@ int SubMaster::update(int timeout) {
|
||||
m->event = m->msg_reader->getRoot<cereal::Event>();
|
||||
m->updated = true;
|
||||
m->rcv_time = current_time;
|
||||
m->rcv_frame = frame_;
|
||||
m->rcv_frame = frame;
|
||||
m->valid = m->event.getValid();
|
||||
|
||||
++updated;
|
||||
@@ -126,8 +126,17 @@ void SubMaster::drain() {
|
||||
}
|
||||
}
|
||||
|
||||
bool SubMaster::updated(const char *name) const { return services_.at(name)->updated; }
|
||||
cereal::Event::Reader &SubMaster::operator[](const char *name) { return services_.at(name)->event; };
|
||||
bool SubMaster::updated(const char *name) const {
|
||||
return services_.at(name)->updated;
|
||||
}
|
||||
|
||||
uint64_t SubMaster::rcv_frame(const char *name) const {
|
||||
return services_.at(name)->rcv_frame;
|
||||
}
|
||||
|
||||
cereal::Event::Reader &SubMaster::operator[](const char *name) {
|
||||
return services_.at(name)->event;
|
||||
};
|
||||
|
||||
SubMaster::~SubMaster() {
|
||||
delete poller_;
|
||||
@@ -151,9 +160,8 @@ PubMaster::PubMaster(const std::initializer_list<const char *> &service_list) {
|
||||
}
|
||||
}
|
||||
|
||||
int PubMaster::send(const char *name, capnp::MessageBuilder &msg) {
|
||||
auto words = capnp::messageToFlatArray(msg);
|
||||
auto bytes = words.asBytes();
|
||||
int PubMaster::send(const char *name, MessageBuilder &msg) {
|
||||
auto bytes = msg.toBytes();
|
||||
return send(name, bytes.begin(), bytes.size());
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ orbOdometry: [8057, true, 0.]
|
||||
orbFeatures: [8058, false, 0.]
|
||||
orbKeyFrame: [8059, true, 0.]
|
||||
uiLayoutState: [8060, true, 0.]
|
||||
frontEncodeIdx: [8061, true, 5.]
|
||||
frontEncodeIdx: [8061, true, 5.] # should be 20fps on tici
|
||||
orbFeaturesSummary: [8062, true, 0.]
|
||||
driverState: [8063, true, 5., 1]
|
||||
liveParameters: [8064, true, 20., 2]
|
||||
@@ -77,8 +77,11 @@ carParams: [8071, true, 0.02, 1]
|
||||
frontFrame: [8072, true, 10.]
|
||||
dMonitoringState: [8073, true, 5., 1]
|
||||
offroadLayout: [8074, false, 0.]
|
||||
wideEncodeIdx: [8075, true, 20.]
|
||||
wideFrame: [8076, true, 20.]
|
||||
modelV2: [8077, true, 20., 20]
|
||||
|
||||
dragonConf: [8075, false, 2.]
|
||||
dragonConf: [8088, false, 2.]
|
||||
|
||||
testModel: [8040, false, 0.]
|
||||
testLiveLocation: [8045, false, 0.]
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
Import('env')
|
||||
Import('envCython')
|
||||
|
||||
# parser
|
||||
env.Command(['common_pyx.so'],
|
||||
['common_pyx_setup.py', 'clock.pyx'],
|
||||
"cd common && python3 common_pyx_setup.py build_ext --inplace")
|
||||
envCython.Program('clock.so', 'clock.pyx')
|
||||
envCython.Program('params_pyx.so', 'params_pyx.pyx')
|
||||
|
||||
@@ -1,286 +0,0 @@
|
||||
import os
|
||||
import binascii
|
||||
import itertools
|
||||
import re
|
||||
import struct
|
||||
import subprocess
|
||||
import random
|
||||
from cereal import log
|
||||
|
||||
NetworkType = log.ThermalData.NetworkType
|
||||
NetworkStrength = log.ThermalData.NetworkStrength
|
||||
|
||||
ANDROID = os.path.isfile('/EON')
|
||||
|
||||
def get_sound_card_online():
|
||||
return (os.path.isfile('/proc/asound/card0/state') and
|
||||
open('/proc/asound/card0/state').read().strip() == 'ONLINE')
|
||||
|
||||
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)
|
||||
|
||||
def get_network_strength(network_type):
|
||||
network_strength = NetworkStrength.unknown
|
||||
|
||||
# from SignalStrength.java
|
||||
def get_lte_level(rsrp, rssnr):
|
||||
INT_MAX = 2147483647
|
||||
if rsrp == INT_MAX:
|
||||
lvl_rsrp = NetworkStrength.unknown
|
||||
elif rsrp >= -95:
|
||||
lvl_rsrp = NetworkStrength.great
|
||||
elif rsrp >= -105:
|
||||
lvl_rsrp = NetworkStrength.good
|
||||
elif rsrp >= -115:
|
||||
lvl_rsrp = NetworkStrength.moderate
|
||||
else:
|
||||
lvl_rsrp = NetworkStrength.poor
|
||||
if rssnr == INT_MAX:
|
||||
lvl_rssnr = NetworkStrength.unknown
|
||||
elif rssnr >= 45:
|
||||
lvl_rssnr = NetworkStrength.great
|
||||
elif rssnr >= 10:
|
||||
lvl_rssnr = NetworkStrength.good
|
||||
elif rssnr >= -30:
|
||||
lvl_rssnr = NetworkStrength.moderate
|
||||
else:
|
||||
lvl_rssnr = NetworkStrength.poor
|
||||
return max(lvl_rsrp, lvl_rssnr)
|
||||
|
||||
def get_tdscdma_level(tdscmadbm):
|
||||
lvl = NetworkStrength.unknown
|
||||
if tdscmadbm > -25:
|
||||
lvl = NetworkStrength.unknown
|
||||
elif tdscmadbm >= -49:
|
||||
lvl = NetworkStrength.great
|
||||
elif tdscmadbm >= -73:
|
||||
lvl = NetworkStrength.good
|
||||
elif tdscmadbm >= -97:
|
||||
lvl = NetworkStrength.moderate
|
||||
elif tdscmadbm >= -110:
|
||||
lvl = NetworkStrength.poor
|
||||
return lvl
|
||||
|
||||
def get_gsm_level(asu):
|
||||
if asu <= 2 or asu == 99:
|
||||
lvl = NetworkStrength.unknown
|
||||
elif asu >= 12:
|
||||
lvl = NetworkStrength.great
|
||||
elif asu >= 8:
|
||||
lvl = NetworkStrength.good
|
||||
elif asu >= 5:
|
||||
lvl = NetworkStrength.moderate
|
||||
else:
|
||||
lvl = NetworkStrength.poor
|
||||
return lvl
|
||||
|
||||
def get_evdo_level(evdodbm, evdosnr):
|
||||
lvl_evdodbm = NetworkStrength.unknown
|
||||
lvl_evdosnr = NetworkStrength.unknown
|
||||
if evdodbm >= -65:
|
||||
lvl_evdodbm = NetworkStrength.great
|
||||
elif evdodbm >= -75:
|
||||
lvl_evdodbm = NetworkStrength.good
|
||||
elif evdodbm >= -90:
|
||||
lvl_evdodbm = NetworkStrength.moderate
|
||||
elif evdodbm >= -105:
|
||||
lvl_evdodbm = NetworkStrength.poor
|
||||
if evdosnr >= 7:
|
||||
lvl_evdosnr = NetworkStrength.great
|
||||
elif evdosnr >= 5:
|
||||
lvl_evdosnr = NetworkStrength.good
|
||||
elif evdosnr >= 3:
|
||||
lvl_evdosnr = NetworkStrength.moderate
|
||||
elif evdosnr >= 1:
|
||||
lvl_evdosnr = NetworkStrength.poor
|
||||
return max(lvl_evdodbm, lvl_evdosnr)
|
||||
|
||||
def get_cdma_level(cdmadbm, cdmaecio):
|
||||
lvl_cdmadbm = NetworkStrength.unknown
|
||||
lvl_cdmaecio = NetworkStrength.unknown
|
||||
if cdmadbm >= -75:
|
||||
lvl_cdmadbm = NetworkStrength.great
|
||||
elif cdmadbm >= -85:
|
||||
lvl_cdmadbm = NetworkStrength.good
|
||||
elif cdmadbm >= -95:
|
||||
lvl_cdmadbm = NetworkStrength.moderate
|
||||
elif cdmadbm >= -100:
|
||||
lvl_cdmadbm = NetworkStrength.poor
|
||||
if cdmaecio >= -90:
|
||||
lvl_cdmaecio = NetworkStrength.great
|
||||
elif cdmaecio >= -110:
|
||||
lvl_cdmaecio = NetworkStrength.good
|
||||
elif cdmaecio >= -130:
|
||||
lvl_cdmaecio = NetworkStrength.moderate
|
||||
elif cdmaecio >= -150:
|
||||
lvl_cdmaecio = NetworkStrength.poor
|
||||
return max(lvl_cdmadbm, lvl_cdmaecio)
|
||||
|
||||
if network_type == NetworkType.none:
|
||||
return network_strength
|
||||
if network_type == NetworkType.wifi:
|
||||
out = subprocess.check_output('dumpsys connectivity', shell=True).decode('utf-8')
|
||||
network_strength = NetworkStrength.unknown
|
||||
for line in out.split('\n'):
|
||||
signal_str = "SignalStrength: "
|
||||
if signal_str in line:
|
||||
lvl_idx_start = line.find(signal_str) + len(signal_str)
|
||||
lvl_idx_end = line.find(']', lvl_idx_start)
|
||||
lvl = int(line[lvl_idx_start : lvl_idx_end])
|
||||
if lvl >= -50:
|
||||
network_strength = NetworkStrength.great
|
||||
elif lvl >= -60:
|
||||
network_strength = NetworkStrength.good
|
||||
elif lvl >= -70:
|
||||
network_strength = NetworkStrength.moderate
|
||||
else:
|
||||
network_strength = NetworkStrength.poor
|
||||
return network_strength
|
||||
else:
|
||||
# check cell strength
|
||||
out = subprocess.check_output('dumpsys telephony.registry', shell=True).decode('utf-8')
|
||||
for line in out.split('\n'):
|
||||
if "mSignalStrength" in line:
|
||||
arr = line.split(' ')
|
||||
ns = 0
|
||||
if ("gsm" in arr[14]):
|
||||
rsrp = int(arr[9])
|
||||
rssnr = int(arr[11])
|
||||
ns = get_lte_level(rsrp, rssnr)
|
||||
if ns == NetworkStrength.unknown:
|
||||
tdscmadbm = int(arr[13])
|
||||
ns = get_tdscdma_level(tdscmadbm)
|
||||
if ns == NetworkStrength.unknown:
|
||||
asu = int(arr[1])
|
||||
ns = get_gsm_level(asu)
|
||||
else:
|
||||
cdmadbm = int(arr[3])
|
||||
cdmaecio = int(arr[4])
|
||||
evdodbm = int(arr[5])
|
||||
evdosnr = int(arr[7])
|
||||
lvl_cdma = get_cdma_level(cdmadbm, cdmaecio)
|
||||
lvl_edmo = get_evdo_level(evdodbm, evdosnr)
|
||||
if lvl_edmo == NetworkStrength.unknown:
|
||||
ns = lvl_cdma
|
||||
elif lvl_cdma == NetworkStrength.unknown:
|
||||
ns = lvl_edmo
|
||||
else:
|
||||
ns = min(lvl_cdma, lvl_edmo)
|
||||
network_strength = max(network_strength, ns)
|
||||
|
||||
return network_strength
|
||||
@@ -1,10 +1,8 @@
|
||||
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:
|
||||
from selfdrive.hardware import PC
|
||||
if PC:
|
||||
PERSIST = os.path.join(BASEDIR, "persist")
|
||||
PARAMS = os.path.join(BASEDIR, "persist", "params")
|
||||
else:
|
||||
PERSIST = "/persist"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# distutils: language = c++
|
||||
# cython: language_level = 3
|
||||
from posix.time cimport clock_gettime, timespec, CLOCK_MONOTONIC_RAW, clockid_t
|
||||
|
||||
IF UNAME_SYSNAME == "Darwin":
|
||||
|
||||
@@ -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,7 +2,11 @@
|
||||
import subprocess
|
||||
from cereal import car
|
||||
from common.params import Params
|
||||
from common.realtime import sec_since_boot
|
||||
import os
|
||||
params = Params()
|
||||
PARAM_PATH = "/data/params/d/"
|
||||
LAST_MODIFIED = PARAM_PATH + "dp_last_modified"
|
||||
|
||||
def is_online():
|
||||
try:
|
||||
@@ -10,9 +14,9 @@ def is_online():
|
||||
except ProcessLookupError:
|
||||
return False
|
||||
|
||||
def common_controller_ctrl(enabled, dragon_lat_ctrl, dragon_enable_steering_on_signal, blinker_on, steer_req):
|
||||
def common_controller_ctrl(enabled, dragonconf, blinker_on, steer_req, v_ego):
|
||||
if enabled:
|
||||
if (dragon_enable_steering_on_signal and blinker_on) or not dragon_lat_ctrl:
|
||||
if (dragonconf.dpSteeringOnSignal and blinker_on) or not dragonconf.dpLatCtrl:
|
||||
steer_req = 0 if isinstance(steer_req, int) else False
|
||||
return steer_req
|
||||
|
||||
@@ -39,4 +43,38 @@ def common_interface_get_params_lqr(ret):
|
||||
ret.lateralTuning.lqr.k = [-110.73572306, 451.22718255]
|
||||
ret.lateralTuning.lqr.l = [0.3233671, 0.3185757]
|
||||
ret.lateralTuning.lqr.dcGain = 0.002237852961363602
|
||||
return ret
|
||||
return ret
|
||||
|
||||
|
||||
def get_last_modified(delay, old_check, old_modified):
|
||||
new_check = sec_since_boot()
|
||||
if old_check is None or new_check - old_check >= delay:
|
||||
return new_check, os.stat(LAST_MODIFIED).st_mtime
|
||||
else:
|
||||
return old_check, old_modified
|
||||
|
||||
def param_get_if_updated(param, type, old_val, old_modified):
|
||||
try:
|
||||
modified = os.stat(PARAM_PATH + param).st_mtime
|
||||
except OSError:
|
||||
return old_val, old_modified
|
||||
if old_modified != modified:
|
||||
new_val = param_get(param, type, old_val)
|
||||
new_modified = modified
|
||||
else:
|
||||
new_val = old_val
|
||||
new_modified = old_modified
|
||||
return new_val, new_modified
|
||||
|
||||
def param_get(param_name, type, default):
|
||||
try:
|
||||
val = params.get(param_name, encoding='utf8').rstrip('\x00')
|
||||
if type == 'bool':
|
||||
val = val == '1'
|
||||
elif type == 'int':
|
||||
val = int(val)
|
||||
elif type == 'float':
|
||||
val = float(val)
|
||||
except (TypeError, ValueError):
|
||||
val = default
|
||||
return val
|
||||
|
||||
@@ -4,24 +4,40 @@ import json
|
||||
import time
|
||||
from math import floor
|
||||
|
||||
'''
|
||||
* type: Bool, Int8, UInt8, UInt16, Float32
|
||||
* conf_type: param, struct
|
||||
* dependencies needs to use struct and loaded prior so we don't have to read the param multiple times.
|
||||
* update_once: True, False (the param will only load up once.)
|
||||
'''
|
||||
confs = [
|
||||
# thermald data
|
||||
{'name': 'dp_thermal_started', 'default': False, 'type': 'Bool', 'conf_type': ['struct']},
|
||||
{'name': 'dp_thermal_overheat', 'default': False, 'type': 'Bool', 'conf_type': ['struct']},
|
||||
|
||||
# car specific
|
||||
{'name': 'dp_vw', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct'], 'update_once': True},
|
||||
|
||||
{'name': 'dp_atl', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct'], 'update_once': True},
|
||||
# waze
|
||||
# full screen apps
|
||||
{'name': 'dp_app_waze', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_app_waze_manual', 'default': 0, 'type': 'Int8', 'min': -1, 'max': 1, 'depends': [{'name': 'dp_app_waze', 'vals': [True]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_app_hr', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_app_hr_manual', 'default': 0, 'type': 'Int8', 'min': -1, 'max': 1, 'depends': [{'name': 'dp_app_hr', 'vals': [True]}], 'conf_type': ['param', 'struct']},
|
||||
# dashcam related
|
||||
{'name': 'dp_dashcam', 'default': 0, 'type': 'Bool', 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_dashcam_hours_stored', 'default': 24, 'type': 'UInt8', 'min': 1, 'max': 255, 'depends': [{'name': 'dp_dashcam', 'vals': [True]}], 'conf_type': ['param', 'struct']},
|
||||
# auto shutdown related
|
||||
{'name': 'dp_dashcam_ui', 'default': 0, 'type': 'Bool', 'conf_type': ['param', 'struct']},
|
||||
# auto shutdown
|
||||
{'name': 'dp_auto_shutdown', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_auto_shutdown_in', 'default': 90, 'type': 'UInt16', 'min': 1, 'max': 65535, 'depends': [{'name': 'dp_auto_shutdown', 'vals': [True]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_auto_shutdown_in', 'default': 90, 'type': 'UInt16', 'min': 1, 'max': 65535, 'depends': [{'name': 'dp_auto_shutdown', 'vals': [True]}], 'conf_type': ['param']},
|
||||
# service
|
||||
{'name': 'dp_logger', 'default': True, 'type': 'Bool', 'conf_type': ['param']},
|
||||
{'name': 'dp_athenad', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_uploader', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_upload_on_mobile', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_uploader', 'vals': [True]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_upload_on_hotspot', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_uploader', 'vals': [True]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_upload_on_mobile', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_uploader', 'vals': [True]}], 'conf_type': ['param']},
|
||||
{'name': 'dp_upload_on_hotspot', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_uploader', 'vals': [True]}], 'conf_type': ['param']},
|
||||
{'name': 'dp_updated', 'default': True, 'type': 'Bool', 'conf_type': ['param']},
|
||||
{'name': 'dp_gpxd', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
|
||||
{'name': 'dp_hotspot_on_boot', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
|
||||
# lat ctrl
|
||||
{'name': 'dp_lat_ctrl', 'default': True, 'type': 'Bool', 'conf_type': ['param', 'struct']},
|
||||
@@ -29,37 +45,42 @@ confs = [
|
||||
{'name': 'dp_steering_on_signal', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_lat_ctrl', 'vals': [True]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_signal_off_delay', 'default': 0, 'type': 'UInt8', 'min': 0, 'max': 10, 'conf_type': ['param', 'struct']},
|
||||
# assist/auto lane change
|
||||
{'name': 'dp_assisted_lc_min_mph', 'default': 45, 'type': 'UInt8', 'min': 0, 'max': 255, 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_assisted_lc_min_mph', 'default': 45, 'type': 'Float32', 'min': 0, 'max': 255., 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_auto_lc', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_auto_lc_cont', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_auto_lc', 'vals': [True]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_auto_lc_min_mph', 'default': 60, 'type': 'UInt8', 'min': 0, 'max': 255, 'depends': [{'name': 'dp_auto_lc', 'vals': [True]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_auto_lc_delay', 'default': 3, 'type': 'UInt8', 'min': 0, 'max': 10, 'depends': [{'name': 'dp_auto_lc', 'vals': [True]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_auto_lc_min_mph', 'default': 60, 'type': 'Float32', 'min': 0, 'max': 255., 'depends': [{'name': 'dp_auto_lc', 'vals': [True]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_auto_lc_delay', 'default': 3, 'type': 'Float32', 'min': 0, 'max': 10., 'depends': [{'name': 'dp_auto_lc', 'vals': [True]}], 'conf_type': ['param', 'struct']},
|
||||
# long ctrl
|
||||
{'name': 'dp_slow_on_curve', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_allow_gas', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_max_ctrl_speed', 'default': 92, 'type': 'Float32', 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_max_ctrl_speed', 'default': 92., 'type': 'Float32', 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_lead_car_alert', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_lead_car_away_alert', 'default': True, 'type': 'Bool', 'conf_type': ['param']},
|
||||
{'name': 'dp_dynamic_follow', 'default': 0, 'type': 'UInt8', 'min': 0, 'max': 4, 'depends': [{'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_dynamic_follow_multiplier', 'default': 1., 'type': 'Float32', 'min': 0.85, 'max': 1.2, 'depends': [{'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param']},
|
||||
{'name': 'dp_dynamic_follow_min_tr', 'default': 0.9, 'type': 'Float32', 'min': 0.85, 'max': 1.6, 'depends': [{'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param']},
|
||||
{'name': 'dp_dynamic_gas', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param']},
|
||||
{'name': 'dp_accel_profile', 'default': 0, 'type': 'UInt8', 'min': 0, 'max': 3, 'depends': [{'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
# safety
|
||||
{'name': 'dp_driver_monitor', 'default': True, 'type': 'Bool', 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_steering_monitor', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_driver_monitor', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_steering_monitor_timer', 'default': 70, 'type': 'UInt8', 'min': 70, 'max': 360, 'depends': [{'name': 'dp_driver_monitor', 'vals': [False]}, {'name': 'dp_steering_monitor', 'vals': [True]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_gear_check', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_temp_monitor', 'default': True, 'type': 'Bool', 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_temp_monitor', 'default': True, 'type': 'Bool', 'conf_type': ['param']},
|
||||
# UIs
|
||||
{'name': 'dp_driving_ui', 'default': True, 'type': 'Bool', 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_screen_off_reversing', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_screen_off_driving', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_app_waze', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_speed', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_driving_ui', 'vals': [True]}, {'name': 'dp_ui_screen_off_driving', 'vals': [False]}, {'name': 'dp_app_waze', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_event', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_driving_ui', 'vals': [True]}, {'name': 'dp_ui_screen_off_driving', 'vals': [False]}, {'name': 'dp_app_waze', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_max_speed', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_driving_ui', 'vals': [True]}, {'name': 'dp_ui_screen_off_driving', 'vals': [False]}, {'name': 'dp_app_waze', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_face', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_driving_ui', 'vals': [True]}, {'name': 'dp_driver_monitor', 'vals': [True]}, {'name': 'dp_ui_screen_off_driving', 'vals': [False]}, {'name': 'dp_app_waze', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_lane', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_driving_ui', 'vals': [True]}, {'name': 'dp_ui_screen_off_driving', 'vals': [False]}, {'name': 'dp_app_waze', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_path', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_driving_ui', 'vals': [True]}, {'name': 'dp_ui_screen_off_driving', 'vals': [False]}, {'name': 'dp_app_waze', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_lead', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_driving_ui', 'vals': [True]}, {'name': 'dp_ui_screen_off_driving', 'vals': [False]}, {'name': 'dp_app_waze', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_dev', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_driving_ui', 'vals': [True]}, {'name': 'dp_ui_screen_off_driving', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_blinker', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_driving_ui', 'vals': [True]}, {'name': 'dp_ui_screen_off_driving', 'vals': [False]}, {'name': 'dp_app_waze', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_screen_off_driving', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_app_waze', 'vals': [False]}, {'name': 'dp_app_hr', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_speed', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_driving_ui', 'vals': [True]}, {'name': 'dp_ui_screen_off_driving', 'vals': [False]}, {'name': 'dp_app_waze', 'vals': [False]}, {'name': 'dp_app_hr', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_event', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_driving_ui', 'vals': [True]}, {'name': 'dp_ui_screen_off_driving', 'vals': [False]}, {'name': 'dp_app_waze', 'vals': [False]}, {'name': 'dp_app_hr', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_max_speed', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_driving_ui', 'vals': [True]}, {'name': 'dp_ui_screen_off_driving', 'vals': [False]}, {'name': 'dp_app_waze', 'vals': [False]}, {'name': 'dp_app_hr', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_face', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_driving_ui', 'vals': [True]}, {'name': 'dp_driver_monitor', 'vals': [True]}, {'name': 'dp_ui_screen_off_driving', 'vals': [False]}, {'name': 'dp_app_waze', 'vals': [False]}, {'name': 'dp_app_hr', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_lane', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_driving_ui', 'vals': [True]}, {'name': 'dp_ui_screen_off_driving', 'vals': [False]}, {'name': 'dp_app_waze', 'vals': [False]}, {'name': 'dp_app_hr', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_path', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_driving_ui', 'vals': [True]}, {'name': 'dp_ui_screen_off_driving', 'vals': [False]}, {'name': 'dp_app_waze', 'vals': [False]}, {'name': 'dp_app_hr', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_lead', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_driving_ui', 'vals': [True]}, {'name': 'dp_ui_screen_off_driving', 'vals': [False]}, {'name': 'dp_app_waze', 'vals': [False]}, {'name': 'dp_app_hr', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_dev', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_dev_mini', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_blinker', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_driving_ui', 'vals': [True]}, {'name': 'dp_ui_screen_off_driving', 'vals': [False]}, {'name': 'dp_app_waze', 'vals': [False]}, {'name': 'dp_app_hr', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_brightness', 'default': 0, 'type': 'UInt8', 'min': 0, 'max': 100, 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_ui_volume_boost', 'default': 0, 'type': 'Int8', 'min': -100, 'max': 100, 'conf_type': ['param', 'struct']},
|
||||
# Apps
|
||||
@@ -76,17 +97,22 @@ confs = [
|
||||
{'name': 'dp_app_aegis_manual', 'default': 0, 'type': 'Int8', 'min': -1, 'max': 1, 'depends': [{'name': 'dp_app_aegis', 'vals': [True]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_app_mixplorer', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_app_mixplorer_manual', 'default': 0, 'type': 'Int8', 'min': -1, 'max': 1, 'depends': [{'name': 'dp_app_mixplorer', 'vals': [True]}], 'conf_type': ['param', 'struct']},
|
||||
# toyota
|
||||
{'name': 'dp_toyota_ldw', 'default': True, 'type': 'Bool', 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_toyota_sng', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_toyota_zss', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
|
||||
{'name': 'dp_toyota_lowest_cruise_override', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_toyota_lowest_cruise_override_at', 'default': 44, 'type': 'Float32', 'depends': [{'name': 'dp_toyota_lowest_cruise_override', 'vals': [True]}], 'min': 44, 'max': 46, 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_toyota_lowest_cruise_override_speed', 'default': 32, 'type': 'Float32', 'depends': [{'name': 'dp_toyota_lowest_cruise_override_speed', 'vals': [True]}], 'min': 27, 'max': 44, 'conf_type': ['param', 'struct']},
|
||||
# custom car
|
||||
{'name': 'dp_car_selected', 'default': '', 'type': 'Text', 'conf_type': ['param']},
|
||||
{'name': 'dp_car_list', 'default': '', 'type': 'Text', 'conf_type': ['param']},
|
||||
{'name': 'dp_car_detected', 'default': '', 'type': 'Text', 'conf_type': ['param']},
|
||||
{'name': 'dp_car_detected', 'default': '', 'type': 'Text', 'conf_type': ['param', 'struct']},
|
||||
# toyota
|
||||
{'name': 'dp_toyota_ldw', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_car_detected', 'vals': ['toyota']}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_toyota_sng', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_car_detected', 'vals': ['toyota']}, {'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_toyota_zss', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_car_detected', 'vals': ['toyota']}], 'conf_type': ['param']},
|
||||
{'name': 'dp_toyota_lowest_cruise_override', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_car_detected', 'vals': ['toyota']}, {'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_toyota_lowest_cruise_override_vego', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_car_detected', 'vals': ['toyota']}, {'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_toyota_lowest_cruise_override_at', 'default': 44, 'type': 'Float32', 'depends': [{'name': 'dp_car_detected', 'vals': ['toyota']}, {'name': 'dp_toyota_lowest_cruise_override', 'vals': [True]}], 'min': 0, 'max': 255., 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_toyota_lowest_cruise_override_speed', 'default': 32, 'type': 'Float32', 'depends': [{'name': 'dp_car_detected', 'vals': ['toyota']}, {'name': 'dp_toyota_lowest_cruise_override_speed', 'vals': [True]}], 'min': 0, 'max': 255., 'conf_type': ['param', 'struct']},
|
||||
# hyundai
|
||||
{'name': 'dp_hkg_smart_mdps', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
|
||||
# honda
|
||||
{'name': 'dp_honda_eps_mod', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
|
||||
#misc
|
||||
{'name': 'dp_ip_addr', 'default': '', 'type': 'Text', 'conf_type': ['struct']},
|
||||
{'name': 'dp_full_speed_fan', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
|
||||
@@ -94,20 +120,18 @@ confs = [
|
||||
{'name': 'dp_last_modified', 'default': str(floor(time.time())), 'type': 'Text', 'conf_type': ['param']},
|
||||
{'name': 'dp_camera_offset', 'default': 6, 'type': 'Int8', 'min': -255, 'max': 255, 'conf_type': ['param', 'struct']},
|
||||
|
||||
{'name': 'dp_locale', 'default': '', 'type': 'Text', 'conf_type': ['param', 'struct'], 'update_once': True},
|
||||
{'name': 'dp_locale', 'default': 'en-US', 'type': 'Text', 'conf_type': ['param', 'struct'], 'update_once': True},
|
||||
{'name': 'dp_disable_relay', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
|
||||
{'name': 'dp_charging_ctrl', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_charging_at', 'default': 60, 'type': 'UInt8', 'min': 0, 'max': 100, 'depends': [{'name': 'dp_charging_ctrl', 'vals': [True]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_discharging_at', 'default': 70, 'type': 'UInt8', 'min': 0, 'max': 100, 'depends': [{'name': 'dp_charging_ctrl', 'vals': [True]}], 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_reg', 'default': True, 'type': 'Bool', 'conf_type': ['param']},
|
||||
{'name': 'dp_is_updating', 'default': False, 'type': 'Bool', 'set_param_only': True, 'conf_type': ['param', 'struct']},
|
||||
{'name': 'dp_is_updating', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
|
||||
|
||||
{'name': 'dp_sr_learner', 'default': True, 'type': 'Bool', 'conf_type': ['param']},
|
||||
{'name': 'dp_lqr', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
|
||||
|
||||
# including thermal data
|
||||
{'name': 'dp_thermal_started', 'default': False, 'type': 'Bool', 'conf_type': ['struct']},
|
||||
{'name': 'dp_thermal_overheat', 'default': False, 'type': 'Bool', 'conf_type': ['struct']},
|
||||
{'name': 'dp_reset_live_param_on_start', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
|
||||
{'name': 'dp_timebomb_assist', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
|
||||
]
|
||||
|
||||
def get_definition(name):
|
||||
@@ -178,7 +202,7 @@ function to append new keys to params.py
|
||||
def init_params_keys(keys, type):
|
||||
for conf in confs:
|
||||
if 'param' in conf['conf_type']:
|
||||
keys[conf['name']] = type
|
||||
keys[conf['name'].encode('utf-8')] = type
|
||||
return keys
|
||||
|
||||
'''
|
||||
@@ -213,22 +237,13 @@ def get_support_car_list():
|
||||
function to init param value.
|
||||
should add this into manager.py
|
||||
'''
|
||||
def init_params_vals(params, put_nonblocking):
|
||||
def init_params_vals(params):
|
||||
for conf in confs:
|
||||
if 'param' in conf['conf_type']:
|
||||
if conf['name'] == 'dp_car_list':
|
||||
params.put(conf['name'], get_support_car_list())
|
||||
elif params.get(conf['name']) is None:
|
||||
print('name: %s' % conf['name'])
|
||||
print('to_param_val: %s' % to_param_val(conf['name'], conf['default']))
|
||||
params.put(conf['name'], to_param_val(conf['name'], conf['default']))
|
||||
|
||||
'''
|
||||
function to conditionally update params
|
||||
should add this after init_params_vals
|
||||
'''
|
||||
def update_params_vals(params):
|
||||
pass
|
||||
|
||||
if __name__ == "__main__":
|
||||
gen_log_struct()
|
||||
|
||||
8
common/dp_time.py
Normal file
8
common/dp_time.py
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env python3.7
|
||||
|
||||
# delay of reading last modified
|
||||
LAST_MODIFIED_DYNAMIC_FOLLOW = 3.
|
||||
LAST_MODIFIED_THERMALD = 10.
|
||||
LAST_MODIFIED_SYSTEMD = 1.
|
||||
LAST_MODIFIED_LANE_PLANNER = 3.
|
||||
LAST_MODIFIED_UPLOADER = 10.
|
||||
@@ -44,7 +44,7 @@ def compile_code(name, c_code, c_header, directory, cflags="", libraries=None):
|
||||
ffibuilder = FFI()
|
||||
ffibuilder.set_source(name, c_code, source_extension='.cpp', libraries=libraries)
|
||||
ffibuilder.cdef(c_header)
|
||||
os.environ['OPT'] = "-fwrapv -O2 -DNDEBUG -std=c++11"
|
||||
os.environ['OPT'] = "-fwrapv -O2 -DNDEBUG -std=c++1z"
|
||||
os.environ['CFLAGS'] = cflags
|
||||
ffibuilder.compile(verbose=True, debug=False, tmpdir=directory)
|
||||
|
||||
|
||||
14
common/gpio.py
Normal file
14
common/gpio.py
Normal file
@@ -0,0 +1,14 @@
|
||||
def gpio_init(pin, output):
|
||||
try:
|
||||
with open(f"/sys/class/gpio/gpio{pin}/direction", 'wb') as f:
|
||||
f.write(b"out" if output else b"in")
|
||||
except Exception as e:
|
||||
print(f"Failed to set gpio {pin} direction: {e}")
|
||||
|
||||
|
||||
def gpio_set(pin, high):
|
||||
try:
|
||||
with open(f"/sys/class/gpio/gpio{pin}/value", 'wb') as f:
|
||||
f.write(b"1" if high else b"0")
|
||||
except Exception as e:
|
||||
print(f"Failed to set gpio {pin} value: {e}")
|
||||
@@ -1,12 +1,14 @@
|
||||
import gettext
|
||||
from common import android
|
||||
from selfdrive.hardware import EON
|
||||
from selfdrive.hardware.eon.hardware import getprop
|
||||
|
||||
is_android = android.ANDROID
|
||||
locale_dir = '/data/openpilot/selfdrive/assets/locales'
|
||||
supported_language = ['en-US', 'zh-TW', 'zh-CN']
|
||||
locale = android.getprop("persist.sys.locale") if is_android else 'en-US'
|
||||
supported_language = ['en-US', 'zh-TW', 'zh-CN', 'ja-JP', 'ko-KR']
|
||||
|
||||
def get_locale():
|
||||
return getprop("persist.sys.locale") if EON else 'en-US'
|
||||
|
||||
def events():
|
||||
i18n = gettext.translation('events', localedir=locale_dir, fallback=True, languages=[locale])
|
||||
i18n = gettext.translation('events', localedir=locale_dir, fallback=True, languages=[get_locale()])
|
||||
i18n.install()
|
||||
return i18n.gettext
|
||||
@@ -1,6 +1,3 @@
|
||||
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")
|
||||
Import('envCython')
|
||||
|
||||
envCython.Program('simple_kalman_impl.so', 'simple_kalman_impl.pyx')
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# cython: language_level = 3
|
||||
|
||||
cdef class KF1D:
|
||||
cdef public:
|
||||
double x0_0
|
||||
@@ -13,4 +15,4 @@ cdef class KF1D:
|
||||
double A_K_0
|
||||
double A_K_1
|
||||
double A_K_2
|
||||
double A_K_3
|
||||
double A_K_3
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# distutils: language = c++
|
||||
# cython: language_level=3
|
||||
|
||||
cdef class KF1D:
|
||||
|
||||
@@ -8,7 +8,7 @@ class KF1D:
|
||||
def __init__(self, x0, A, C, K):
|
||||
self.x = x0
|
||||
self.A = A
|
||||
self.C = C
|
||||
self.C = np.atleast_2d(C)
|
||||
self.K = K
|
||||
|
||||
self.A_K = self.A - np.dot(self.K, self.C)
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
from distutils.core import Extension, setup
|
||||
|
||||
from Cython.Build import cythonize
|
||||
|
||||
from common.cython_hacks import BuildExtWithoutPlatformSuffix
|
||||
|
||||
setup(name='Simple Kalman Implementation',
|
||||
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
|
||||
ext_modules=cythonize(Extension("simple_kalman_impl", ["simple_kalman_impl.pyx"])))
|
||||
@@ -21,10 +21,10 @@ class TestSimpleKalman(unittest.TestCase):
|
||||
K0_0 = 0.12287673
|
||||
K1_0 = 0.29666309
|
||||
|
||||
self.kf_old = KF1D_old(x0=np.matrix([[x0_0], [x1_0]]),
|
||||
A=np.matrix([[A0_0, A0_1], [A1_0, A1_1]]),
|
||||
C=np.matrix([C0_0, C0_1]),
|
||||
K=np.matrix([[K0_0], [K1_0]]))
|
||||
self.kf_old = KF1D_old(x0=np.array([[x0_0], [x1_0]]),
|
||||
A=np.array([[A0_0, A0_1], [A1_0, A1_1]]),
|
||||
C=np.array([C0_0, C0_1]),
|
||||
K=np.array([[K0_0], [K1_0]]))
|
||||
|
||||
self.kf = KF1D(x0=[[x0_0], [x1_0]],
|
||||
A=[[A0_0, A0_1], [A1_0, A1_1]],
|
||||
@@ -47,8 +47,8 @@ class TestSimpleKalman(unittest.TestCase):
|
||||
x = self.kf.update(v_wheel)
|
||||
|
||||
# Compare the output x, verify that the error is less than 1e-4
|
||||
self.assertAlmostEqual(x_old[0], x[0])
|
||||
self.assertAlmostEqual(x_old[1], x[1])
|
||||
np.testing.assert_almost_equal(x_old[0], x[0])
|
||||
np.testing.assert_almost_equal(x_old[1], x[1])
|
||||
|
||||
def test_new_is_faster(self):
|
||||
setup = """
|
||||
@@ -69,10 +69,10 @@ C0_1 = 0.0
|
||||
K0_0 = 0.12287673
|
||||
K1_0 = 0.29666309
|
||||
|
||||
kf_old = KF1D_old(x0=np.matrix([[x0_0], [x1_0]]),
|
||||
A=np.matrix([[A0_0, A0_1], [A1_0, A1_1]]),
|
||||
C=np.matrix([C0_0, C0_1]),
|
||||
K=np.matrix([[K0_0], [K1_0]]))
|
||||
kf_old = KF1D_old(x0=np.array([[x0_0], [x1_0]]),
|
||||
A=np.array([[A0_0, A0_1], [A1_0, A1_1]]),
|
||||
C=np.array([C0_0, C0_1]),
|
||||
K=np.array([[K0_0], [K1_0]]))
|
||||
|
||||
kf = KF1D(x0=[[x0_0], [x1_0]],
|
||||
A=[[A0_0, A0_1], [A1_0, A1_1]],
|
||||
@@ -82,3 +82,6 @@ kf = KF1D(x0=[[x0_0], [x1_0]],
|
||||
kf_speed = timeit.timeit("kf.update(1234)", setup=setup, number=10000)
|
||||
kf_old_speed = timeit.timeit("kf_old.update(1234)", setup=setup, number=10000)
|
||||
self.assertTrue(kf_speed < kf_old_speed / 4)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
416
common/params.py
Executable file → Normal file
416
common/params.py
Executable file → Normal file
@@ -1,412 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
"""ROS has a parameter server, we have files.
|
||||
|
||||
The parameter store is a persistent key value store, implemented as a directory with a writer lock.
|
||||
On Android, we store params under params_dir = /data/params. The writer lock is a file
|
||||
"<params_dir>/.lock" taken using flock(), and data is stored in a directory symlinked to by
|
||||
"<params_dir>/d".
|
||||
|
||||
Each key, value pair is stored as a file with named <key> with contents <value>, located in
|
||||
<params_dir>/d/<key>
|
||||
|
||||
Readers of a single key can just open("<params_dir>/d/<key>") and read the file contents.
|
||||
Readers who want a consistent snapshot of multiple keys should take the lock.
|
||||
|
||||
Writers should take the lock before modifying anything. Writers should also leave the DB in a
|
||||
consistent state after a crash. The implementation below does this by copying all params to a temp
|
||||
directory <params_dir>/<tmp>, then atomically symlinking <params_dir>/<d> to <params_dir>/<tmp>
|
||||
before deleting the old <params_dir>/<d> directory.
|
||||
|
||||
Writers that only modify a single key can simply take the lock, then swap the corresponding value
|
||||
file in place without messing with <params_dir>/d.
|
||||
"""
|
||||
import time
|
||||
import os
|
||||
import errno
|
||||
import shutil
|
||||
import fcntl
|
||||
import tempfile
|
||||
import threading
|
||||
from enum import Enum
|
||||
from common.basedir import PARAMS
|
||||
from common.dp_conf import init_params_keys
|
||||
|
||||
|
||||
def mkdirs_exists_ok(path):
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except OSError:
|
||||
if not os.path.isdir(path):
|
||||
raise
|
||||
|
||||
|
||||
class TxType(Enum):
|
||||
PERSISTENT = 1
|
||||
CLEAR_ON_MANAGER_START = 2
|
||||
CLEAR_ON_PANDA_DISCONNECT = 3
|
||||
|
||||
|
||||
class UnknownKeyName(Exception):
|
||||
pass
|
||||
|
||||
|
||||
keys = {
|
||||
"AccessToken": [TxType.CLEAR_ON_MANAGER_START],
|
||||
"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],
|
||||
"DisablePowerDown": [TxType.PERSISTENT],
|
||||
"DisableUpdates": [TxType.PERSISTENT],
|
||||
"DoUninstall": [TxType.CLEAR_ON_MANAGER_START],
|
||||
"DongleId": [TxType.PERSISTENT],
|
||||
"GitBranch": [TxType.PERSISTENT],
|
||||
"GitCommit": [TxType.PERSISTENT],
|
||||
"GitRemote": [TxType.PERSISTENT],
|
||||
"GithubSshKeys": [TxType.PERSISTENT],
|
||||
"HasAcceptedTerms": [TxType.PERSISTENT],
|
||||
"HasCompletedSetup": [TxType.PERSISTENT],
|
||||
"IsDriverViewEnabled": [TxType.CLEAR_ON_MANAGER_START],
|
||||
"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],
|
||||
"IsUploadRawEnabled": [TxType.PERSISTENT],
|
||||
"LastAthenaPingTime": [TxType.PERSISTENT],
|
||||
"LastUpdateTime": [TxType.PERSISTENT],
|
||||
"LimitSetSpeed": [TxType.PERSISTENT],
|
||||
"LimitSetSpeedNeural": [TxType.PERSISTENT],
|
||||
"LiveParameters": [TxType.PERSISTENT],
|
||||
"LongitudinalControl": [TxType.PERSISTENT],
|
||||
"OpenpilotEnabledToggle": [TxType.PERSISTENT],
|
||||
"LaneChangeEnabled": [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],
|
||||
"ShouldDoUpdate": [TxType.CLEAR_ON_MANAGER_START],
|
||||
"SpeedLimitOffset": [TxType.PERSISTENT],
|
||||
"SubscriberInfo": [TxType.PERSISTENT],
|
||||
"TermsVersion": [TxType.PERSISTENT],
|
||||
"TrainingVersion": [TxType.PERSISTENT],
|
||||
"UpdateAvailable": [TxType.CLEAR_ON_MANAGER_START],
|
||||
"UpdateFailedCount": [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_NeosUpdate": [TxType.CLEAR_ON_MANAGER_START],
|
||||
}
|
||||
|
||||
keys = init_params_keys(keys, [TxType.PERSISTENT])
|
||||
|
||||
def fsync_dir(path):
|
||||
fd = os.open(path, os.O_RDONLY)
|
||||
try:
|
||||
os.fsync(fd)
|
||||
finally:
|
||||
os.close(fd)
|
||||
|
||||
|
||||
class FileLock():
|
||||
def __init__(self, path, create):
|
||||
self._path = path
|
||||
self._create = create
|
||||
self._fd = None
|
||||
|
||||
def acquire(self):
|
||||
self._fd = os.open(self._path, os.O_CREAT if self._create else 0)
|
||||
fcntl.flock(self._fd, fcntl.LOCK_EX)
|
||||
|
||||
def release(self):
|
||||
if self._fd is not None:
|
||||
os.close(self._fd)
|
||||
self._fd = None
|
||||
|
||||
|
||||
class DBAccessor():
|
||||
def __init__(self, path):
|
||||
self._path = path
|
||||
self._vals = None
|
||||
|
||||
def keys(self):
|
||||
self._check_entered()
|
||||
return self._vals.keys()
|
||||
|
||||
def get(self, key):
|
||||
self._check_entered()
|
||||
|
||||
if self._vals is None:
|
||||
return None
|
||||
|
||||
try:
|
||||
return self._vals[key]
|
||||
except KeyError:
|
||||
return None
|
||||
|
||||
def _get_lock(self, create):
|
||||
lock = FileLock(os.path.join(self._path, ".lock"), create)
|
||||
lock.acquire()
|
||||
return lock
|
||||
|
||||
def _read_values_locked(self):
|
||||
"""Callers should hold a lock while calling this method."""
|
||||
vals = {}
|
||||
try:
|
||||
data_path = self._data_path()
|
||||
keys = os.listdir(data_path)
|
||||
for key in keys:
|
||||
with open(os.path.join(data_path, key), "rb") as f:
|
||||
vals[key] = f.read()
|
||||
except (OSError, IOError) as e:
|
||||
# Either the DB hasn't been created yet, or somebody wrote a bug and left the DB in an
|
||||
# inconsistent state. Either way, return empty.
|
||||
if e.errno == errno.ENOENT:
|
||||
return {}
|
||||
|
||||
return vals
|
||||
|
||||
def _data_path(self):
|
||||
return os.path.join(self._path, "d")
|
||||
|
||||
def _check_entered(self):
|
||||
if self._vals is None:
|
||||
raise Exception("Must call __enter__ before using DB")
|
||||
|
||||
|
||||
class DBReader(DBAccessor):
|
||||
def __enter__(self):
|
||||
try:
|
||||
lock = self._get_lock(False)
|
||||
except OSError as e:
|
||||
# Do not create lock if it does not exist.
|
||||
if e.errno == errno.ENOENT:
|
||||
self._vals = {}
|
||||
return self
|
||||
|
||||
try:
|
||||
# Read everything.
|
||||
self._vals = self._read_values_locked()
|
||||
return self
|
||||
finally:
|
||||
lock.release()
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
pass
|
||||
|
||||
|
||||
class DBWriter(DBAccessor):
|
||||
def __init__(self, path):
|
||||
super(DBWriter, self).__init__(path)
|
||||
self._lock = None
|
||||
self._prev_umask = None
|
||||
|
||||
def put(self, key, value):
|
||||
self._vals[key] = value
|
||||
|
||||
def delete(self, key):
|
||||
self._vals.pop(key, None)
|
||||
|
||||
def __enter__(self):
|
||||
mkdirs_exists_ok(self._path)
|
||||
|
||||
# Make sure we can write and that permissions are correct.
|
||||
self._prev_umask = os.umask(0)
|
||||
|
||||
try:
|
||||
os.chmod(self._path, 0o777)
|
||||
self._lock = self._get_lock(True)
|
||||
self._vals = self._read_values_locked()
|
||||
except Exception:
|
||||
os.umask(self._prev_umask)
|
||||
self._prev_umask = None
|
||||
raise
|
||||
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
self._check_entered()
|
||||
|
||||
try:
|
||||
# data_path refers to the externally used path to the params. It is a symlink.
|
||||
# old_data_path is the path currently pointed to by data_path.
|
||||
# tempdir_path is a path where the new params will go, which the new data path will point to.
|
||||
# new_data_path is a temporary symlink that will atomically overwrite data_path.
|
||||
#
|
||||
# The current situation is:
|
||||
# data_path -> old_data_path
|
||||
# We're going to write params data to tempdir_path
|
||||
# tempdir_path -> params data
|
||||
# Then point new_data_path to tempdir_path
|
||||
# new_data_path -> tempdir_path
|
||||
# Then atomically overwrite data_path with new_data_path
|
||||
# data_path -> tempdir_path
|
||||
old_data_path = None
|
||||
new_data_path = None
|
||||
tempdir_path = tempfile.mkdtemp(prefix=".tmp", dir=self._path)
|
||||
|
||||
try:
|
||||
# Write back all keys.
|
||||
os.chmod(tempdir_path, 0o777)
|
||||
for k, v in self._vals.items():
|
||||
with open(os.path.join(tempdir_path, k), "wb") as f:
|
||||
f.write(v)
|
||||
f.flush()
|
||||
os.fsync(f.fileno())
|
||||
fsync_dir(tempdir_path)
|
||||
|
||||
data_path = self._data_path()
|
||||
try:
|
||||
old_data_path = os.path.join(self._path, os.readlink(data_path))
|
||||
except (OSError, IOError):
|
||||
# NOTE(mgraczyk): If other DB implementations have bugs, this could cause
|
||||
# copies to be left behind, but we still want to overwrite.
|
||||
pass
|
||||
|
||||
new_data_path = "{}.link".format(tempdir_path)
|
||||
os.symlink(os.path.basename(tempdir_path), new_data_path)
|
||||
os.rename(new_data_path, data_path)
|
||||
fsync_dir(self._path)
|
||||
finally:
|
||||
# If the rename worked, we can delete the old data. Otherwise delete the new one.
|
||||
success = new_data_path is not None and os.path.exists(data_path) and (
|
||||
os.readlink(data_path) == os.path.basename(tempdir_path))
|
||||
|
||||
if success:
|
||||
if old_data_path is not None:
|
||||
shutil.rmtree(old_data_path)
|
||||
else:
|
||||
shutil.rmtree(tempdir_path)
|
||||
|
||||
# Regardless of what happened above, there should be no link at new_data_path.
|
||||
if new_data_path is not None and os.path.islink(new_data_path):
|
||||
os.remove(new_data_path)
|
||||
finally:
|
||||
os.umask(self._prev_umask)
|
||||
self._prev_umask = None
|
||||
|
||||
# Always release the lock.
|
||||
self._lock.release()
|
||||
self._lock = None
|
||||
|
||||
|
||||
def read_db(params_path, key):
|
||||
path = "%s/d/%s" % (params_path, key)
|
||||
try:
|
||||
with open(path, "rb") as f:
|
||||
return f.read()
|
||||
except IOError:
|
||||
return None
|
||||
|
||||
|
||||
def write_db(params_path, key, value):
|
||||
if isinstance(value, str):
|
||||
value = value.encode('utf8')
|
||||
|
||||
prev_umask = os.umask(0)
|
||||
lock = FileLock(params_path + "/.lock", True)
|
||||
lock.acquire()
|
||||
|
||||
try:
|
||||
tmp_path = tempfile.mktemp(prefix=".tmp", dir=params_path)
|
||||
with open(tmp_path, "wb") as f:
|
||||
f.write(value)
|
||||
f.flush()
|
||||
os.fsync(f.fileno())
|
||||
|
||||
path = "%s/d/%s" % (params_path, key)
|
||||
os.rename(tmp_path, path)
|
||||
fsync_dir(os.path.dirname(path))
|
||||
finally:
|
||||
os.umask(prev_umask)
|
||||
lock.release()
|
||||
|
||||
|
||||
class Params():
|
||||
def __init__(self, db=PARAMS):
|
||||
self.db = db
|
||||
|
||||
# create the database if it doesn't exist...
|
||||
if not os.path.exists(self.db + "/d"):
|
||||
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)
|
||||
else:
|
||||
return DBReader(self.db)
|
||||
|
||||
def _clear_keys_with_type(self, tx_type):
|
||||
with self.transaction(write=True) as txn:
|
||||
for key in keys:
|
||||
if tx_type in keys[key]:
|
||||
txn.delete(key)
|
||||
|
||||
def manager_start(self):
|
||||
self._clear_keys_with_type(TxType.CLEAR_ON_MANAGER_START)
|
||||
|
||||
def panda_disconnect(self):
|
||||
self._clear_keys_with_type(TxType.CLEAR_ON_PANDA_DISCONNECT)
|
||||
|
||||
def delete(self, key):
|
||||
with self.transaction(write=True) as txn:
|
||||
txn.delete(key)
|
||||
|
||||
def get(self, key, block=False, encoding=None):
|
||||
if key not in keys:
|
||||
raise UnknownKeyName(key)
|
||||
|
||||
while 1:
|
||||
ret = read_db(self.db, key)
|
||||
if not block or ret is not None:
|
||||
break
|
||||
# is polling really the best we can do?
|
||||
time.sleep(0.05)
|
||||
|
||||
if ret is not None and encoding is not None:
|
||||
ret = ret.decode(encoding)
|
||||
|
||||
return ret
|
||||
|
||||
def put(self, key, dat):
|
||||
"""
|
||||
Warning: This function blocks until the param is written to disk!
|
||||
In very rare cases this can take over a second, and your code will hang.
|
||||
|
||||
Use the put_nonblocking helper function in time sensitive code, but
|
||||
in general try to avoid writing params as much as possible.
|
||||
"""
|
||||
|
||||
if key not in keys:
|
||||
raise UnknownKeyName(key)
|
||||
|
||||
write_db(self.db, key, dat)
|
||||
|
||||
|
||||
def put_nonblocking(key, val):
|
||||
def f(key, val):
|
||||
params = Params()
|
||||
params.put(key, val)
|
||||
|
||||
t = threading.Thread(target=f, args=(key, val))
|
||||
t.start()
|
||||
return t
|
||||
from common.params_pyx import Params, UnknownKeyName, put_nonblocking # pylint: disable=no-name-in-module, import-error
|
||||
assert Params
|
||||
assert UnknownKeyName
|
||||
assert put_nonblocking
|
||||
|
||||
16
common/params_pxd.pxd
Normal file
16
common/params_pxd.pxd
Normal file
@@ -0,0 +1,16 @@
|
||||
from libcpp.string cimport string
|
||||
from libcpp cimport bool
|
||||
|
||||
cdef extern from "selfdrive/common/params.cc":
|
||||
pass
|
||||
|
||||
cdef extern from "selfdrive/common/util.c":
|
||||
pass
|
||||
|
||||
cdef extern from "selfdrive/common/params.h":
|
||||
cdef cppclass Params:
|
||||
Params(bool)
|
||||
Params(string)
|
||||
string get(string, bool) nogil
|
||||
int delete_db_value(string)
|
||||
int write_db_value(string, string)
|
||||
164
common/params_pyx.pyx
Executable file
164
common/params_pyx.pyx
Executable file
@@ -0,0 +1,164 @@
|
||||
# distutils: language = c++
|
||||
# cython: language_level = 3
|
||||
from libcpp cimport bool
|
||||
from libcpp.string cimport string
|
||||
from common.params_pxd cimport Params as c_Params
|
||||
from common.dp_conf import init_params_keys
|
||||
|
||||
import os
|
||||
import threading
|
||||
from common.basedir import BASEDIR
|
||||
|
||||
cdef enum TxType:
|
||||
PERSISTENT = 1
|
||||
CLEAR_ON_MANAGER_START = 2
|
||||
CLEAR_ON_PANDA_DISCONNECT = 3
|
||||
|
||||
keys = {
|
||||
b"AccessToken": [TxType.CLEAR_ON_MANAGER_START],
|
||||
b"AthenadPid": [TxType.PERSISTENT],
|
||||
b"CalibrationParams": [TxType.PERSISTENT],
|
||||
b"CarBatteryCapacity": [TxType.PERSISTENT],
|
||||
b"CarParams": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
|
||||
b"CarParamsCache": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
|
||||
b"CarVin": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
|
||||
b"CommunityFeaturesToggle": [TxType.PERSISTENT],
|
||||
b"CompletedTrainingVersion": [TxType.PERSISTENT],
|
||||
b"DisablePowerDown": [TxType.PERSISTENT],
|
||||
b"DisableUpdates": [TxType.PERSISTENT],
|
||||
b"DoUninstall": [TxType.CLEAR_ON_MANAGER_START],
|
||||
b"DongleId": [TxType.PERSISTENT],
|
||||
b"GitBranch": [TxType.PERSISTENT],
|
||||
b"GitCommit": [TxType.PERSISTENT],
|
||||
b"GitRemote": [TxType.PERSISTENT],
|
||||
b"GithubSshKeys": [TxType.PERSISTENT],
|
||||
b"HasAcceptedTerms": [TxType.PERSISTENT],
|
||||
b"HasCompletedSetup": [TxType.PERSISTENT],
|
||||
b"IsDriverViewEnabled": [TxType.CLEAR_ON_MANAGER_START],
|
||||
b"IsLdwEnabled": [TxType.PERSISTENT],
|
||||
b"IsMetric": [TxType.PERSISTENT],
|
||||
b"IsOffroad": [TxType.CLEAR_ON_MANAGER_START],
|
||||
b"IsRHD": [TxType.PERSISTENT],
|
||||
b"IsTakingSnapshot": [TxType.CLEAR_ON_MANAGER_START],
|
||||
b"IsUpdateAvailable": [TxType.CLEAR_ON_MANAGER_START],
|
||||
b"IsUploadRawEnabled": [TxType.PERSISTENT],
|
||||
b"LastAthenaPingTime": [TxType.PERSISTENT],
|
||||
b"LastUpdateTime": [TxType.PERSISTENT],
|
||||
b"LastUpdateException": [TxType.PERSISTENT],
|
||||
b"LiveParameters": [TxType.PERSISTENT],
|
||||
b"OpenpilotEnabledToggle": [TxType.PERSISTENT],
|
||||
b"LaneChangeEnabled": [TxType.PERSISTENT],
|
||||
b"PandaFirmware": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
|
||||
b"PandaFirmwareHex": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
|
||||
b"PandaDongleId": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
|
||||
b"Passive": [TxType.PERSISTENT],
|
||||
b"RecordFront": [TxType.PERSISTENT],
|
||||
b"ReleaseNotes": [TxType.PERSISTENT],
|
||||
b"ShouldDoUpdate": [TxType.CLEAR_ON_MANAGER_START],
|
||||
b"SubscriberInfo": [TxType.PERSISTENT],
|
||||
b"TermsVersion": [TxType.PERSISTENT],
|
||||
b"TrainingVersion": [TxType.PERSISTENT],
|
||||
b"UpdateAvailable": [TxType.CLEAR_ON_MANAGER_START],
|
||||
b"UpdateFailedCount": [TxType.CLEAR_ON_MANAGER_START],
|
||||
b"Version": [TxType.PERSISTENT],
|
||||
b"Offroad_ChargeDisabled": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
|
||||
b"Offroad_ConnectivityNeeded": [TxType.CLEAR_ON_MANAGER_START],
|
||||
b"Offroad_ConnectivityNeededPrompt": [TxType.CLEAR_ON_MANAGER_START],
|
||||
b"Offroad_TemperatureTooHigh": [TxType.CLEAR_ON_MANAGER_START],
|
||||
b"Offroad_PandaFirmwareMismatch": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
|
||||
b"Offroad_InvalidTime": [TxType.CLEAR_ON_MANAGER_START],
|
||||
b"Offroad_IsTakingSnapshot": [TxType.CLEAR_ON_MANAGER_START],
|
||||
b"Offroad_NeosUpdate": [TxType.CLEAR_ON_MANAGER_START],
|
||||
b"Offroad_UpdateFailed": [TxType.CLEAR_ON_MANAGER_START],
|
||||
b"Offroad_HardwareUnsupported": [TxType.CLEAR_ON_MANAGER_START],
|
||||
}
|
||||
|
||||
keys = init_params_keys(keys, [TxType.PERSISTENT])
|
||||
|
||||
def ensure_bytes(v):
|
||||
if isinstance(v, str):
|
||||
return v.encode()
|
||||
else:
|
||||
return v
|
||||
|
||||
|
||||
class UnknownKeyName(Exception):
|
||||
pass
|
||||
|
||||
cdef class Params:
|
||||
cdef c_Params* p
|
||||
|
||||
def __cinit__(self, d=None, bool persistent_params=False):
|
||||
if d is None:
|
||||
self.p = new c_Params(persistent_params)
|
||||
else:
|
||||
self.p = new c_Params(<string>d.encode())
|
||||
|
||||
def __dealloc__(self):
|
||||
del self.p
|
||||
|
||||
def clear_all(self, tx_type=None):
|
||||
for key in keys:
|
||||
if tx_type is None or tx_type in keys[key]:
|
||||
self.delete(key)
|
||||
|
||||
def manager_start(self):
|
||||
self.clear_all(TxType.CLEAR_ON_MANAGER_START)
|
||||
|
||||
def panda_disconnect(self):
|
||||
self.clear_all(TxType.CLEAR_ON_PANDA_DISCONNECT)
|
||||
|
||||
def get(self, key, block=False, encoding=None):
|
||||
key = ensure_bytes(key)
|
||||
|
||||
if key not in keys:
|
||||
raise UnknownKeyName(key)
|
||||
|
||||
cdef string k = key
|
||||
cdef bool b = block
|
||||
|
||||
cdef string val
|
||||
with nogil:
|
||||
val = self.p.get(k, b)
|
||||
|
||||
if val == b"":
|
||||
if block:
|
||||
# If we got no value while running in blocked mode
|
||||
# it means we got an interrupt while waiting
|
||||
raise KeyboardInterrupt
|
||||
else:
|
||||
return None
|
||||
|
||||
if encoding is not None:
|
||||
return val.decode(encoding)
|
||||
else:
|
||||
return val
|
||||
|
||||
def put(self, key, dat):
|
||||
"""
|
||||
Warning: This function blocks until the param is written to disk!
|
||||
In very rare cases this can take over a second, and your code will hang.
|
||||
Use the put_nonblocking helper function in time sensitive code, but
|
||||
in general try to avoid writing params as much as possible.
|
||||
"""
|
||||
key = ensure_bytes(key)
|
||||
dat = ensure_bytes(dat)
|
||||
|
||||
if key not in keys:
|
||||
raise UnknownKeyName(key)
|
||||
|
||||
self.p.write_db_value(key, dat)
|
||||
|
||||
def delete(self, key):
|
||||
key = ensure_bytes(key)
|
||||
self.p.delete_db_value(key)
|
||||
|
||||
|
||||
def put_nonblocking(key, val, d=None):
|
||||
def f(key, val):
|
||||
params = Params(d)
|
||||
params.put(key, val)
|
||||
|
||||
t = threading.Thread(target=f, args=(key, val))
|
||||
t.start()
|
||||
return t
|
||||
@@ -36,10 +36,10 @@ class Profiler():
|
||||
if not self.enabled:
|
||||
return
|
||||
self.iter += 1
|
||||
print("******* Profiling *******")
|
||||
print("******* Profiling %d *******" % self.iter)
|
||||
for n, ms in sorted(self.cp.items(), key=lambda x: -x[1]):
|
||||
if n in self.cp_ignored:
|
||||
print("%30s: %9.2f percent: %3.0f IGNORED" % (n, ms*1000.0, ms/self.tot*100))
|
||||
print("%30s: %9.2f avg: %7.2f percent: %3.0f IGNORED" % (n, ms*1000.0, ms*1000.0/self.iter, ms/self.tot*100))
|
||||
else:
|
||||
print("%30s: %9.2f percent: %3.0f" % (n, ms*1000.0, ms/self.tot*100))
|
||||
print("%30s: %9.2f avg: %7.2f percent: %3.0f" % (n, ms*1000.0, ms*1000.0/self.iter, ms/self.tot*100))
|
||||
print("Iter clock: %2.6f TOTAL: %2.2f" % (self.tot/self.iter, self.tot))
|
||||
|
||||
@@ -1,53 +1,50 @@
|
||||
"""Utilities for reading real time clocks and keeping soft real time constraints."""
|
||||
import gc
|
||||
import os
|
||||
import time
|
||||
import platform
|
||||
import subprocess
|
||||
import multiprocessing
|
||||
from cffi import FFI
|
||||
|
||||
from common.android import ANDROID
|
||||
from common.common_pyx import sec_since_boot # pylint: disable=no-name-in-module, import-error
|
||||
from common.clock import sec_since_boot # pylint: disable=no-name-in-module, import-error
|
||||
from selfdrive.hardware import PC, TICI
|
||||
|
||||
|
||||
# time step for each process
|
||||
DT_CTRL = 0.01 # controlsd
|
||||
DT_MDL = 0.05 # model
|
||||
DT_DMON = 0.1 # driver monitoring
|
||||
DT_TRML = 0.5 # thermald and manager
|
||||
|
||||
# driver monitoring
|
||||
if TICI:
|
||||
DT_DMON = 0.05
|
||||
else:
|
||||
DT_DMON = 0.1
|
||||
|
||||
ffi = FFI()
|
||||
ffi.cdef("long syscall(long number, ...);")
|
||||
libc = ffi.dlopen(None)
|
||||
|
||||
def _get_tid():
|
||||
if platform.machine() == "x86_64":
|
||||
NR_gettid = 186
|
||||
elif platform.machine() == "aarch64":
|
||||
NR_gettid = 178
|
||||
else:
|
||||
raise NotImplementedError
|
||||
class Priority:
|
||||
# CORE 2
|
||||
# - modeld = 55
|
||||
# - camerad = 54
|
||||
CTRL_LOW = 51 # plannerd & radard
|
||||
|
||||
return libc.syscall(NR_gettid)
|
||||
# CORE 3
|
||||
# - boardd = 55
|
||||
CTRL_HIGH = 53
|
||||
|
||||
|
||||
def set_realtime_priority(level):
|
||||
if os.getuid() != 0:
|
||||
print("not setting priority, not root")
|
||||
return
|
||||
if not PC:
|
||||
os.sched_setscheduler(0, os.SCHED_FIFO, os.sched_param(level))
|
||||
|
||||
return subprocess.call(['chrt', '-f', '-p', str(level), str(_get_tid())])
|
||||
|
||||
def set_core_affinity(core):
|
||||
if os.getuid() != 0:
|
||||
print("not setting affinity, not root")
|
||||
return
|
||||
if not PC:
|
||||
os.sched_setaffinity(0, [core,])
|
||||
|
||||
if ANDROID:
|
||||
return subprocess.call(['taskset', '-p', str(core), str(_get_tid())])
|
||||
else:
|
||||
return -1
|
||||
|
||||
def config_realtime_process(core, priority):
|
||||
gc.disable()
|
||||
set_realtime_priority(priority)
|
||||
set_core_affinity(core)
|
||||
|
||||
|
||||
class Ratekeeper():
|
||||
|
||||
@@ -8,7 +8,7 @@ class Spinner():
|
||||
try:
|
||||
self.spinner_proc = subprocess.Popen(["./spinner"],
|
||||
stdin=subprocess.PIPE,
|
||||
cwd=os.path.join(BASEDIR, "selfdrive", "ui", "spinner"),
|
||||
cwd=os.path.join(BASEDIR, "selfdrive", "ui"),
|
||||
close_fds=True)
|
||||
except OSError:
|
||||
self.spinner_proc = None
|
||||
@@ -40,23 +40,6 @@ class Spinner():
|
||||
self.close()
|
||||
|
||||
|
||||
class FakeSpinner(Spinner):
|
||||
def __init__(self): # pylint: disable=super-init-not-called
|
||||
pass
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def update(self, _):
|
||||
pass
|
||||
|
||||
def close(self):
|
||||
pass
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import time
|
||||
with Spinner() as s:
|
||||
|
||||
@@ -5,12 +5,12 @@ import subprocess
|
||||
from common.basedir import BASEDIR
|
||||
|
||||
|
||||
class TextWindow():
|
||||
def __init__(self, s):
|
||||
class TextWindow:
|
||||
def __init__(self, text):
|
||||
try:
|
||||
self.text_proc = subprocess.Popen(["./text", s],
|
||||
self.text_proc = subprocess.Popen(["./text", text],
|
||||
stdin=subprocess.PIPE,
|
||||
cwd=os.path.join(BASEDIR, "selfdrive", "ui", "text"),
|
||||
cwd=os.path.join(BASEDIR, "selfdrive", "ui"),
|
||||
close_fds=True)
|
||||
except OSError:
|
||||
self.text_proc = None
|
||||
@@ -19,7 +19,6 @@ class TextWindow():
|
||||
if self.text_proc is not None:
|
||||
self.text_proc.poll()
|
||||
return self.text_proc.returncode
|
||||
|
||||
return None
|
||||
|
||||
def __enter__(self):
|
||||
@@ -31,10 +30,12 @@ class TextWindow():
|
||||
self.text_proc = None
|
||||
|
||||
def wait_for_exit(self):
|
||||
while True:
|
||||
if self.get_status() == 1:
|
||||
return
|
||||
time.sleep(0.1)
|
||||
if self.text_proc is not None:
|
||||
while True:
|
||||
if self.get_status() == 1:
|
||||
os.system('/data/openpilot/scripts/reset_update.sh')
|
||||
return
|
||||
time.sleep(0.1)
|
||||
|
||||
def __del__(self):
|
||||
self.close()
|
||||
@@ -43,29 +44,6 @@ class TextWindow():
|
||||
self.close()
|
||||
|
||||
|
||||
class FakeTextWindow(TextWindow):
|
||||
def __init__(self, s): # pylint: disable=super-init-not-called
|
||||
pass
|
||||
|
||||
def get_status(self):
|
||||
return 1
|
||||
|
||||
def wait_for_exit(self):
|
||||
return
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def update(self, _):
|
||||
pass
|
||||
|
||||
def close(self):
|
||||
pass
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
text = """Traceback (most recent call last):
|
||||
File "./controlsd.py", line 608, in <module>
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
Import('env')
|
||||
Import('envCython')
|
||||
|
||||
d = Dir('.')
|
||||
|
||||
env.Command(
|
||||
['transformations.so'],
|
||||
['transformations.pxd', 'transformations.pyx',
|
||||
'coordinates.cc', 'orientation.cc', 'coordinates.hpp', 'orientation.hpp'],
|
||||
'cd ' + d.path + ' && python3 setup.py build_ext --inplace')
|
||||
envCython.Program('transformations.so', 'transformations.pyx')
|
||||
|
||||
@@ -1,29 +1,67 @@
|
||||
import numpy as np
|
||||
import common.transformations.orientation as orient
|
||||
|
||||
FULL_FRAME_SIZE = (1164, 874)
|
||||
W, H = FULL_FRAME_SIZE[0], FULL_FRAME_SIZE[1]
|
||||
eon_focal_length = FOCAL = 910.0
|
||||
import common.transformations.orientation as orient
|
||||
from selfdrive.hardware import TICI
|
||||
|
||||
## -- hardcoded hardware params --
|
||||
eon_f_focal_length = 910.0
|
||||
eon_d_focal_length = 860.0
|
||||
leon_d_focal_length = 650.0
|
||||
tici_f_focal_length = 2648.0
|
||||
tici_e_focal_length = tici_d_focal_length = 567.0 # probably wrong? magnification is not consistent across frame
|
||||
|
||||
eon_f_frame_size = (1164, 874)
|
||||
eon_d_frame_size = (1152, 864)
|
||||
leon_d_frame_size = (816, 612)
|
||||
tici_f_frame_size = tici_e_frame_size = tici_d_frame_size = (1928, 1208)
|
||||
|
||||
# aka 'K' aka camera_frame_from_view_frame
|
||||
eon_intrinsics = np.array([
|
||||
[FOCAL, 0., W/2.],
|
||||
[ 0., FOCAL, H/2.],
|
||||
[ 0., 0., 1.]])
|
||||
|
||||
eon_fcam_intrinsics = np.array([
|
||||
[eon_f_focal_length, 0.0, float(eon_f_frame_size[0])/2],
|
||||
[0.0, eon_f_focal_length, float(eon_f_frame_size[1])/2],
|
||||
[0.0, 0.0, 1.0]])
|
||||
eon_intrinsics = eon_fcam_intrinsics # xx
|
||||
|
||||
leon_dcam_intrinsics = np.array([
|
||||
[650, 0, 816//2],
|
||||
[ 0, 650, 612//2],
|
||||
[ 0, 0, 1]])
|
||||
[leon_d_focal_length, 0.0, float(leon_d_frame_size[0])/2],
|
||||
[0.0, leon_d_focal_length, float(leon_d_frame_size[1])/2],
|
||||
[0.0, 0.0, 1.0]])
|
||||
|
||||
eon_dcam_intrinsics = np.array([
|
||||
[860, 0, 1152//2],
|
||||
[ 0, 860, 864//2],
|
||||
[ 0, 0, 1]])
|
||||
[eon_d_focal_length, 0.0, float(eon_d_frame_size[0])/2],
|
||||
[0.0, eon_d_focal_length, float(eon_d_frame_size[1])/2],
|
||||
[0.0, 0.0, 1.0]])
|
||||
|
||||
tici_fcam_intrinsics = np.array([
|
||||
[tici_f_focal_length, 0.0, float(tici_f_frame_size[0])/2],
|
||||
[0.0, tici_f_focal_length, float(tici_f_frame_size[1])/2],
|
||||
[0.0, 0.0, 1.0]])
|
||||
|
||||
tici_dcam_intrinsics = np.array([
|
||||
[tici_d_focal_length, 0.0, float(tici_d_frame_size[0])/2],
|
||||
[0.0, tici_d_focal_length, float(tici_d_frame_size[1])/2],
|
||||
[0.0, 0.0, 1.0]])
|
||||
|
||||
tici_ecam_intrinsics = tici_dcam_intrinsics
|
||||
|
||||
# aka 'K_inv' aka view_frame_from_camera_frame
|
||||
eon_intrinsics_inv = np.linalg.inv(eon_intrinsics)
|
||||
eon_fcam_intrinsics_inv = np.linalg.inv(eon_fcam_intrinsics)
|
||||
eon_intrinsics_inv = eon_fcam_intrinsics_inv # xx
|
||||
|
||||
tici_fcam_intrinsics_inv = np.linalg.inv(tici_fcam_intrinsics)
|
||||
tici_ecam_intrinsics_inv = np.linalg.inv(tici_ecam_intrinsics)
|
||||
|
||||
|
||||
if not TICI:
|
||||
FULL_FRAME_SIZE = eon_f_frame_size
|
||||
FOCAL = eon_f_focal_length
|
||||
fcam_intrinsics = eon_fcam_intrinsics
|
||||
else:
|
||||
FULL_FRAME_SIZE = tici_f_frame_size
|
||||
FOCAL = tici_f_focal_length
|
||||
fcam_intrinsics = tici_fcam_intrinsics
|
||||
|
||||
W, H = FULL_FRAME_SIZE[0], FULL_FRAME_SIZE[1]
|
||||
|
||||
|
||||
# device/mesh : x->forward, y-> right, z->down
|
||||
@@ -52,6 +90,13 @@ def get_view_frame_from_road_frame(roll, pitch, yaw, height):
|
||||
return np.hstack((view_from_road, [[0], [height], [0]]))
|
||||
|
||||
|
||||
# aka 'extrinsic_matrix'
|
||||
def get_view_frame_from_calib_frame(roll, pitch, yaw, height):
|
||||
device_from_calib= orient.rot_from_euler([roll, pitch, yaw])
|
||||
view_from_calib = view_frame_from_device_frame.dot(device_from_calib)
|
||||
return np.hstack((view_from_calib, [[0], [height], [0]]))
|
||||
|
||||
|
||||
def vp_from_ke(m):
|
||||
"""
|
||||
Computes the vanishing point from the product of the intrinsic and extrinsic
|
||||
@@ -62,9 +107,9 @@ def vp_from_ke(m):
|
||||
return (m[0, 0]/m[2, 0], m[1, 0]/m[2, 0])
|
||||
|
||||
|
||||
def vp_from_rpy(rpy):
|
||||
def vp_from_rpy(rpy, intrinsics=fcam_intrinsics):
|
||||
e = get_view_frame_from_road_frame(rpy[0], rpy[1], rpy[2], 1.22)
|
||||
ke = np.dot(eon_intrinsics, e)
|
||||
ke = np.dot(intrinsics, e)
|
||||
return vp_from_ke(ke)
|
||||
|
||||
|
||||
@@ -74,7 +119,7 @@ def roll_from_ke(m):
|
||||
-(m[0, 0] - m[0, 1] * m[2, 0] / m[2, 1]))
|
||||
|
||||
|
||||
def normalize(img_pts, intrinsics=eon_intrinsics):
|
||||
def normalize(img_pts, intrinsics=fcam_intrinsics):
|
||||
# normalizes image coordinates
|
||||
# accepts single pt or array of pts
|
||||
intrinsics_inv = np.linalg.inv(intrinsics)
|
||||
@@ -87,7 +132,7 @@ def normalize(img_pts, intrinsics=eon_intrinsics):
|
||||
return img_pts_normalized[:, :2].reshape(input_shape)
|
||||
|
||||
|
||||
def denormalize(img_pts, intrinsics=eon_intrinsics):
|
||||
def denormalize(img_pts, intrinsics=fcam_intrinsics, width=W, height=H):
|
||||
# denormalizes image coordinates
|
||||
# accepts single pt or array of pts
|
||||
img_pts = np.array(img_pts)
|
||||
@@ -95,9 +140,9 @@ def denormalize(img_pts, intrinsics=eon_intrinsics):
|
||||
img_pts = np.atleast_2d(img_pts)
|
||||
img_pts = np.hstack((img_pts, np.ones((img_pts.shape[0], 1))))
|
||||
img_pts_denormalized = img_pts.dot(intrinsics.T)
|
||||
img_pts_denormalized[img_pts_denormalized[:, 0] > W] = np.nan
|
||||
img_pts_denormalized[img_pts_denormalized[:, 0] > width] = np.nan
|
||||
img_pts_denormalized[img_pts_denormalized[:, 0] < 0] = np.nan
|
||||
img_pts_denormalized[img_pts_denormalized[:, 1] > H] = np.nan
|
||||
img_pts_denormalized[img_pts_denormalized[:, 1] > height] = np.nan
|
||||
img_pts_denormalized[img_pts_denormalized[:, 1] < 0] = np.nan
|
||||
return img_pts_denormalized[:, :2].reshape(input_shape)
|
||||
|
||||
@@ -130,18 +175,10 @@ def img_from_device(pt_device):
|
||||
return pt_img.reshape(input_shape)[:, :2]
|
||||
|
||||
|
||||
def get_camera_frame_from_calib_frame(camera_frame_from_road_frame):
|
||||
def get_camera_frame_from_calib_frame(camera_frame_from_road_frame, intrinsics=fcam_intrinsics):
|
||||
camera_frame_from_ground = camera_frame_from_road_frame[:, (0, 1, 3)]
|
||||
calib_frame_from_ground = np.dot(eon_intrinsics,
|
||||
calib_frame_from_ground = np.dot(intrinsics,
|
||||
get_view_frame_from_road_frame(0, 0, 0, 1.22))[:, (0, 1, 3)]
|
||||
ground_from_calib_frame = np.linalg.inv(calib_frame_from_ground)
|
||||
camera_frame_from_calib_frame = np.dot(camera_frame_from_ground, ground_from_calib_frame)
|
||||
return camera_frame_from_calib_frame
|
||||
|
||||
|
||||
def pretransform_from_calib(calib):
|
||||
roll, pitch, yaw, height = calib
|
||||
view_frame_from_road_frame = get_view_frame_from_road_frame(roll, pitch, yaw, height)
|
||||
camera_frame_from_road_frame = np.dot(eon_intrinsics, view_frame_from_road_frame)
|
||||
camera_frame_from_calib_frame = get_camera_frame_from_calib_frame(camera_frame_from_road_frame)
|
||||
return np.linalg.inv(camera_frame_from_calib_frame)
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
#define RAD2DEG(x) ((x) * 180.0 / M_PI)
|
||||
|
||||
|
||||
double a = 6378137;
|
||||
double b = 6356752.3142;
|
||||
double esq = 6.69437999014 * 0.001;
|
||||
double a = 6378137; // lgtm [cpp/short-global-name]
|
||||
double b = 6356752.3142; // lgtm [cpp/short-global-name]
|
||||
double esq = 6.69437999014 * 0.001; // lgtm [cpp/short-global-name]
|
||||
double e1sq = 6.73949674228 * 0.001;
|
||||
|
||||
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
import numpy as np
|
||||
|
||||
from common.transformations.camera import (FULL_FRAME_SIZE, eon_focal_length,
|
||||
from common.transformations.camera import (FULL_FRAME_SIZE,
|
||||
FOCAL,
|
||||
get_view_frame_from_road_frame,
|
||||
get_view_frame_from_calib_frame,
|
||||
vp_from_ke)
|
||||
|
||||
# segnet
|
||||
|
||||
SEGNET_SIZE = (512, 384)
|
||||
|
||||
segnet_frame_from_camera_frame = np.array([
|
||||
[float(SEGNET_SIZE[0])/FULL_FRAME_SIZE[0], 0., ],
|
||||
[ 0., float(SEGNET_SIZE[1])/FULL_FRAME_SIZE[1]]])
|
||||
|
||||
def get_segnet_frame_from_camera_frame(segnet_size=SEGNET_SIZE, full_frame_size=FULL_FRAME_SIZE):
|
||||
return np.array([[float(segnet_size[0]) / full_frame_size[0], 0.0],
|
||||
[0.0, float(segnet_size[1]) / full_frame_size[1]]])
|
||||
segnet_frame_from_camera_frame = get_segnet_frame_from_camera_frame() # xx
|
||||
|
||||
# model
|
||||
|
||||
MODEL_INPUT_SIZE = (320, 160)
|
||||
MODEL_YUV_SIZE = (MODEL_INPUT_SIZE[0], MODEL_INPUT_SIZE[1] * 3 // 2)
|
||||
MODEL_CX = MODEL_INPUT_SIZE[0]/2.
|
||||
MODEL_CX = MODEL_INPUT_SIZE[0] / 2.
|
||||
MODEL_CY = 21.
|
||||
|
||||
model_zoom = 1.25
|
||||
model_fl = 728.0
|
||||
model_height = 1.22
|
||||
|
||||
# canonical model transform
|
||||
model_intrinsics = np.array(
|
||||
[[ eon_focal_length / model_zoom, 0. , MODEL_CX],
|
||||
[ 0. , eon_focal_length / model_zoom, MODEL_CY],
|
||||
[ 0. , 0. , 1.]])
|
||||
model_intrinsics = np.array([
|
||||
[model_fl, 0.0, MODEL_CX],
|
||||
[0.0, model_fl, MODEL_CY],
|
||||
[0.0, 0.0, 1.0]])
|
||||
|
||||
|
||||
# MED model
|
||||
@@ -35,34 +35,45 @@ MEDMODEL_INPUT_SIZE = (512, 256)
|
||||
MEDMODEL_YUV_SIZE = (MEDMODEL_INPUT_SIZE[0], MEDMODEL_INPUT_SIZE[1] * 3 // 2)
|
||||
MEDMODEL_CY = 47.6
|
||||
|
||||
medmodel_zoom = 1.
|
||||
medmodel_intrinsics = np.array(
|
||||
[[ eon_focal_length / medmodel_zoom, 0. , 0.5 * MEDMODEL_INPUT_SIZE[0]],
|
||||
[ 0. , eon_focal_length / medmodel_zoom, MEDMODEL_CY],
|
||||
[ 0. , 0. , 1.]])
|
||||
medmodel_fl = 910.0
|
||||
medmodel_intrinsics = np.array([
|
||||
[medmodel_fl, 0.0, 0.5 * MEDMODEL_INPUT_SIZE[0]],
|
||||
[0.0, medmodel_fl, MEDMODEL_CY],
|
||||
[0.0, 0.0, 1.0]])
|
||||
|
||||
|
||||
# CAL model
|
||||
CALMODEL_INPUT_SIZE = (512, 256)
|
||||
CALMODEL_YUV_SIZE = (CALMODEL_INPUT_SIZE[0], CALMODEL_INPUT_SIZE[1] * 3 // 2)
|
||||
CALMODEL_CY = 47.6
|
||||
|
||||
calmodel_zoom = 1.5
|
||||
calmodel_intrinsics = np.array(
|
||||
[[ eon_focal_length / calmodel_zoom, 0. , 0.5 * CALMODEL_INPUT_SIZE[0]],
|
||||
[ 0. , eon_focal_length / calmodel_zoom, CALMODEL_CY],
|
||||
[ 0. , 0. , 1.]])
|
||||
calmodel_fl = 606.7
|
||||
calmodel_intrinsics = np.array([
|
||||
[calmodel_fl, 0.0, 0.5 * CALMODEL_INPUT_SIZE[0]],
|
||||
[0.0, calmodel_fl, CALMODEL_CY],
|
||||
[0.0, 0.0, 1.0]])
|
||||
|
||||
|
||||
# BIG model
|
||||
|
||||
BIGMODEL_INPUT_SIZE = (1024, 512)
|
||||
BIGMODEL_YUV_SIZE = (BIGMODEL_INPUT_SIZE[0], BIGMODEL_INPUT_SIZE[1] * 3 // 2)
|
||||
|
||||
bigmodel_zoom = 1.
|
||||
bigmodel_intrinsics = np.array(
|
||||
[[ eon_focal_length / bigmodel_zoom, 0. , 0.5 * BIGMODEL_INPUT_SIZE[0]],
|
||||
[ 0. , eon_focal_length / bigmodel_zoom, 256+MEDMODEL_CY],
|
||||
[ 0. , 0. , 1.]])
|
||||
bigmodel_fl = 910.0
|
||||
bigmodel_intrinsics = np.array([
|
||||
[bigmodel_fl, 0.0, 0.5 * BIGMODEL_INPUT_SIZE[0]],
|
||||
[0.0, bigmodel_fl, 256 + MEDMODEL_CY],
|
||||
[0.0, 0.0, 1.0]])
|
||||
|
||||
|
||||
# SBIG model (big model with the size of small model)
|
||||
SBIGMODEL_INPUT_SIZE = (512, 256)
|
||||
SBIGMODEL_YUV_SIZE = (SBIGMODEL_INPUT_SIZE[0], SBIGMODEL_INPUT_SIZE[1] * 3 // 2)
|
||||
|
||||
sbigmodel_fl = 455.0
|
||||
sbigmodel_intrinsics = np.array([
|
||||
[sbigmodel_fl, 0.0, 0.5 * SBIGMODEL_INPUT_SIZE[0]],
|
||||
[0.0, sbigmodel_fl, 0.5 * (256 + MEDMODEL_CY)],
|
||||
[0.0, 0.0, 1.0]])
|
||||
|
||||
model_frame_from_road_frame = np.dot(model_intrinsics,
|
||||
get_view_frame_from_road_frame(0, 0, 0, model_height))
|
||||
@@ -73,23 +84,27 @@ bigmodel_frame_from_road_frame = np.dot(bigmodel_intrinsics,
|
||||
medmodel_frame_from_road_frame = np.dot(medmodel_intrinsics,
|
||||
get_view_frame_from_road_frame(0, 0, 0, model_height))
|
||||
|
||||
medmodel_frame_from_calib_frame = np.dot(medmodel_intrinsics,
|
||||
get_view_frame_from_calib_frame(0, 0, 0, 0))
|
||||
|
||||
model_frame_from_bigmodel_frame = np.dot(model_intrinsics, np.linalg.inv(bigmodel_intrinsics))
|
||||
medmodel_frame_from_bigmodel_frame = np.dot(medmodel_intrinsics, np.linalg.inv(bigmodel_intrinsics))
|
||||
|
||||
|
||||
# 'camera from model camera'
|
||||
def get_model_height_transform(camera_frame_from_road_frame, height):
|
||||
camera_frame_from_road_ground = np.dot(camera_frame_from_road_frame, np.array([
|
||||
[1, 0, 0],
|
||||
[0, 1, 0],
|
||||
[0, 0, 0],
|
||||
[0, 0, 1],
|
||||
[1, 0, 0],
|
||||
[0, 1, 0],
|
||||
[0, 0, 0],
|
||||
[0, 0, 1],
|
||||
]))
|
||||
|
||||
camera_frame_from_road_high = np.dot(camera_frame_from_road_frame, np.array([
|
||||
[1, 0, 0],
|
||||
[0, 1, 0],
|
||||
[0, 0, height - model_height],
|
||||
[0, 0, 1],
|
||||
[1, 0, 0],
|
||||
[0, 1, 0],
|
||||
[0, 0, height - model_height],
|
||||
[0, 0, 1],
|
||||
]))
|
||||
|
||||
road_high_from_camera_frame = np.linalg.inv(camera_frame_from_road_high)
|
||||
@@ -100,13 +115,14 @@ def get_model_height_transform(camera_frame_from_road_frame, height):
|
||||
|
||||
# camera_frame_from_model_frame aka 'warp matrix'
|
||||
# was: calibration.h/CalibrationTransform
|
||||
def get_camera_frame_from_model_frame(camera_frame_from_road_frame, height=model_height):
|
||||
def get_camera_frame_from_model_frame(camera_frame_from_road_frame, height=model_height, camera_fl=FOCAL):
|
||||
vp = vp_from_ke(camera_frame_from_road_frame)
|
||||
|
||||
model_zoom = camera_fl / model_fl
|
||||
model_camera_from_model_frame = np.array([
|
||||
[model_zoom, 0., vp[0] - MODEL_CX * model_zoom],
|
||||
[ 0., model_zoom, vp[1] - MODEL_CY * model_zoom],
|
||||
[ 0., 0., 1.],
|
||||
[model_zoom, 0.0, vp[0] - MODEL_CX * model_zoom],
|
||||
[0.0, model_zoom, vp[1] - MODEL_CY * model_zoom],
|
||||
[0.0, 0.0, 1.0],
|
||||
])
|
||||
|
||||
# This function is super slow, so skip it if height is very close to canonical
|
||||
|
||||
@@ -46,7 +46,6 @@ quats_from_rotations = rot2quat
|
||||
quat_from_rot = rot2quat
|
||||
rotations_from_quats = quat2rot
|
||||
rot_from_quat = quat2rot
|
||||
rot_from_quat = quat2rot
|
||||
euler_from_rot = rot2euler
|
||||
euler_from_quat = quat2euler
|
||||
rot_from_euler = euler2rot
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
import os
|
||||
import numpy
|
||||
import sysconfig
|
||||
|
||||
from Cython.Build import cythonize
|
||||
from Cython.Distutils import build_ext
|
||||
from distutils.core import Extension, setup # pylint: disable=import-error,no-name-in-module
|
||||
|
||||
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)
|
||||
|
||||
|
||||
setup(
|
||||
name='Cython transformations wrapper',
|
||||
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
|
||||
ext_modules=cythonize(
|
||||
Extension(
|
||||
"transformations",
|
||||
sources=["transformations.pyx"],
|
||||
language="c++",
|
||||
extra_compile_args=["-std=c++14"],
|
||||
include_dirs=[numpy.get_include()],
|
||||
)
|
||||
))
|
||||
@@ -1,3 +1,4 @@
|
||||
#cython: language_level=3
|
||||
from libcpp cimport bool
|
||||
|
||||
cdef extern from "orientation.cc":
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
from transformations cimport Matrix3, Vector3, Quaternion
|
||||
from transformations cimport ECEF, NED, Geodetic
|
||||
# distutils: language = c++
|
||||
# cython: language_level = 3
|
||||
from common.transformations.transformations cimport Matrix3, Vector3, Quaternion
|
||||
from common.transformations.transformations cimport ECEF, NED, Geodetic
|
||||
|
||||
from transformations cimport euler2quat as euler2quat_c
|
||||
from transformations cimport quat2euler as quat2euler_c
|
||||
from transformations cimport quat2rot as quat2rot_c
|
||||
from transformations cimport rot2quat as rot2quat_c
|
||||
from transformations cimport euler2rot as euler2rot_c
|
||||
from transformations cimport rot2euler as rot2euler_c
|
||||
from transformations cimport rot_matrix as rot_matrix_c
|
||||
from transformations cimport ecef_euler_from_ned as ecef_euler_from_ned_c
|
||||
from transformations cimport ned_euler_from_ecef as ned_euler_from_ecef_c
|
||||
from transformations cimport geodetic2ecef as geodetic2ecef_c
|
||||
from transformations cimport ecef2geodetic as ecef2geodetic_c
|
||||
from transformations cimport LocalCoord_c
|
||||
from common.transformations.transformations cimport euler2quat as euler2quat_c
|
||||
from common.transformations.transformations cimport quat2euler as quat2euler_c
|
||||
from common.transformations.transformations cimport quat2rot as quat2rot_c
|
||||
from common.transformations.transformations cimport rot2quat as rot2quat_c
|
||||
from common.transformations.transformations cimport euler2rot as euler2rot_c
|
||||
from common.transformations.transformations cimport rot2euler as rot2euler_c
|
||||
from common.transformations.transformations cimport rot_matrix as rot_matrix_c
|
||||
from common.transformations.transformations cimport ecef_euler_from_ned as ecef_euler_from_ned_c
|
||||
from common.transformations.transformations cimport ned_euler_from_ecef as ned_euler_from_ecef_c
|
||||
from common.transformations.transformations cimport geodetic2ecef as geodetic2ecef_c
|
||||
from common.transformations.transformations cimport ecef2geodetic as ecef2geodetic_c
|
||||
from common.transformations.transformations cimport LocalCoord_c
|
||||
|
||||
|
||||
import cython
|
||||
@@ -26,7 +28,7 @@ cdef np.ndarray[double, ndim=2] matrix2numpy(Matrix3 m):
|
||||
[m(2, 0), m(2, 1), m(2, 2)],
|
||||
])
|
||||
|
||||
cdef Matrix3 numpy2matrix (np.ndarray[double, ndim=2, mode="fortran"] m):
|
||||
cdef Matrix3 numpy2matrix(np.ndarray[double, ndim=2, mode="fortran"] m):
|
||||
assert m.shape[0] == 3
|
||||
assert m.shape[1] == 3
|
||||
return Matrix3(<double*>m.data)
|
||||
|
||||
@@ -36,6 +36,14 @@
|
||||
update_font=0
|
||||
remove_old_font=0
|
||||
|
||||
# temp fix for lib change
|
||||
if [ ! -f "/system/comma/usr/lib/libcapnp-0.6.1.so" ]; then
|
||||
mount -o remount,rw /system
|
||||
ln -sf /system/comma/usr/lib/libcapnp.so /system/comma/usr/lib/libcapnp-0.6.1.so
|
||||
ln -sf /system/comma/usr/lib/libkj.so /system/comma/usr/lib/libkj-0.6.1.so
|
||||
mount -o remount,r /system
|
||||
fi
|
||||
|
||||
# check regular font
|
||||
if [ ! -f "/system/fonts/NotoSansCJKtc-Regular.otf" ]; then
|
||||
update_font=1
|
||||
|
||||
@@ -10,7 +10,7 @@ WARN_FLAGS = -Werror=implicit-function-declaration \
|
||||
-Werror=format-extra-args
|
||||
|
||||
CFLAGS = -std=gnu11 -g -fPIC -O2 $(WARN_FLAGS)
|
||||
CXXFLAGS = -std=c++11 -g -fPIC -O2 $(WARN_FLAGS)
|
||||
CXXFLAGS = -std=c++1z -g -fPIC -O2 $(WARN_FLAGS)
|
||||
|
||||
CURL_FLAGS = -I$(PHONELIBS)/curl/include
|
||||
CURL_LIBS = $(PHONELIBS)/curl/lib/libcurl.a \
|
||||
@@ -34,6 +34,7 @@ all: updater
|
||||
OBJS = opensans_regular.ttf.o \
|
||||
opensans_semibold.ttf.o \
|
||||
opensans_bold.ttf.o \
|
||||
../../selfdrive/common/util.o \
|
||||
../../selfdrive/common/touch.o \
|
||||
../../selfdrive/common/framebuffer.o \
|
||||
$(PHONELIBS)/json11/json11.o \
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"ota_url": "http://dpp.cool/neosupdate/ota-signed-5c366df88020863525f80f6803afaca9f852854b4b1aef9184189844b7979f0b.zip",
|
||||
"ota_hash": "5c366df88020863525f80f6803afaca9f852854b4b1aef9184189844b7979f0b",
|
||||
"recovery_url": "http://dpp.cool/neosupdate/recovery-4772f9348e04b560b9df87d6dea6c740fa8d62ea41a8db3842eec216f04e3110.img",
|
||||
"recovery_len": 15922476,
|
||||
"recovery_hash": "4772f9348e04b560b9df87d6dea6c740fa8d62ea41a8db3842eec216f04e3110"
|
||||
"ota_url": "https://commadist.azureedge.net/neosupdate/ota-signed-e85f507777cb6b22f88ba1c8be6bbaa2630c484b971344b645fca2d1c461cd47.zip",
|
||||
"ota_hash": "e85f507777cb6b22f88ba1c8be6bbaa2630c484b971344b645fca2d1c461cd47",
|
||||
"recovery_url": "https://commadist.azureedge.net/neosupdate/recovery-db31ffe79dfd60be966fba6d1525a5081a920062b883644dc8f5734bcc6806bb.img",
|
||||
"recovery_len": 15926572,
|
||||
"recovery_hash": "db31ffe79dfd60be966fba6d1525a5081a920062b883644dc8f5734bcc6806bb"
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"ota_url": "https://commadist.azureedge.net/neosupdate/ota-signed-3bd2b3bdd6a501569e00b8f12786d65e0fd2788c0dd238f8c986e3e2e504683a-kernel.zip",
|
||||
"ota_hash": "3bd2b3bdd6a501569e00b8f12786d65e0fd2788c0dd238f8c986e3e2e504683a",
|
||||
"recovery_url": "https://commadist.azureedge.net/neosupdate/recovery-97c27e6ed04ed6bb0608b845a2d4100912093f9380c3f2ba6b56bccd608e5f6e.img",
|
||||
"recovery_len": 15861036,
|
||||
"recovery_hash": "97c27e6ed04ed6bb0608b845a2d4100912093f9380c3f2ba6b56bccd608e5f6e"
|
||||
}
|
||||
Binary file not shown.
@@ -10,6 +10,7 @@
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
|
||||
@@ -33,10 +34,10 @@
|
||||
|
||||
#define USER_AGENT "NEOSUpdater-0.2"
|
||||
|
||||
#define MANIFEST_URL_EON_STAGING "https://github.com/commaai/eon-neos/raw/master/update.staging.json"
|
||||
#define MANIFEST_URL_EON_LOCAL "http://192.168.5.1:8000/neosupdate/update.local.json"
|
||||
#define MANIFEST_URL_EON "https://github.com/commaai/eon-neos/raw/master/update.json"
|
||||
const char *manifest_url = MANIFEST_URL_EON;
|
||||
#define MANIFEST_URL_NEOS_STAGING "https://github.com/commaai/eon-neos/raw/master/update.staging.json"
|
||||
#define MANIFEST_URL_NEOS_LOCAL "http://192.168.5.1:8000/neosupdate/update.local.json"
|
||||
#define MANIFEST_URL_NEOS "https://github.com/commaai/eon-neos/raw/master/update.json"
|
||||
const char *manifest_url = MANIFEST_URL_NEOS;
|
||||
|
||||
#define RECOVERY_DEV "/dev/block/bootdevice/by-name/recovery"
|
||||
#define RECOVERY_COMMAND "/cache/recovery/command"
|
||||
@@ -96,7 +97,7 @@ std::string download_string(CURL *curl, std::string url) {
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 0);
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, USER_AGENT);
|
||||
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_RESUME_FROM, 0);
|
||||
@@ -149,6 +150,32 @@ static void start_settings_activity(const char* name) {
|
||||
system(launch_cmd);
|
||||
}
|
||||
|
||||
bool is_settings_active() {
|
||||
FILE *fp;
|
||||
char sys_output[4096];
|
||||
|
||||
fp = popen("/bin/dumpsys window windows", "r");
|
||||
if (fp == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool active = false;
|
||||
while (fgets(sys_output, sizeof(sys_output), fp) != NULL) {
|
||||
if (strstr(sys_output, "mCurrentFocus=null") != NULL) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (strstr(sys_output, "mCurrentFocus=Window") != NULL) {
|
||||
active = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pclose(fp);
|
||||
|
||||
return active;
|
||||
}
|
||||
|
||||
struct Updater {
|
||||
bool do_exit = false;
|
||||
|
||||
@@ -166,7 +193,6 @@ struct Updater {
|
||||
|
||||
std::mutex lock;
|
||||
|
||||
// i hate state machines give me coroutines already
|
||||
enum UpdateState {
|
||||
CONFIRMATION,
|
||||
LOW_BATTERY,
|
||||
@@ -190,15 +216,23 @@ struct Updater {
|
||||
int b_x, b_w, b_y, b_h;
|
||||
int balt_x;
|
||||
|
||||
// download stage writes these for the installation stage
|
||||
int recovery_len;
|
||||
std::string recovery_hash;
|
||||
std::string recovery_fn;
|
||||
std::string ota_fn;
|
||||
|
||||
CURL *curl = NULL;
|
||||
|
||||
Updater() {
|
||||
void ui_init() {
|
||||
touch_init(&touch);
|
||||
|
||||
fb = framebuffer_init("updater", 0x00001000, false,
|
||||
&fb_w, &fb_h);
|
||||
assert(fb);
|
||||
|
||||
framebuffer_set_power(fb, HWC_POWER_MODE_NORMAL);
|
||||
|
||||
vg = nvgCreateGLES3(NVG_ANTIALIAS | NVG_STENCIL_STROKES | NVG_DEBUG);
|
||||
assert(vg);
|
||||
|
||||
@@ -218,7 +252,6 @@ struct Updater {
|
||||
b_h = 220;
|
||||
|
||||
state = CONFIRMATION;
|
||||
|
||||
}
|
||||
|
||||
int download_file_xferinfo(curl_off_t dltotal, curl_off_t dlno,
|
||||
@@ -251,7 +284,7 @@ struct Updater {
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 0);
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, USER_AGENT);
|
||||
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_RESUME_FROM, resume_from);
|
||||
@@ -319,32 +352,113 @@ struct Updater {
|
||||
state = RUNNING;
|
||||
}
|
||||
|
||||
std::string stage_download(std::string url, std::string hash, std::string name) {
|
||||
std::string download(std::string url, std::string hash, std::string name) {
|
||||
std::string out_fn = UPDATE_DIR "/" + util::base_name(url);
|
||||
|
||||
set_progress("Downloading " + name + "...");
|
||||
bool r = download_file(url, out_fn);
|
||||
if (!r) {
|
||||
set_error("failed to download " + name);
|
||||
return "";
|
||||
// start or resume downloading if hash doesn't match
|
||||
std::string fn_hash = sha256_file(out_fn);
|
||||
if (hash.compare(fn_hash) != 0) {
|
||||
set_progress("Downloading " + name + "...");
|
||||
bool r = download_file(url, out_fn);
|
||||
if (!r) {
|
||||
set_error("failed to download " + name);
|
||||
unlink(out_fn.c_str());
|
||||
return "";
|
||||
}
|
||||
fn_hash = sha256_file(out_fn);
|
||||
}
|
||||
|
||||
set_progress("Verifying " + name + "...");
|
||||
std::string fn_hash = sha256_file(out_fn);
|
||||
printf("got %s hash: %s\n", name.c_str(), hash.c_str());
|
||||
if (fn_hash != hash) {
|
||||
set_error(name + " was corrupt");
|
||||
unlink(out_fn.c_str());
|
||||
return "";
|
||||
}
|
||||
|
||||
return out_fn;
|
||||
}
|
||||
|
||||
void run_stages() {
|
||||
bool download_stage() {
|
||||
curl = curl_easy_init();
|
||||
assert(curl);
|
||||
|
||||
// ** quick checks before download **
|
||||
|
||||
if (!check_space()) {
|
||||
set_error("2GB of free space required to update");
|
||||
return false;
|
||||
}
|
||||
|
||||
mkdir(UPDATE_DIR, 0777);
|
||||
|
||||
set_progress("Finding latest version...");
|
||||
std::string manifest_s = download_string(curl, manifest_url);
|
||||
printf("manifest: %s\n", manifest_s.c_str());
|
||||
|
||||
std::string err;
|
||||
auto manifest = json11::Json::parse(manifest_s, err);
|
||||
if (manifest.is_null() || !err.empty()) {
|
||||
set_error("failed to load update manifest");
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string ota_url = manifest["ota_url"].string_value();
|
||||
std::string ota_hash = manifest["ota_hash"].string_value();
|
||||
|
||||
std::string recovery_url = manifest["recovery_url"].string_value();
|
||||
recovery_hash = manifest["recovery_hash"].string_value();
|
||||
recovery_len = manifest["recovery_len"].int_value();
|
||||
|
||||
// std::string installer_url = manifest["installer_url"].string_value();
|
||||
// std::string installer_hash = manifest["installer_hash"].string_value();
|
||||
|
||||
if (ota_url.empty() || ota_hash.empty()) {
|
||||
set_error("invalid update manifest");
|
||||
return false;
|
||||
}
|
||||
|
||||
// std::string installer_fn = download(installer_url, installer_hash, "installer");
|
||||
// if (installer_fn.empty()) {
|
||||
// //error'd
|
||||
// return;
|
||||
// }
|
||||
|
||||
// ** handle recovery download **
|
||||
if (recovery_url.empty() || recovery_hash.empty() || recovery_len == 0) {
|
||||
set_progress("Skipping recovery flash...");
|
||||
} else {
|
||||
// only download the recovery if it differs from what's flashed
|
||||
set_progress("Checking recovery...");
|
||||
std::string existing_recovery_hash = sha256_file(RECOVERY_DEV, recovery_len);
|
||||
printf("existing recovery hash: %s\n", existing_recovery_hash.c_str());
|
||||
|
||||
if (existing_recovery_hash != recovery_hash) {
|
||||
recovery_fn = download(recovery_url, recovery_hash, "recovery");
|
||||
if (recovery_fn.empty()) {
|
||||
// error'd
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ** handle ota download **
|
||||
ota_fn = download(ota_url, ota_hash, "update");
|
||||
if (ota_fn.empty()) {
|
||||
//error'd
|
||||
return false;
|
||||
}
|
||||
|
||||
// download sucessful
|
||||
return true;
|
||||
}
|
||||
|
||||
// thread that handles downloading and installing the update
|
||||
void run_stages() {
|
||||
printf("run_stages start\n");
|
||||
|
||||
|
||||
// ** download update **
|
||||
|
||||
if (!check_battery()) {
|
||||
set_battery_low();
|
||||
int battery_cap = battery_capacity();
|
||||
@@ -356,77 +470,12 @@ struct Updater {
|
||||
set_running();
|
||||
}
|
||||
|
||||
if (!check_space()) {
|
||||
set_error("2GB of free space required to update");
|
||||
bool sucess = download_stage();
|
||||
if (!sucess) {
|
||||
return;
|
||||
}
|
||||
|
||||
mkdir(UPDATE_DIR, 0777);
|
||||
|
||||
const int EON = (access("/EON", F_OK) != -1);
|
||||
|
||||
set_progress("Finding latest version...");
|
||||
std::string manifest_s;
|
||||
if (EON) {
|
||||
manifest_s = download_string(curl, manifest_url);
|
||||
} else {
|
||||
// don't update NEO
|
||||
exit(0);
|
||||
}
|
||||
|
||||
printf("manifest: %s\n", manifest_s.c_str());
|
||||
|
||||
std::string err;
|
||||
auto manifest = json11::Json::parse(manifest_s, err);
|
||||
if (manifest.is_null() || !err.empty()) {
|
||||
set_error("failed to load update manifest");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string ota_url = manifest["ota_url"].string_value();
|
||||
std::string ota_hash = manifest["ota_hash"].string_value();
|
||||
|
||||
std::string recovery_url = manifest["recovery_url"].string_value();
|
||||
std::string recovery_hash = manifest["recovery_hash"].string_value();
|
||||
int recovery_len = manifest["recovery_len"].int_value();
|
||||
|
||||
// std::string installer_url = manifest["installer_url"].string_value();
|
||||
// std::string installer_hash = manifest["installer_hash"].string_value();
|
||||
|
||||
if (ota_url.empty() || ota_hash.empty()) {
|
||||
set_error("invalid update manifest");
|
||||
return;
|
||||
}
|
||||
|
||||
// std::string installer_fn = stage_download(installer_url, installer_hash, "installer");
|
||||
// if (installer_fn.empty()) {
|
||||
// //error'd
|
||||
// return;
|
||||
// }
|
||||
|
||||
std::string recovery_fn;
|
||||
if (recovery_url.empty() || recovery_hash.empty() || recovery_len == 0) {
|
||||
set_progress("Skipping recovery flash...");
|
||||
} else {
|
||||
// only download the recovery if it differs from what's flashed
|
||||
set_progress("Checking recovery...");
|
||||
std::string existing_recovery_hash = sha256_file(RECOVERY_DEV, recovery_len);
|
||||
printf("existing recovery hash: %s\n", existing_recovery_hash.c_str());
|
||||
|
||||
if (existing_recovery_hash != recovery_hash) {
|
||||
recovery_fn = stage_download(recovery_url, recovery_hash, "recovery");
|
||||
if (recovery_fn.empty()) {
|
||||
// error'd
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string ota_fn = stage_download(ota_url, ota_hash, "update");
|
||||
if (ota_fn.empty()) {
|
||||
//error'd
|
||||
return;
|
||||
}
|
||||
// ** install update **
|
||||
|
||||
if (!check_battery()) {
|
||||
set_battery_low();
|
||||
@@ -601,7 +650,7 @@ struct Updater {
|
||||
int powerprompt_y = 312;
|
||||
nvgFontFace(vg, "opensans_regular");
|
||||
nvgFontSize(vg, 64.0f);
|
||||
nvgText(vg, fb_w/2, 740, "Ensure EON is connected to power.", NULL);
|
||||
nvgText(vg, fb_w/2, 740, "Ensure your device remains connected to a power source.", NULL);
|
||||
|
||||
NVGpaint paint = nvgBoxGradient(
|
||||
vg, progress_x + 1, progress_y + 1,
|
||||
@@ -657,9 +706,7 @@ struct Updater {
|
||||
void ui_update() {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
|
||||
switch (state) {
|
||||
case ERROR:
|
||||
case CONFIRMATION: {
|
||||
if (state == ERROR || state == CONFIRMATION) {
|
||||
int touch_x = -1, touch_y = -1;
|
||||
int res = touch_poll(&touch, &touch_x, &touch_y, 0);
|
||||
if (res == 1 && !is_settings_active()) {
|
||||
@@ -678,13 +725,11 @@ struct Updater {
|
||||
}
|
||||
}
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void go() {
|
||||
ui_init();
|
||||
|
||||
while (!do_exit) {
|
||||
ui_update();
|
||||
|
||||
@@ -718,51 +763,37 @@ struct Updater {
|
||||
update_thread_handle.join();
|
||||
}
|
||||
|
||||
// reboot
|
||||
system("service call power 16 i32 0 i32 0 i32 1");
|
||||
}
|
||||
|
||||
bool is_settings_active() {
|
||||
FILE *fp;
|
||||
char sys_output[4096];
|
||||
|
||||
fp = popen("/bin/dumpsys window windows", "r");
|
||||
if (fp == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool active = false;
|
||||
while (fgets(sys_output, sizeof(sys_output), fp) != NULL) {
|
||||
if (strstr(sys_output, "mCurrentFocus=null") != NULL) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (strstr(sys_output, "mCurrentFocus=Window") != NULL) {
|
||||
active = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pclose(fp);
|
||||
|
||||
return active;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
bool background_cache = false;
|
||||
if (argc > 1) {
|
||||
if (strcmp(argv[1], "local") == 0) {
|
||||
manifest_url = MANIFEST_URL_EON_LOCAL;
|
||||
manifest_url = MANIFEST_URL_NEOS_LOCAL;
|
||||
} else if (strcmp(argv[1], "staging") == 0) {
|
||||
manifest_url = MANIFEST_URL_EON_STAGING;
|
||||
manifest_url = MANIFEST_URL_NEOS_STAGING;
|
||||
} else if (strcmp(argv[1], "bgcache") == 0) {
|
||||
manifest_url = argv[2];
|
||||
background_cache = true;
|
||||
} else {
|
||||
manifest_url = argv[1];
|
||||
}
|
||||
}
|
||||
|
||||
printf("updating from %s\n", manifest_url);
|
||||
Updater updater;
|
||||
updater.go();
|
||||
|
||||
return 0;
|
||||
int err = 0;
|
||||
if (background_cache) {
|
||||
err = !updater.download_stage();
|
||||
} else {
|
||||
updater.go();
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
4
launch.sh
Executable file
4
launch.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
export PASSIVE="0"
|
||||
exec ./launch_chffrplus.sh
|
||||
@@ -1,25 +1,119 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
export OMP_NUM_THREADS=1
|
||||
export MKL_NUM_THREADS=1
|
||||
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
|
||||
source "$BASEDIR/launch_env.sh"
|
||||
|
||||
STAGING_ROOT="/data/safe_staging"
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
||||
|
||||
function launch {
|
||||
function tici_init {
|
||||
sudo su -c 'echo "performance" > /sys/class/devfreq/soc:qcom,memlat-cpu0/governor'
|
||||
sudo su -c 'echo "performance" > /sys/class/devfreq/soc:qcom,memlat-cpu4/governor'
|
||||
}
|
||||
|
||||
function two_init {
|
||||
# Wifi scan
|
||||
wpa_cli IFNAME=wlan0 SCAN
|
||||
|
||||
# *** shield cores 2-3 ***
|
||||
|
||||
# android gets two cores
|
||||
echo 0-1 > /dev/cpuset/background/cpus
|
||||
echo 0-1 > /dev/cpuset/system-background/cpus
|
||||
echo 0-1 > /dev/cpuset/foreground/cpus
|
||||
echo 0-1 > /dev/cpuset/foreground/boost/cpus
|
||||
echo 0-1 > /dev/cpuset/android/cpus
|
||||
|
||||
# openpilot gets all the cores
|
||||
echo 0-3 > /dev/cpuset/app/cpus
|
||||
|
||||
# mask off 2-3 from RPS and XPS - Receive/Transmit Packet Steering
|
||||
echo 3 | tee /sys/class/net/*/queues/*/rps_cpus
|
||||
echo 3 | tee /sys/class/net/*/queues/*/xps_cpus
|
||||
|
||||
# *** set up governors ***
|
||||
|
||||
# +50mW offroad, +500mW onroad for 30% more RAM bandwidth
|
||||
echo "performance" > /sys/class/devfreq/soc:qcom,cpubw/governor
|
||||
echo 1056000 > /sys/class/devfreq/soc:qcom,m4m/max_freq
|
||||
echo "performance" > /sys/class/devfreq/soc:qcom,m4m/governor
|
||||
|
||||
# unclear if these help, but they don't seem to hurt
|
||||
echo "performance" > /sys/class/devfreq/soc:qcom,memlat-cpu0/governor
|
||||
echo "performance" > /sys/class/devfreq/soc:qcom,memlat-cpu2/governor
|
||||
|
||||
# GPU
|
||||
echo "performance" > /sys/class/devfreq/b00000.qcom,kgsl-3d0/governor
|
||||
|
||||
# /sys/class/devfreq/soc:qcom,mincpubw is the only one left at "powersave"
|
||||
# it seems to gain nothing but a wasted 500mW
|
||||
|
||||
# *** set up IRQ affinities ***
|
||||
|
||||
# Collect RIL and other possibly long-running I/O interrupts onto CPU 1
|
||||
echo 1 > /proc/irq/78/smp_affinity_list # qcom,smd-modem (LTE radio)
|
||||
echo 1 > /proc/irq/33/smp_affinity_list # ufshcd (flash storage)
|
||||
echo 1 > /proc/irq/35/smp_affinity_list # wifi (wlan_pci)
|
||||
echo 1 > /proc/irq/6/smp_affinity_list # MDSS
|
||||
|
||||
# USB traffic needs realtime handling on cpu 3
|
||||
[ -d "/proc/irq/733" ] && echo 3 > /proc/irq/733/smp_affinity_list # USB for LeEco
|
||||
[ -d "/proc/irq/736" ] && echo 3 > /proc/irq/736/smp_affinity_list # USB for OP3T
|
||||
|
||||
# GPU and camera get cpu 2
|
||||
CAM_IRQS="177 178 179 180 181 182 183 184 185 186 192"
|
||||
for irq in $CAM_IRQS; do
|
||||
echo 2 > /proc/irq/$irq/smp_affinity_list
|
||||
done
|
||||
echo 2 > /proc/irq/193/smp_affinity_list # GPU
|
||||
|
||||
# give GPU threads RT priority
|
||||
for pid in $(pgrep "kgsl"); do
|
||||
chrt -f -p 52 $pid
|
||||
done
|
||||
|
||||
# the flippening!
|
||||
LD_LIBRARY_PATH="" content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1
|
||||
|
||||
# disable bluetooth
|
||||
service call bluetooth_manager 8
|
||||
|
||||
# Check for NEOS update
|
||||
if [ $(< /VERSION) != "$REQUIRED_NEOS_VERSION" ]; then
|
||||
if [ -f "$DIR/scripts/continue.sh" ]; then
|
||||
cp "$DIR/scripts/continue.sh" "/data/data/com.termux/files/continue.sh"
|
||||
fi
|
||||
|
||||
if [ ! -f "$BASEDIR/prebuilt" ]; then
|
||||
# Clean old build products, but preserve the scons cache
|
||||
cd $DIR
|
||||
scons --clean
|
||||
git clean -xdf
|
||||
git submodule foreach --recursive git clean -xdf
|
||||
fi
|
||||
|
||||
"$DIR/installer/updater/updater" "file://$DIR/installer/updater/update.json"
|
||||
fi
|
||||
|
||||
# One-time fix for a subset of OP3T with gyro orientation offsets.
|
||||
# Remove and regenerate qcom sensor registry. Only done on OP3T mainboards.
|
||||
# Performed exactly once. The old registry is preserved just-in-case, and
|
||||
# doubles as a flag denoting we've already done the reset.
|
||||
if ! $(grep -q "letv" /proc/cmdline) && [ ! -f "/persist/comma/op3t-sns-reg-backup" ]; then
|
||||
echo "Performing OP3T sensor registry reset"
|
||||
mv /persist/sensors/sns.reg /persist/comma/op3t-sns-reg-backup &&
|
||||
rm -f /persist/sensors/sensors_settings /persist/sensors/error_log /persist/sensors/gyro_sensitity_cal &&
|
||||
echo "restart" > /sys/kernel/debug/msm_subsys/slpi &&
|
||||
sleep 5 # Give Android sensor subsystem a moment to recover
|
||||
fi
|
||||
}
|
||||
|
||||
function launch {
|
||||
# Remove orphaned git lock if it exists on boot
|
||||
[ -f "$DIR/.git/index.lock" ] && rm -f $DIR/.git/index.lock
|
||||
|
||||
# Check to see if there's a valid overlay-based update available. Conditions
|
||||
# are as follows:
|
||||
#
|
||||
@@ -49,6 +143,7 @@ function launch {
|
||||
git submodule foreach --recursive git reset --hard
|
||||
|
||||
echo "Restarting launch script ${LAUNCHER_LOCATION}"
|
||||
unset REQUIRED_NEOS_VERSION
|
||||
exec "${LAUNCHER_LOCATION}"
|
||||
else
|
||||
echo "openpilot backup found, not updating"
|
||||
@@ -58,61 +153,11 @@ function launch {
|
||||
# fi
|
||||
fi
|
||||
|
||||
# Android and other system processes are not permitted to run on CPU 3
|
||||
# NEOS installed app processes can run anywhere
|
||||
echo 0-2 > /dev/cpuset/background/cpus
|
||||
echo 0-2 > /dev/cpuset/system-background/cpus
|
||||
[ -d "/dev/cpuset/foreground/boost/cpus" ] && echo 0-2 > /dev/cpuset/foreground/boost/cpus # Not present in < NEOS 15
|
||||
echo 0-2 > /dev/cpuset/foreground/cpus
|
||||
echo 0-2 > /dev/cpuset/android/cpus
|
||||
echo 0-3 > /dev/cpuset/app/cpus
|
||||
|
||||
# Collect RIL and other possibly long-running I/O interrupts onto CPU 1
|
||||
echo 1 > /proc/irq/78/smp_affinity_list # qcom,smd-modem (LTE radio)
|
||||
echo 1 > /proc/irq/33/smp_affinity_list # ufshcd (flash storage)
|
||||
echo 1 > /proc/irq/35/smp_affinity_list # wifi (wlan_pci)
|
||||
# USB traffic needs realtime handling on cpu 3
|
||||
[ -d "/proc/irq/733" ] && echo 3 > /proc/irq/733/smp_affinity_list # USB for LeEco
|
||||
[ -d "/proc/irq/736" ] && echo 3 > /proc/irq/736/smp_affinity_list # USB for OP3T
|
||||
|
||||
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 [ -f "$DIR/scripts/continue.sh" ]; then
|
||||
cp "$DIR/scripts/continue.sh" "/data/data/com.termux/files/continue.sh"
|
||||
fi
|
||||
|
||||
if [ ! -f "$BASEDIR/prebuilt" ]; then
|
||||
echo "Clearing build products and resetting scons state prior to NEOS update"
|
||||
cd $BASEDIR && scons --clean
|
||||
rm -rf /tmp/scons_cache
|
||||
rm -r $BASEDIR/.sconsign.dblite
|
||||
fi
|
||||
"$DIR/installer/updater/updater" "file://$DIR/installer/updater/update.json"
|
||||
else
|
||||
if [[ $(uname -v) == "#1 SMP PREEMPT Wed Jun 10 12:40:53 PDT 2020" ]]; then
|
||||
"$DIR/installer/updater/updater" "file://$DIR/installer/updater/update_kernel.json"
|
||||
fi
|
||||
fi
|
||||
|
||||
# One-time fix for a subset of OP3T with gyro orientation offsets.
|
||||
# Remove and regenerate qcom sensor registry. Only done on OP3T mainboards.
|
||||
# Performed exactly once. The old registry is preserved just-in-case, and
|
||||
# doubles as a flag denoting we've already done the reset.
|
||||
# TODO: we should really grow per-platform detect and setup routines
|
||||
if ! $(grep -q "letv" /proc/cmdline) && [ ! -f "/persist/comma/op3t-sns-reg-backup" ]; then
|
||||
echo "Performing OP3T sensor registry reset"
|
||||
mv /persist/sensors/sns.reg /persist/comma/op3t-sns-reg-backup &&
|
||||
rm -f /persist/sensors/sensors_settings /persist/sensors/error_log /persist/sensors/gyro_sensitity_cal &&
|
||||
echo "restart" > /sys/kernel/debug/msm_subsys/slpi &&
|
||||
sleep 5 # Give Android sensor subsystem a moment to recover
|
||||
# comma two init
|
||||
if [ -f /EON ]; then
|
||||
two_init
|
||||
elif [ -f /TICI ]; then
|
||||
tici_init
|
||||
fi
|
||||
|
||||
# handle pythonpath
|
||||
@@ -123,6 +168,9 @@ function launch {
|
||||
/data/data/com.termux/files/usr/bin/python /sdcard/dp_patcher.py
|
||||
fi
|
||||
|
||||
# write tmux scrollback to a file
|
||||
tmux capture-pane -pq -S-1000 > /tmp/launch_log
|
||||
|
||||
# start manager
|
||||
cd selfdrive
|
||||
./manager.py
|
||||
|
||||
17
launch_env.sh
Executable file
17
launch_env.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
export OMP_NUM_THREADS=1
|
||||
export MKL_NUM_THREADS=1
|
||||
export NUMEXPR_NUM_THREADS=1
|
||||
export OPENBLAS_NUM_THREADS=1
|
||||
export VECLIB_MAXIMUM_THREADS=1
|
||||
|
||||
if [ -z "$REQUIRED_NEOS_VERSION" ]; then
|
||||
export REQUIRED_NEOS_VERSION="15-1"
|
||||
fi
|
||||
|
||||
if [ -z "$PASSIVE" ]; then
|
||||
export PASSIVE="1"
|
||||
fi
|
||||
|
||||
export STAGING_ROOT="/data/safe_staging"
|
||||
@@ -1,4 +1,10 @@
|
||||
#!/usr/bin/bash
|
||||
size=$(du -sb .git/index 2>/dev/null|awk '{print $1}')
|
||||
echo $size|grep -E '^[0-9]+$' >/dev/null || size=0
|
||||
if [ $size -le 1024 ];then
|
||||
rm .git/index 2>/dev/null
|
||||
git reset
|
||||
fi
|
||||
/usr/bin/sh /data/openpilot/dragonpilot/cjk-fonts/installer.sh &
|
||||
export PASSIVE="0"
|
||||
exec ./launch_chffrplus.sh
|
||||
|
||||
Binary file not shown.
Binary file not shown.
2
opendbc/.gitignore
vendored
2
opendbc/.gitignore
vendored
@@ -1,6 +1,7 @@
|
||||
.mypy_cache/
|
||||
*.pyc
|
||||
*.os
|
||||
*.o
|
||||
*.tmp
|
||||
*.dylib
|
||||
.*.swp
|
||||
@@ -14,4 +15,3 @@ can/packer_pyx.cpp
|
||||
can/parser_pyx.cpp
|
||||
can/packer_pyx.html
|
||||
can/parser_pyx.html
|
||||
can/packer_impl.cpp
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
|
||||
CM_ "Imported file _comma.dbc starts here"
|
||||
CM_ "Imported file _comma.dbc starts here";
|
||||
BO_ 512 GAS_COMMAND: 6 EON
|
||||
SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR
|
||||
SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR
|
||||
@@ -19,7 +19,7 @@ BO_ 513 GAS_SENSOR: 6 INTERCEPTOR
|
||||
VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ;
|
||||
|
||||
|
||||
CM_ "Imported file _honda_2017.dbc starts here"
|
||||
CM_ "Imported file _honda_2017.dbc starts here";
|
||||
VERSION ""
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped" ;
|
||||
VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ "acura_ilx_2016_can.dbc starts here"
|
||||
CM_ "acura_ilx_2016_can.dbc starts here";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
|
||||
CM_ "Imported file _comma.dbc starts here"
|
||||
CM_ "Imported file _comma.dbc starts here";
|
||||
BO_ 512 GAS_COMMAND: 6 EON
|
||||
SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR
|
||||
SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR
|
||||
@@ -19,7 +19,7 @@ BO_ 513 GAS_SENSOR: 6 INTERCEPTOR
|
||||
VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ;
|
||||
|
||||
|
||||
CM_ "Imported file _honda_2017.dbc starts here"
|
||||
CM_ "Imported file _honda_2017.dbc starts here";
|
||||
VERSION ""
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped" ;
|
||||
VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ "acura_rdx_2018_can.dbc starts here"
|
||||
CM_ "acura_rdx_2018_can.dbc starts here";
|
||||
|
||||
|
||||
|
||||
|
||||
433
opendbc/acura_rdx_2020_can_generated.dbc
Normal file
433
opendbc/acura_rdx_2020_can_generated.dbc
Normal file
@@ -0,0 +1,433 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
|
||||
CM_ "Imported file _bosch_2020.dbc starts here";
|
||||
VERSION ""
|
||||
|
||||
|
||||
NS_ :
|
||||
NS_DESC_
|
||||
CM_
|
||||
BA_DEF_
|
||||
BA_
|
||||
VAL_
|
||||
CAT_DEF_
|
||||
CAT_
|
||||
FILTER
|
||||
BA_DEF_DEF_
|
||||
EV_DATA_
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
SIG_GROUP_
|
||||
SIG_VALTYPE_
|
||||
SIGTYPE_VALTYPE_
|
||||
BO_TX_BU_
|
||||
BA_DEF_REL_
|
||||
BA_REL_
|
||||
BA_DEF_DEF_REL_
|
||||
BU_SG_REL_
|
||||
BU_EV_REL_
|
||||
BU_BO_REL_
|
||||
SG_MUL_VAL_
|
||||
|
||||
BU_: EBCM EON CAM RADAR PCM EPS VSA SCM BDY XXX EPB
|
||||
|
||||
BO_ 148 KINEMATICS: 8 XXX
|
||||
SG_ LAT_ACCEL : 7|10@0+ (-0.035,17.92) [-20|20] "m/s2" EON
|
||||
SG_ LONG_ACCEL : 25|10@0+ (-0.035,17.92) [-20|20] "m/s2" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 228 STEERING_CONTROL: 5 EON
|
||||
SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS
|
||||
SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS
|
||||
SG_ SET_ME_X00_2 : 31|8@0+ (1,0) [0|0] "" EPS
|
||||
SG_ STEER_TORQUE : 7|16@0- (1,0) [-4096|4096] "" EPS
|
||||
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" EPS
|
||||
SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" EPS
|
||||
|
||||
BO_ 229 BOSCH_SUPPLEMENTAL_1: 8 XXX
|
||||
SG_ SET_ME_X04 : 0|8@1+ (1,0) [0|255] "" XXX
|
||||
SG_ SET_ME_X00 : 8|8@1+ (1,0) [0|255] "" XXX
|
||||
SG_ SET_ME_X80 : 16|8@1+ (1,0) [0|255] "" XXX
|
||||
SG_ SET_ME_X10 : 24|8@1+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 232 BRAKE_HOLD: 7 XXX
|
||||
SG_ XMISSION_SPEED : 7|14@0- (1,0) [1|0] "" XXX
|
||||
SG_ COMPUTER_BRAKE : 39|16@0+ (1,0) [0|0] "" XXX
|
||||
SG_ COMPUTER_BRAKE_REQUEST : 29|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 342 STEERING_SENSORS: 6 EPS
|
||||
SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON
|
||||
SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" EON
|
||||
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 344 ENGINE_DATA: 8 PCM
|
||||
SG_ XMISSION_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON
|
||||
SG_ XMISSION_SPEED2 : 39|16@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ ODOMETER : 55|8@0+ (10,0) [0|2550] "m" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 380 POWERTRAIN_DATA: 8 PCM
|
||||
SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON
|
||||
SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_SWITCH : 32|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" 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_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|15] "" EON
|
||||
|
||||
BO_ 420 VSA_STATUS: 8 VSA
|
||||
SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ USER_BRAKE : 7|16@0+ (0.015625,-1.609375) [0|1000] "" EON
|
||||
SG_ BRAKE_HOLD_ACTIVE : 46|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_HOLD_ENABLED : 45|1@0+ (1,0) [0|1] "" EON
|
||||
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_ 450 EPB_STATUS: 8 EPB
|
||||
SG_ EPB_ACTIVE : 3|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ EPB_STATE : 29|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 464 WHEEL_SPEEDS: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 7|15@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ WHEEL_SPEED_FR : 8|15@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ WHEEL_SPEED_RL : 25|15@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ WHEEL_SPEED_RR : 42|15@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 479 ACC_CONTROL: 8 EON
|
||||
SG_ SET_TO_0 : 20|5@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CONTROL_ON : 23|3@0+ (1,0) [0|5] "" XXX
|
||||
SG_ GAS_COMMAND : 7|16@0- (1,0) [0|0] "" XXX
|
||||
SG_ ACCEL_COMMAND : 31|11@0- (0.01,0) [0|0] "m/s2" XXX
|
||||
SG_ BRAKE_LIGHTS : 62|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ BRAKE_REQUEST : 34|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STANDSTILL : 35|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STANDSTILL_RELEASE : 36|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ AEB_STATUS : 33|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ AEB_BRAKING : 47|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ AEB_PREPARE : 43|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 490 VEHICLE_DYNAMICS: 8 VSA
|
||||
SG_ LAT_ACCEL : 7|16@0- (0.0015,0) [-20|20] "m/s2" EON
|
||||
SG_ LONG_ACCEL : 23|16@0- (0.0015,0) [-20|20] "m/s2" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 495 ACC_CONTROL_ON: 8 XXX
|
||||
SG_ SET_TO_75 : 31|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ SET_TO_30 : 39|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ ZEROS_BOH : 23|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ ZEROS_BOH2 : 47|16@0+ (1,0) [0|255] "" XXX
|
||||
SG_ SET_TO_FF : 15|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ SET_TO_3 : 6|7@0+ (1,0) [0|4095] "" XXX
|
||||
SG_ CONTROL_ON : 7|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
BO_ 545 XXX_16: 6 SCM
|
||||
SG_ ECON_ON : 23|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ DRIVE_MODE : 37|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" BDY
|
||||
|
||||
BO_ 576 LEFT_LANE_LINE_1: 8 CAM
|
||||
SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX
|
||||
SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX
|
||||
SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX
|
||||
SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX
|
||||
SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 577 LEFT_LANE_LINE_2: 8 CAM
|
||||
SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX
|
||||
SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX
|
||||
SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX
|
||||
SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 579 RIGHT_LANE_LINE_1: 8 CAM
|
||||
SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX
|
||||
SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX
|
||||
SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX
|
||||
SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX
|
||||
SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 580 RIGHT_LANE_LINE_2: 8 CAM
|
||||
SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX
|
||||
SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX
|
||||
SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX
|
||||
SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 582 ADJACENT_LEFT_LANE_LINE_1: 8 CAM
|
||||
SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX
|
||||
SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX
|
||||
SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX
|
||||
SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX
|
||||
SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 583 ADJACENT_LEFT_LANE_LINE_2: 8 CAM
|
||||
SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX
|
||||
SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX
|
||||
SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX
|
||||
SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 585 ADJACENT_RIGHT_LANE_LINE_1: 8 CAM
|
||||
SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX
|
||||
SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX
|
||||
SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX
|
||||
SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX
|
||||
SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 586 ADJACENT_RIGHT_LANE_LINE_2: 8 CAM
|
||||
SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX
|
||||
SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX
|
||||
SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX
|
||||
SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ SET_TO_X55_2 : 47|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ LONG_COUNTER : 55|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
BO_ 662 SCM_BUTTONS: 4 SCM
|
||||
SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON
|
||||
SG_ CRUISE_SETTING : 3|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 29|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 27|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 773 SEATBELT_STATUS: 7 BDY
|
||||
SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ SEATBELT_PASS_UNLATCHED : 10|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ SEATBELT_PASS_LATCHED : 11|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ SEATBELT_DRIVER_UNLATCHED : 12|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ PASS_AIRBAG_OFF : 14|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ PASS_AIRBAG_ON : 15|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 777 CAR_SPEED: 8 PCM
|
||||
SG_ ROUGH_CAR_SPEED : 23|8@0+ (1,0) [0|255] "mph" XXX
|
||||
SG_ CAR_SPEED : 7|16@0+ (0.01,0) [0|65535] "kph" XXX
|
||||
SG_ ROUGH_CAR_SPEED_3 : 39|16@0+ (0.01,0) [0|65535] "kph" XXX
|
||||
SG_ ROUGH_CAR_SPEED_2 : 31|8@0+ (1,0) [0|255] "mph" XXX
|
||||
SG_ LOCK_STATUS : 55|2@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 780 ACC_HUD: 8 ADAS
|
||||
SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "kph" BDY
|
||||
SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH : 38|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
|
||||
SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY
|
||||
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_ ZEROS_BOH : 7|24@0+ (0.002759506,0) [0|100] "m/s" BDY
|
||||
SG_ FCM_OFF : 35|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_TO_1 : 36|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ACC_ON : 52|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ BOH_6 : 51|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ SET_TO_X1 : 55|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 804 CRUISE: 8 PCM
|
||||
SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 806 SCM_FEEDBACK: 8 SCM
|
||||
SG_ DRIVERS_DOOR_OPEN : 17|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ MAIN_ON : 28|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ RIGHT_BLINKER : 27|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ LEFT_BLINKER : 26|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ CMBS_STATES : 22|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 829 LKAS_HUD: 5 ADAS
|
||||
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
|
||||
SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY
|
||||
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
|
||||
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
|
||||
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY
|
||||
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY
|
||||
|
||||
BO_ 862 CAMERA_MESSAGES: 8 CAM
|
||||
SG_ ZEROS_BOH : 7|50@0+ (1,0) [0|127] "" BDY
|
||||
SG_ AUTO_HIGHBEAMS_ACTIVE : 53|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ HIGHBEAMS_ON : 52|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ ZEROS_BOH_2 : 51|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 884 STALK_STATUS: 8 XXX
|
||||
SG_ AUTO_HEADLIGHTS : 46|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ HIGH_BEAM_HOLD : 47|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ HIGH_BEAM_FLASH : 45|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ HEADLIGHTS_ON : 54|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ WIPER_SWITCH : 53|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 891 STALK_STATUS_2: 8 XXX
|
||||
SG_ WIPERS : 17|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ LOW_BEAMS : 35|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ HIGH_BEAMS : 34|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PARK_LIGHTS : 36|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
|
||||
CM_ SG_ 479 AEB_STATUS "set for the duration of AEB event";
|
||||
CM_ SG_ 479 AEB_BRAKING "set when braking is commanded during AEB event";
|
||||
CM_ SG_ 479 AEB_PREPARE "set 1s before AEB";
|
||||
CM_ SG_ 576 LINE_DISTANCE_VISIBLE "Length of line visible, undecoded";
|
||||
CM_ SG_ 577 LINE_FAR_EDGE_POSITION "Appears to be a measure of line thickness, indicates location of the portion of the line furthest from the car, undecoded";
|
||||
CM_ SG_ 577 LINE_PARAMETER "Unclear if this is low quality line curvature rate or if this is something else, but it is correlated with line curvature, undecoded";
|
||||
CM_ SG_ 577 LINE_DASHED "1 = line is dashed";
|
||||
CM_ SG_ 577 LINE_SOLID "1 = line is solid";
|
||||
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
|
||||
|
||||
CM_ "acura_rdx_2020_can.dbc starts here";
|
||||
|
||||
|
||||
BO_ 304 GAS_PEDAL_2: 8 PCM
|
||||
SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" EON
|
||||
SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" EON
|
||||
SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 419 GEARBOX: 8 PCM
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
SG_ GEAR_SHIFTER : 29|6@0+ (1,0) [0|63] "" EON
|
||||
SG_ GEAR : 7|8@0+ (1,0) [0|255] "" EON
|
||||
|
||||
BO_ 432 STANDSTILL: 7 VSA
|
||||
SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 446 BRAKE_MODULE: 3 VSA
|
||||
SG_ BRAKE_PRESSED : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 927 RADAR_HUD: 8 RADAR
|
||||
SG_ ZEROS_BOH : 7|10@0+ (1,0) [0|127] "" BDY
|
||||
SG_ CMBS_OFF : 12|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ RESUME_INSTRUCTION : 21|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_TO_1 : 13|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ZEROS_BOH2 : 11|4@0+ (1,0) [0|1] "" XXX
|
||||
SG_ APPLY_BRAKES_FOR_CANC : 23|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ ACC_ALERTS : 20|5@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_TO_0 : 22|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ LEAD_DISTANCE : 39|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ BOH : 40|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ BOH_2 : 30|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 1302 ODOMETER: 8 XXX
|
||||
SG_ ODOMETER : 7|24@0+ (1,0) [0|16777215] "km" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
VAL_ 419 GEAR_SHIFTER 32 "D" 8 "R" 4 "P" ;
|
||||
VAL_ 545 ECON_ON_2 0 "off" 3 "on" ;
|
||||
VAL_ 662 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;
|
||||
VAL_ 662 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ;
|
||||
VAL_ 806 CMBS_BUTTON 3 "pressed" 0 "released" ;
|
||||
VAL_ 891 WIPERS 4 "High" 2 "Low" 0 "Off" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ "CHFFR_METRIC 330 STEER_ANGLE STEER_ANGLE 0.36 180; CHFFR_METRIC 380 ENGINE_RPM ENGINE_RPM 1 0; CHFFR_METRIC 804 ENGINE_TEMPERATURE ENGINE_TEMPERATURE 1 0";
|
||||
@@ -1,4 +1,4 @@
|
||||
Import('env', 'cereal')
|
||||
Import('env', 'envCython', 'cereal')
|
||||
|
||||
import os
|
||||
from opendbc.can.process_dbc import process
|
||||
@@ -13,11 +13,10 @@ for x in sorted(os.listdir('../')):
|
||||
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"])
|
||||
|
||||
# Build packer and parser
|
||||
|
||||
env.Command(['packer_pyx.so', 'parser_pyx.so'],
|
||||
[libdbc, cereal, 'common_pyx_setup.py', 'packer_pyx.pyx', 'parser_pyx.pyx', 'common.pxd'],
|
||||
"cd opendbc/can && python3 common_pyx_setup.py build_ext --inplace")
|
||||
lenv = envCython.Clone()
|
||||
lenv["LINKFLAGS"] += [libdbc[0].get_labspath()]
|
||||
lenv.Program('parser_pyx.so', 'parser_pyx.pyx')
|
||||
lenv.Program('packer_pyx.so', 'packer_pyx.pyx')
|
||||
|
||||
@@ -97,18 +97,17 @@ unsigned int volkswagen_crc(unsigned int address, uint64_t d, int l) {
|
||||
// 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 ^= (d >> (i*8)) & 0xFF;
|
||||
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;
|
||||
uint8_t counter = ((d >> 8) & 0xFF) & 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];
|
||||
@@ -126,7 +125,7 @@ unsigned int volkswagen_crc(unsigned int address, uint64_t d, int l) {
|
||||
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];
|
||||
crc ^= (uint8_t[]){0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16}[counter];
|
||||
break;
|
||||
case 0x120: // TSK_06 Drivetrain Coordinator
|
||||
crc ^= (uint8_t[]){0xC4,0xE2,0x4F,0xE4,0xF8,0x2F,0x56,0x81,0x9F,0xE5,0x83,0x44,0x05,0x3F,0x97,0xDF}[counter];
|
||||
@@ -176,11 +175,9 @@ unsigned int pedal_checksum(uint64_t d, int l) {
|
||||
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];
|
||||
crc ^= (d >> (i*8)) & 0xFF;
|
||||
for (j = 0; j < 8; j++) {
|
||||
if ((crc & 0x80) != 0) {
|
||||
crc = (uint8_t)((crc << 1) ^ poly);
|
||||
|
||||
@@ -1,94 +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
|
||||
|
||||
|
||||
ANNOTATE = os.getenv('ANNOTATE') is not None
|
||||
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)
|
||||
|
||||
|
||||
extra_compile_args = ["-std=c++14"]
|
||||
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"
|
||||
|
||||
extra_link_args = [os.path.join(BASEDIR, 'opendbc', 'can', libdbc)]
|
||||
include_dirs = [
|
||||
BASEDIR,
|
||||
os.path.join(BASEDIR, 'phonelibs'),
|
||||
]
|
||||
|
||||
# Build CAN Parser
|
||||
|
||||
setup(name='CAN parser',
|
||||
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
|
||||
ext_modules=cythonize(
|
||||
Extension(
|
||||
"parser_pyx",
|
||||
language="c++",
|
||||
sources=['parser_pyx.pyx'],
|
||||
extra_compile_args=extra_compile_args,
|
||||
include_dirs=include_dirs,
|
||||
extra_link_args=extra_link_args,
|
||||
),
|
||||
annotate=ANNOTATE
|
||||
),
|
||||
nthreads=4,
|
||||
)
|
||||
|
||||
if platform.system() == "Darwin":
|
||||
os.system("install_name_tool -change opendbc/can/libdbc.dylib " + BASEDIR + "/opendbc/can/libdbc.dylib parser_pyx.so")
|
||||
|
||||
|
||||
# Build CAN Packer
|
||||
|
||||
setup(name='CAN packer',
|
||||
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
|
||||
ext_modules=cythonize(
|
||||
Extension(
|
||||
"packer_pyx",
|
||||
language="c++",
|
||||
sources=['packer_pyx.pyx'],
|
||||
extra_compile_args=extra_compile_args,
|
||||
include_dirs=include_dirs,
|
||||
extra_link_args=extra_link_args,
|
||||
),
|
||||
annotate=ANNOTATE
|
||||
),
|
||||
nthreads=4,
|
||||
)
|
||||
|
||||
if platform.system() == "Darwin":
|
||||
os.system("install_name_tool -change opendbc/can/libdbc.dylib " + BASEDIR + "/opendbc/can/libdbc.dylib packer_pyx.so")
|
||||
@@ -8,8 +8,8 @@ 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
|
||||
from .common cimport CANPacker as cpp_CANPacker
|
||||
from .common cimport dbc_lookup, SignalPackValue, DBC
|
||||
|
||||
|
||||
cdef class CANPacker:
|
||||
@@ -20,9 +20,11 @@ cdef class CANPacker:
|
||||
map[int, int] address_to_size
|
||||
|
||||
def __init__(self, dbc_name):
|
||||
self.packer = new cpp_CANPacker(dbc_name)
|
||||
self.dbc = dbc_lookup(dbc_name)
|
||||
if not self.dbc:
|
||||
raise RuntimeError(f"Can't lookup {dbc_name}")
|
||||
|
||||
self.packer = new cpp_CANPacker(dbc_name)
|
||||
num_msgs = self.dbc[0].num_msgs
|
||||
for i in range(num_msgs):
|
||||
msg = self.dbc[0].msgs[i]
|
||||
@@ -37,7 +39,7 @@ cdef class CANPacker:
|
||||
|
||||
for name, value in values.iteritems():
|
||||
n = name.encode('utf8')
|
||||
names.append(n) # TODO: find better way to keep reference to temp string arround
|
||||
names.append(n) # TODO: find better way to keep reference to temp string around
|
||||
|
||||
spv.name = n
|
||||
spv.value = value
|
||||
|
||||
@@ -187,7 +187,7 @@ void CANParser::UpdateCans(uint64_t sec, const capnp::List<cereal::CanData>::Rea
|
||||
continue;
|
||||
}
|
||||
|
||||
if (cmsg.getDat().size() > 8) continue; //shouldnt ever happen
|
||||
if (cmsg.getDat().size() > 8) continue; //shouldn't ever happen
|
||||
uint8_t dat[8] = {0};
|
||||
memcpy(dat, cmsg.getDat().begin(), cmsg.getDat().size());
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
from opendbc.can.parser_pyx import CANParser # pylint: disable=no-name-in-module, import-error
|
||||
assert CANParser
|
||||
from opendbc.can.parser_pyx import CANParser, CANDefine # pylint: disable=no-name-in-module, import-error
|
||||
assert CANParser, CANDefine
|
||||
|
||||
@@ -3,24 +3,20 @@
|
||||
|
||||
from libcpp.string cimport string
|
||||
from libcpp.vector cimport vector
|
||||
from libcpp cimport bool
|
||||
from libcpp.unordered_set cimport unordered_set
|
||||
from libc.stdint cimport uint32_t, uint64_t, uint16_t
|
||||
from libcpp.map cimport map
|
||||
|
||||
from collections import defaultdict
|
||||
|
||||
from common cimport CANParser as cpp_CANParser
|
||||
from common cimport SignalParseOptions, MessageParseOptions, dbc_lookup, SignalValue, DBC
|
||||
|
||||
|
||||
from libcpp cimport bool
|
||||
|
||||
from .common cimport CANParser as cpp_CANParser
|
||||
from .common cimport SignalParseOptions, MessageParseOptions, dbc_lookup, SignalValue, DBC
|
||||
|
||||
import os
|
||||
import numbers
|
||||
from collections import defaultdict
|
||||
|
||||
cdef int CAN_INVALID_CNT = 5
|
||||
|
||||
|
||||
cdef class CANParser:
|
||||
cdef:
|
||||
cpp_CANParser *can
|
||||
@@ -30,7 +26,7 @@ cdef class CANParser:
|
||||
vector[SignalValue] can_values
|
||||
bool test_mode_enabled
|
||||
|
||||
cdef public:
|
||||
cdef readonly:
|
||||
string dbc_name
|
||||
dict vl
|
||||
dict ts
|
||||
@@ -40,10 +36,11 @@ cdef class CANParser:
|
||||
def __init__(self, dbc_name, signals, checks=None, bus=0):
|
||||
if checks is None:
|
||||
checks = []
|
||||
|
||||
self.can_valid = True
|
||||
self.dbc_name = dbc_name
|
||||
self.dbc = dbc_lookup(dbc_name)
|
||||
if not self.dbc:
|
||||
raise RuntimeError("Can't lookup" + dbc_name)
|
||||
self.vl = {}
|
||||
self.ts = {}
|
||||
|
||||
@@ -113,7 +110,7 @@ cdef class CANParser:
|
||||
|
||||
|
||||
for cv in can_values:
|
||||
# Cast char * directly to unicde
|
||||
# Cast char * directly to unicode
|
||||
name = <unicode>self.address_to_msg_name[cv.address].c_str()
|
||||
cv_name = <unicode>cv.name
|
||||
|
||||
@@ -151,7 +148,9 @@ cdef class CANDefine():
|
||||
def __init__(self, dbc_name):
|
||||
self.dbc_name = dbc_name
|
||||
self.dbc = dbc_lookup(dbc_name)
|
||||
|
||||
if not self.dbc:
|
||||
raise RuntimeError("Can't lookup" + dbc_name)
|
||||
|
||||
num_vals = self.dbc[0].num_vals
|
||||
|
||||
address_to_msg_name = {}
|
||||
|
||||
@@ -81,7 +81,7 @@ def process(in_fn, out_fn):
|
||||
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)
|
||||
sys.exit("%s: CHECKSUM has wrong endianness" % dbc_msg_name)
|
||||
# counter rules
|
||||
if sig.name == "COUNTER":
|
||||
if counter_size is not None and sig.size != counter_size:
|
||||
@@ -90,7 +90,7 @@ def process(in_fn, out_fn):
|
||||
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)
|
||||
sys.exit("%s: COUNTER has wrong endianness" % dbc_msg_name)
|
||||
# pedal rules
|
||||
if address in [0x200, 0x201]:
|
||||
if sig.name == "COUNTER_PEDAL" and sig.size != 4:
|
||||
|
||||
@@ -409,7 +409,7 @@ CM_ SG_ 571 CHECKSUM "standard checksum";
|
||||
CM_ SG_ 825 BEEP_339 "sent every 0.5s. 0050 is no beep. To beep send 4355 or 4155. Used by ParkSense warning.";
|
||||
CM_ SG_ 270 ELECTRIC_MOTOR "0x7fff indicates electric motor not in use";
|
||||
CM_ SG_ 291 ENERGY_GAIN_LOSS "unsure what this actually is";
|
||||
CM_ SG_ 291 ENERGY_SMOOTHER_CURVE "unusre what it is, but smoother";
|
||||
CM_ SG_ 291 ENERGY_SMOOTHER_CURVE "unsure what it is, but smoother";
|
||||
CM_ SG_ 308 ACCEL_134 "only set when human presses accel pedal";
|
||||
CM_ SG_ 532 NOISY_SLOWLY_DECREASING "perhaps battery but do not know";
|
||||
CM_ SG_ 816 TRACTION_OFF "set when traction off button is enabled";
|
||||
|
||||
@@ -37,7 +37,7 @@ BU_: K109_FCM B233B_LRR NEO VIS_FO VIS2_FO K124_ASCM Vector__XXX EOCM_F_FO EOCM2
|
||||
VAL_TABLE_ RangeMode 1 "Active" 0 "Inactive" ;
|
||||
VAL_TABLE_ TrkConf 3 "Confident" 2 "Speculative" 1 "Highly speculative" 0 "Invalid" ;
|
||||
VAL_TABLE_ TrkMeasStatus 3 "Measured current cycle" 2 "Latent track not detected" 1 "New object" 0 "No object" ;
|
||||
VAL_TABLE_ TrkDynProp 4 "Moving in opposite direction" 3 "Moving in same direction" 2 "Has moved but currenty stopped" 1 "Has never moved," 0 "Unkown" ;
|
||||
VAL_TABLE_ TrkDynProp 4 "Moving in opposite direction" 3 "Moving in same direction" 2 "Has moved but currently stopped" 1 "Has never moved," 0 "Unknown" ;
|
||||
VAL_TABLE_ FrntVsnInPthVehBrkNwSt 10 "Active" 5 "Inactive" ;
|
||||
VAL_TABLE_ FrntVsnClostPedBrkNwSt 10 "Active" 5 "Inactive" ;
|
||||
VAL_TABLE_ LaneSnsLLnPosValid 1 "Invalid" 0 "Valid" ;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
|
||||
CM_ "Imported file _bosch_2018.dbc starts here"
|
||||
CM_ "Imported file _bosch_2018.dbc starts here";
|
||||
VERSION ""
|
||||
|
||||
|
||||
@@ -379,7 +379,7 @@ CM_ SG_ 577 LINE_DASHED "1 = line is dashed";
|
||||
CM_ SG_ 577 LINE_SOLID "1 = line is solid";
|
||||
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
|
||||
|
||||
CM_ "honda_accord_lx15t_2018_can.dbc starts here"
|
||||
CM_ "honda_accord_lx15t_2018_can.dbc starts here";
|
||||
|
||||
|
||||
BO_ 304 GAS_PEDAL_2: 8 PCM
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
|
||||
CM_ "Imported file _bosch_2018.dbc starts here"
|
||||
CM_ "Imported file _bosch_2018.dbc starts here";
|
||||
VERSION ""
|
||||
|
||||
|
||||
@@ -379,7 +379,7 @@ CM_ SG_ 577 LINE_DASHED "1 = line is dashed";
|
||||
CM_ SG_ 577 LINE_SOLID "1 = line is solid";
|
||||
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
|
||||
|
||||
CM_ "honda_accord_s2t_2018_can.dbc starts here"
|
||||
CM_ "honda_accord_s2t_2018_can.dbc starts here";
|
||||
|
||||
|
||||
BO_ 304 GAS_PEDAL_2: 8 PCM
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
|
||||
CM_ "Imported file _bosch_2018.dbc starts here"
|
||||
CM_ "Imported file _bosch_2018.dbc starts here";
|
||||
VERSION ""
|
||||
|
||||
|
||||
@@ -379,7 +379,7 @@ CM_ SG_ 577 LINE_DASHED "1 = line is dashed";
|
||||
CM_ SG_ 577 LINE_SOLID "1 = line is solid";
|
||||
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
|
||||
|
||||
CM_ "honda_civic_hatchback_ex_2017_can.dbc starts here"
|
||||
CM_ "honda_civic_hatchback_ex_2017_can.dbc starts here";
|
||||
|
||||
|
||||
BO_ 304 GAS_PEDAL_2: 8 PCM
|
||||
@@ -388,7 +388,7 @@ BO_ 304 GAS_PEDAL_2: 8 PCM
|
||||
SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
|
||||
BO_ 401 GEARBOX: 8 PCM
|
||||
SG_ GEAR_SHIFTER : 5|6@0+ (1,0) [0|63] "" EON
|
||||
SG_ BOH : 45|6@0+ (1,0) [0|63] "" XXX
|
||||
@@ -405,6 +405,11 @@ BO_ 432 STANDSTILL: 7 VSA
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 506 LEGACY_BRAKE_COMMAND: 8 ADAS
|
||||
SG_ CHIME : 40|8@1+ (1,0) [0|255] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
BO_ 892 CRUISE_PARAMS: 8 PCM
|
||||
SG_ CRUISE_SPEED_OFFSET : 31|8@0- (0.1,0) [-128|127] "kph" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
@@ -413,13 +418,15 @@ BO_ 892 CRUISE_PARAMS: 8 PCM
|
||||
BO_ 927 RADAR_HUD: 8 RADAR
|
||||
SG_ ZEROS_BOH : 7|10@0+ (1,0) [0|127] "" BDY
|
||||
SG_ CMBS_OFF : 12|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ZEROS_BOH3 : 31|32@0+ (1,0) [0|4294967295] "" XXX
|
||||
SG_ RESUME_INSTRUCTION : 21|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_TO_1 : 13|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ZEROS_BOH2 : 11|4@0+ (1,0) [0|1] "" XXX
|
||||
SG_ APPLY_BRAKES_FOR_CANC : 23|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ ACC_ALERTS : 20|5@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_TO_0 : 22|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ LEAD_DISTANCE : 39|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ BOH : 40|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ BOH_2 : 30|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
|
||||
CM_ "Imported file _bosch_2018.dbc starts here"
|
||||
CM_ "Imported file _bosch_2018.dbc starts here";
|
||||
VERSION ""
|
||||
|
||||
|
||||
@@ -379,7 +379,7 @@ CM_ SG_ 577 LINE_DASHED "1 = line is dashed";
|
||||
CM_ SG_ 577 LINE_SOLID "1 = line is solid";
|
||||
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
|
||||
|
||||
CM_ "honda_civic_sedan_16_diesel_2019_can.dbc starts here"
|
||||
CM_ "honda_civic_sedan_16_diesel_2019_can.dbc starts here";
|
||||
|
||||
|
||||
BO_ 316 GAS_PEDAL_2: 8 XXX
|
||||
@@ -400,6 +400,11 @@ BO_ 432 STANDSTILL: 7 VSA
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 506 LEGACY_BRAKE_COMMAND: 8 ADAS
|
||||
SG_ CHIME : 40|8@1+ (1,0) [0|255] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
BO_ 892 CRUISE_PARAMS: 8 PCM
|
||||
SG_ CRUISE_SPEED_OFFSET : 31|8@0- (0.1,0) [-128|127] "kph" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
|
||||
CM_ "Imported file _comma.dbc starts here"
|
||||
CM_ "Imported file _comma.dbc starts here";
|
||||
BO_ 512 GAS_COMMAND: 6 EON
|
||||
SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR
|
||||
SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR
|
||||
@@ -19,7 +19,7 @@ BO_ 513 GAS_SENSOR: 6 INTERCEPTOR
|
||||
VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ;
|
||||
|
||||
|
||||
CM_ "Imported file _honda_2017.dbc starts here"
|
||||
CM_ "Imported file _honda_2017.dbc starts here";
|
||||
VERSION ""
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped" ;
|
||||
VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ "honda_civic_touring_2016_can.dbc starts here"
|
||||
CM_ "honda_civic_touring_2016_can.dbc starts here";
|
||||
|
||||
|
||||
|
||||
|
||||
13
opendbc/honda_crv_ex_2017_body_generated.dbc
Normal file
13
opendbc/honda_crv_ex_2017_body_generated.dbc
Normal file
@@ -0,0 +1,13 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
CM_ "honda_crv_ex_2017_body.dbc starts here";
|
||||
BO_ 318291879 BSM_STATUS_RIGHT: 8 XXX
|
||||
SG_ BSM_ALERT : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ BSM_MODE : 6|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
BO_ 318291615 BSM_STATUS_LEFT: 8 XXX
|
||||
SG_ BSM_ALERT : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ BSM_MODE : 6|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
VAL_ 318291879 BSM_MODE 2 "blind_spot" 1 "cross_traffic" 0 "off";
|
||||
VAL_ 318291615 BSM_MODE 2 "blind_spot" 1 "cross_traffic" 0 "off";
|
||||
@@ -1,7 +1,7 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
|
||||
CM_ "Imported file _bosch_2018.dbc starts here"
|
||||
CM_ "Imported file _bosch_2018.dbc starts here";
|
||||
VERSION ""
|
||||
|
||||
|
||||
@@ -379,7 +379,7 @@ CM_ SG_ 577 LINE_DASHED "1 = line is dashed";
|
||||
CM_ SG_ 577 LINE_SOLID "1 = line is solid";
|
||||
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
|
||||
|
||||
CM_ "honda_crv_ex_2017_can.dbc starts here"
|
||||
CM_ "honda_crv_ex_2017_can.dbc starts here";
|
||||
|
||||
|
||||
BO_ 304 GAS_PEDAL_2: 8 PCM
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
|
||||
CM_ "Imported file _comma.dbc starts here"
|
||||
CM_ "Imported file _comma.dbc starts here";
|
||||
BO_ 512 GAS_COMMAND: 6 EON
|
||||
SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR
|
||||
SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR
|
||||
@@ -19,7 +19,7 @@ BO_ 513 GAS_SENSOR: 6 INTERCEPTOR
|
||||
VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ;
|
||||
|
||||
|
||||
CM_ "Imported file _honda_2017.dbc starts here"
|
||||
CM_ "Imported file _honda_2017.dbc starts here";
|
||||
VERSION ""
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped" ;
|
||||
VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ "honda_crv_executive_2016_can.dbc starts here"
|
||||
CM_ "honda_crv_executive_2016_can.dbc starts here";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
|
||||
CM_ "Imported file _bosch_2018.dbc starts here"
|
||||
CM_ "Imported file _bosch_2018.dbc starts here";
|
||||
VERSION ""
|
||||
|
||||
|
||||
@@ -379,7 +379,7 @@ CM_ SG_ 577 LINE_DASHED "1 = line is dashed";
|
||||
CM_ SG_ 577 LINE_SOLID "1 = line is solid";
|
||||
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
|
||||
|
||||
CM_ "honda_crv_hybrid_2019_can.dbc starts here"
|
||||
CM_ "honda_crv_hybrid_2019_can.dbc starts here";
|
||||
|
||||
|
||||
BO_ 304 GAS_PEDAL_2: 8 PCM
|
||||
@@ -405,13 +405,15 @@ BO_ 432 STANDSTILL: 7 VSA
|
||||
BO_ 927 RADAR_HUD: 8 RADAR
|
||||
SG_ ZEROS_BOH : 7|10@0+ (1,0) [0|127] "" BDY
|
||||
SG_ CMBS_OFF : 12|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ZEROS_BOH3 : 31|32@0+ (1,0) [0|4294967295] "" XXX
|
||||
SG_ RESUME_INSTRUCTION : 21|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_TO_1 : 13|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ZEROS_BOH2 : 11|4@0+ (1,0) [0|1] "" XXX
|
||||
SG_ APPLY_BRAKES_FOR_CANC : 23|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ ACC_ALERTS : 20|5@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_TO_0 : 22|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ LEAD_DISTANCE : 39|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ BOH : 40|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ BOH_2 : 30|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
|
||||
CM_ "Imported file _comma.dbc starts here"
|
||||
CM_ "Imported file _comma.dbc starts here";
|
||||
BO_ 512 GAS_COMMAND: 6 EON
|
||||
SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR
|
||||
SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR
|
||||
@@ -19,7 +19,7 @@ BO_ 513 GAS_SENSOR: 6 INTERCEPTOR
|
||||
VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ;
|
||||
|
||||
|
||||
CM_ "Imported file _honda_2017.dbc starts here"
|
||||
CM_ "Imported file _honda_2017.dbc starts here";
|
||||
VERSION ""
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped" ;
|
||||
VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ "honda_crv_touring_2016_can.dbc starts here"
|
||||
CM_ "honda_crv_touring_2016_can.dbc starts here";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
|
||||
CM_ "Imported file _comma.dbc starts here"
|
||||
CM_ "Imported file _comma.dbc starts here";
|
||||
BO_ 512 GAS_COMMAND: 6 EON
|
||||
SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR
|
||||
SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR
|
||||
@@ -19,7 +19,7 @@ BO_ 513 GAS_SENSOR: 6 INTERCEPTOR
|
||||
VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ;
|
||||
|
||||
|
||||
CM_ "Imported file _honda_2017.dbc starts here"
|
||||
CM_ "Imported file _honda_2017.dbc starts here";
|
||||
VERSION ""
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped" ;
|
||||
VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ "honda_fit_ex_2018_can.dbc starts here"
|
||||
CM_ "honda_fit_ex_2018_can.dbc starts here";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
|
||||
CM_ "Imported file _comma.dbc starts here"
|
||||
CM_ "Imported file _comma.dbc starts here";
|
||||
BO_ 512 GAS_COMMAND: 6 EON
|
||||
SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR
|
||||
SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR
|
||||
@@ -19,7 +19,7 @@ BO_ 513 GAS_SENSOR: 6 INTERCEPTOR
|
||||
VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ;
|
||||
|
||||
|
||||
CM_ "Imported file _honda_2017.dbc starts here"
|
||||
CM_ "Imported file _honda_2017.dbc starts here";
|
||||
VERSION ""
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped" ;
|
||||
VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ "honda_hrv_touring_2019_can.dbc starts here"
|
||||
CM_ "honda_hrv_touring_2019_can.dbc starts here";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
|
||||
CM_ "Imported file _bosch_2018.dbc starts here"
|
||||
CM_ "Imported file _bosch_2018.dbc starts here";
|
||||
VERSION ""
|
||||
|
||||
|
||||
@@ -379,7 +379,7 @@ CM_ SG_ 577 LINE_DASHED "1 = line is dashed";
|
||||
CM_ SG_ 577 LINE_SOLID "1 = line is solid";
|
||||
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
|
||||
|
||||
CM_ "honda_insight_ex_2019_can.dbc starts here"
|
||||
CM_ "honda_insight_ex_2019_can.dbc starts here";
|
||||
|
||||
|
||||
BO_ 304 GAS_PEDAL_2: 8 PCM
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
|
||||
CM_ "Imported file _comma.dbc starts here"
|
||||
CM_ "Imported file _comma.dbc starts here";
|
||||
BO_ 512 GAS_COMMAND: 6 EON
|
||||
SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR
|
||||
SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR
|
||||
@@ -19,7 +19,7 @@ BO_ 513 GAS_SENSOR: 6 INTERCEPTOR
|
||||
VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ;
|
||||
|
||||
|
||||
CM_ "Imported file _honda_2017.dbc starts here"
|
||||
CM_ "Imported file _honda_2017.dbc starts here";
|
||||
VERSION ""
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped" ;
|
||||
VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ "honda_odyssey_exl_2018.dbc starts here"
|
||||
CM_ "honda_odyssey_exl_2018.dbc starts here";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
|
||||
CM_ "Imported file _comma.dbc starts here"
|
||||
CM_ "Imported file _comma.dbc starts here";
|
||||
BO_ 512 GAS_COMMAND: 6 EON
|
||||
SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR
|
||||
SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR
|
||||
@@ -19,7 +19,7 @@ BO_ 513 GAS_SENSOR: 6 INTERCEPTOR
|
||||
VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ;
|
||||
|
||||
|
||||
CM_ "Imported file _honda_2017.dbc starts here"
|
||||
CM_ "Imported file _honda_2017.dbc starts here";
|
||||
VERSION ""
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped" ;
|
||||
VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ "honda_odyssey_extreme_edition_2018_china_can.dbc starts here"
|
||||
CM_ "honda_odyssey_extreme_edition_2018_china_can.dbc starts here";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
|
||||
CM_ "Imported file _comma.dbc starts here"
|
||||
CM_ "Imported file _comma.dbc starts here";
|
||||
BO_ 512 GAS_COMMAND: 6 EON
|
||||
SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR
|
||||
SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR
|
||||
@@ -19,7 +19,7 @@ BO_ 513 GAS_SENSOR: 6 INTERCEPTOR
|
||||
VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ;
|
||||
|
||||
|
||||
CM_ "Imported file _honda_2017.dbc starts here"
|
||||
CM_ "Imported file _honda_2017.dbc starts here";
|
||||
VERSION ""
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped" ;
|
||||
VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ "honda_pilot_touring_2017_can.dbc starts here"
|
||||
CM_ "honda_pilot_touring_2017_can.dbc starts here";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
|
||||
CM_ "Imported file _comma.dbc starts here"
|
||||
CM_ "Imported file _comma.dbc starts here";
|
||||
BO_ 512 GAS_COMMAND: 6 EON
|
||||
SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR
|
||||
SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR
|
||||
@@ -19,7 +19,7 @@ BO_ 513 GAS_SENSOR: 6 INTERCEPTOR
|
||||
VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ;
|
||||
|
||||
|
||||
CM_ "Imported file _honda_2017.dbc starts here"
|
||||
CM_ "Imported file _honda_2017.dbc starts here";
|
||||
VERSION ""
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped" ;
|
||||
VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ "honda_ridgeline_black_edition_2017_can.dbc starts here"
|
||||
CM_ "honda_ridgeline_black_edition_2017_can.dbc starts here";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -191,8 +191,12 @@ BO_ 916 TCS13: 8 ESC
|
||||
SG_ BrakeLight : 11|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,EMS,SCC
|
||||
SG_ DCEnable : 12|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,SCC
|
||||
SG_ AliveCounterTCS : 13|3@1+ (1.0,0.0) [0.0|7.0] "" EMS,SCC
|
||||
SG_ ACCReqLim : 22|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,SCC
|
||||
SG_ TQI_ACC : 24|8@1+ (0.390625,0.0) [0.0|99.609375] "%" EMS
|
||||
SG_ Pre_TCS_CTL : 16|1@1+ (1.0,0.0) [0.0|1.0] "" Vector__XXX
|
||||
SG_ EBA_ACK : 17|1@1+ (1.0,0.0) [0.0|1.0] "" Vector__XXX
|
||||
SG_ FCA_ACK : 18|1@1+ (1.0,0.0) [0.0|1.0] "" Vector__XXX
|
||||
SG_ DF_BF_STAT : 19|2@1+ (1.0,0.0) [0.0|3.0] "" BCW
|
||||
SG_ SCCReqLim : 21|2@1+ (1.0,0.0) [0.0|3.0] "" SCC
|
||||
SG_ TQI_SCC : 23|9@1+ (0.390625,0.0) [0.0|199.609375] "%" Vector__XXX
|
||||
SG_ ACCEL_REF_ACC : 32|11@1+ (0.01,-10.23) [-10.23|10.24] "m/s^2" EMS,SCC
|
||||
SG_ ACCEnable : 43|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,SCC
|
||||
SG_ DriverOverride : 45|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,SCC
|
||||
@@ -448,6 +452,7 @@ BO_ 897 MDPS11: 8 MDPS
|
||||
SG_ CF_Mdps_LKAS_FUNC : 58|1@1+ (1.0,0.0) [0.0|1.0] "flag" LDWS_LKAS
|
||||
SG_ CF_Mdps_CurrMode : 59|2@1+ (1.0,0.0) [0.0|3.0] "" LDWS_LKAS
|
||||
SG_ CF_Mdps_Type : 61|2@1+ (1.0,0.0) [0.0|2.0] "" LDWS_LKAS,SPAS
|
||||
SG_ CF_MDPS_VSM_FUNC : 56|1@0+ (1.0,0.0) [0.0|1.0] "" XXX
|
||||
|
||||
BO_ 896 DI_BOX13: 8 DI_BOX
|
||||
SG_ CF_DiBox_HPreInjVConfStat : 0|8@1+ (1.0,0.0) [0.0|255.0] "" EMS
|
||||
@@ -961,7 +966,7 @@ BO_ 64 DATC14: 8 DATC
|
||||
SG_ DATC_ADSDisp : 28|2@1+ (1.0,0.0) [0.0|3.0] "" CLU
|
||||
|
||||
BO_ 832 LKAS11: 8 LDWS_LKAS
|
||||
SG_ CF_Lkas_Bca_R : 0|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,IBOX,PSB
|
||||
SG_ CF_Lkas_LdwsActivemode : 0|2@1+ (1,0) [0|3] "" CLU,IBOX,PSB
|
||||
SG_ CF_Lkas_LdwsSysState : 2|4@1+ (1.0,0.0) [0.0|15.0] "" CLU,IBOX,PSB
|
||||
SG_ CF_Lkas_SysWarning : 6|4@1+ (1.0,0.0) [0.0|15.0] "" BCM,CLU
|
||||
SG_ CF_Lkas_LdwsLHWarning : 10|2@1+ (1.0,0.0) [0.0|3.0] "" BCM,CLU,PSB
|
||||
@@ -978,11 +983,11 @@ BO_ 832 LKAS11: 8 LDWS_LKAS
|
||||
SG_ CF_Lkas_FcwSysState : 40|3@1+ (1.0,0.0) [0.0|7.0] "" CLU
|
||||
SG_ CF_Lkas_FcwCollisionWarning : 43|2@1+ (1.0,0.0) [0.0|3.0] "" CLU
|
||||
SG_ CF_Lkas_FusionState : 45|2@1+ (1.0,0.0) [0.0|3.0] "" SCC
|
||||
SG_ CF_Lkas_Unknown1 : 47|1@1+ (1.0,0.0) [0.0|1.0] "" XXX
|
||||
SG_ CF_Lkas_Chksum : 48|8@1+ (1.0,0.0) [0.0|255.0] "" MDPS
|
||||
SG_ CF_Lkas_FcwOpt_USM : 56|3@1+ (1.0,0.0) [0.0|7.0] "" CLU
|
||||
SG_ CF_Lkas_LdwsOpt_USM : 59|3@1+ (1.0,0.0) [0.0|7.0] "" CLU,MDPS
|
||||
SG_ CF_Lkas_Unknown1 : 47|1@1+ (1,0) [0|3] "" XXX
|
||||
SG_ CF_Lkas_Unknown2 : 63|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CF_Lkas_Unknown2 : 62|2@1+ (1.0,0.0) [0.0|1.0] "" XXX
|
||||
|
||||
BO_ 1342 LKAS12: 6 LDWS_LKAS
|
||||
SG_ CF_Lkas_TsrSlifOpt : 10|2@1+ (1.0,0.0) [0.0|3.0] "" CLU
|
||||
@@ -1037,6 +1042,7 @@ BO_ 1322 CLU15: 8 CLU
|
||||
SG_ CF_Clu_HudFontSizeSet : 31|2@1+ (1.0,0.0) [0.0|3.0] "" HUD
|
||||
SG_ CF_Clu_LanguageInfo : 33|5@1+ (1.0,0.0) [0.0|31.0] "" BCM,PGS
|
||||
SG_ CF_Clu_ClusterSound : 38|1@1- (1.0,0.0) [0.0|0.0] "" BCM,CGW,FATC
|
||||
SG_ CF_Clu_VehicleSpeed2 : 48|8@1+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 1066 _4WD13: 6 _4WD
|
||||
SG_ _4WD_CURRENT : 0|8@1+ (0.390625,0.0) [-50.0|50.0] "A" TCU
|
||||
@@ -1227,8 +1233,8 @@ BO_ 544 ESP12: 8 ESC
|
||||
SG_ YAW_RATE : 40|13@1+ (0.01,-40.95) [-40.95|40.96] "" _4WD,AFLS,IBOX,LCA,LDWS_LKAS,MDPS,PSB,SCC,SPAS,TCU
|
||||
SG_ YAW_RATE_STAT : 53|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,AFLS,IBOX,LCA,LDWS_LKAS,MDPS,PSB,SCC,SPAS,TCU
|
||||
SG_ YAW_RATE_DIAG : 54|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,AFLS,IBOX,LCA,LDWS_LKAS,MDPS,PSB,SCC,SPAS,TCU
|
||||
SG_ ESP12_AliveCounter : 56|4@1+ (1.0,0.0) [0.0|15.0] "" _4WD,EMS,LPI,TCU,TMU
|
||||
SG_ ESP12_Checksum : 60|4@1+ (1.0,0.0) [0.0|15.0] "" _4WD,EMS,LPI,TCU,TMU
|
||||
SG_ ESP12_Checksum : 56|4@1+ (1.0,0.0) [0.0|15.0] "" _4WD,EMS,LPI,TCU,TMU
|
||||
SG_ ESP12_AliveCounter : 60|4@1+ (1.0,0.0) [0.0|15.0] "" _4WD,EMS,LPI,TCU,TMU
|
||||
|
||||
BO_ 1307 CLU16: 8 CLU
|
||||
SG_ CF_Clu_TirePressUnitNValueSet : 0|3@1+ (1.0,0.0) [0.0|7.0] "" TPMS
|
||||
@@ -1250,14 +1256,6 @@ BO_ 790 EMS11: 8 EMS
|
||||
SG_ VS : 48|8@1+ (1.0,0.0) [0.0|254.0] "km/h" _4WD,AAF,ACU,AHLS,BCM,CLU,DATC,ECS,EPB,IBOX,LCA,LDWS_LKAS,LVR,MDPS,ODS,SCC,SMK,SPAS,TCU,TPMS
|
||||
SG_ RATIO_TQI_BAS_MAX_STND : 56|8@1+ (0.0078,0.0) [0.0|2.0] "" _4WD,IBOX,TCU
|
||||
|
||||
BO_ 881 E_EMS11: 8 XXX
|
||||
SG_ Cruise_Limit_Status : 13|1@1+ (1,0) [0|1] "" XXX
|
||||
SG_ Cruise_Limit_Target : 23|8@1+ (1,0) [0|15] "" XXX
|
||||
SG_ Gear_Change : 12|1@0+ (1,0) [0|31] "" XXX
|
||||
SG_ IG_Reactive_Stat : 8|3@1+ (1,0) [0|3] "" XXX
|
||||
SG_ Brake_Pedal_Pos : 0|8@1+ (1,0) [0|127] "" XXX
|
||||
SG_ Accel_Pedal_Pos : 31|8@1+ (1,0) [0|7] "" XXX
|
||||
|
||||
BO_ 1301 CLU14: 8 CLU
|
||||
SG_ CF_Clu_ADrUNValueSet : 0|3@1+ (1.0,0.0) [0.0|7.0] "" BCM
|
||||
SG_ CF_Clu_ADrLNValueSet : 3|3@1+ (1.0,0.0) [0.0|7.0] "" BCM
|
||||
@@ -1380,6 +1378,7 @@ BO_ 1290 SCC13: 8 SCC
|
||||
SG_ SCCDrvModeRValue : 0|3@1+ (1,0) [0|7] "" CLU
|
||||
SG_ SCC_Equip : 3|1@1+ (1,0) [0|1] "" ESC
|
||||
SG_ AebDrvSetStatus : 4|3@1+ (1,0) [0|7] "" CLU,ESC
|
||||
SG_ Lead_Veh_Dep_Alert_USM : 13|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
BO_ 1287 TCS15: 4 ESC
|
||||
SG_ ABS_W_LAMP : 0|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,CLU,CUBIS,IBOX
|
||||
@@ -1451,6 +1450,18 @@ BO_ 909 FCA11: 8 FCA
|
||||
SG_ Supplemental_Counter : 35|4@1+ (1,0) [0|15] "" XXX
|
||||
SG_ PAINT1_Status : 16|2@1+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 1156 HDA11_MFC: 8 XXX
|
||||
SG_ Counter : 5|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ NEW_SIGNAL_1 : 1|2@0+ (1,0) [0|255] "" XXX
|
||||
SG_ NEW_SIGNAL_2 : 7|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ NEW_SIGNAL_3 : 15|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ NEW_SIGNAL_4 : 16|2@1+ (1,0) [0|3] "" XXX
|
||||
SG_ NEW_SIGNAL_5 : 18|14@1+ (1,0) [0|63] "" XXX
|
||||
SG_ NEW_SIGNAL_6 : 33|2@0+ (1,0) [0|1] "" XXX
|
||||
SG_ NEW_SIGNAL_7 : 34|14@1+ (1,0) [0|16383] "" XXX
|
||||
SG_ NEW_SIGNAL_8 : 49|2@0+ (1,0) [0|1] "" XXX
|
||||
SG_ NEW_SIGNAL_9 : 50|14@1- (1,-4095) [0|16383] "" XXX
|
||||
|
||||
BO_ 1155 FCA12: 8 FCA
|
||||
SG_ FCA_USM : 0|3@1+ (1,0) [0|7] "" CGW,CLU,ESC
|
||||
SG_ FCA_DrvSetState : 3|3@1+ (1,0) [0|7] "" CGW
|
||||
@@ -1459,22 +1470,166 @@ BO_ 1186 FRT_RADAR11: 2 FCA
|
||||
SG_ CF_FCA_Equip_Front_Radar : 0|3@1+ (1,0) [0|7] "" LDWS_LKAS,LDW_LKA,ESC
|
||||
|
||||
BO_ 905 SCC14: 8 SCC
|
||||
SG_ ComfortBandLower : 6|6@1+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ ComfortBandUpper : 0|6@1+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ JerkLowerLimit : 19|7@1+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ JerkUpperLimit : 12|7@1+ (0.1,0) [0|0] "" Vector__XXX
|
||||
SG_ ComfortBandUpper : 0|6@1+ (0.0986,-4.14) [0|1.26] "m/s^2" ESC
|
||||
SG_ ComfortBandLower : 6|6@1+ (0.0986,-4.14) [0|1.26] "m/s^2" ESC
|
||||
SG_ JerkUpperLimit : 12|7@1+ (1,0) [0|12.7] "m/s^3" ESC
|
||||
SG_ JerkLowerLimit : 19|7@1+ (0.1,0) [0|12.7] "m/s^3" ESC
|
||||
SG_ ACCMode : 32|3@1+ (1,0) [0|7] "" CLU,HUD,LDWS_LKAS,ESC
|
||||
SG_ ObjGap : 56|8@1+ (1,0) [0|255] "" CLU,HUD,ESC
|
||||
|
||||
BO_ 882 ELECT_GEAR: 8 XXX
|
||||
SG_ Elect_Gear_Shifter : 16|3@1+ (1,0) [0|7] "" CLU
|
||||
|
||||
BO_ 1157 LFAHDA_MFC: 4 XXX
|
||||
SG_ LFA_USM : 28|2@1+ (1,0) [0|3] "" XXX
|
||||
SG_ LFA_SysWarning : 16|2@1+ (1,0) [0|3] "" XXX
|
||||
SG_ ACTIVE2 : 4|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ HDA_USM : 0|2@1+ (1,0) [0|3] "" XXX
|
||||
SG_ ACTIVE2 : 4|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ LFA_SysWarning : 16|2@1+ (1,0) [0|3] "" XXX
|
||||
SG_ ACTIVE : 25|1@1+ (1,0) [0|3] "" XXX
|
||||
SG_ LFA_USM : 28|2@1+ (1,0) [0|3] "" XXX
|
||||
|
||||
BO_ 913 BCM_PO_11: 8 Vector__XXX
|
||||
SG_ BCM_Door_Dri_Status : 5|1@0+ (1,0) [0|1] "" PT_ESC_ABS
|
||||
SG_ BCM_Shift_R_MT_SW_Status : 39|2@0+ (1,0) [0|3] "" PT_ESC_ABS
|
||||
|
||||
BO_ 1426 LABEL11: 8 XXX
|
||||
SG_ CC_React : 34|1@1+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 910 WHL_SPD12_FS: 5 iBAU
|
||||
SG_ CRC : 0|8@1+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ WHL_SPD12_AliveCounter : 8|4@1+ (1,0) [0|15] "" Vector__XXX
|
||||
SG_ WHL_SPD_FL : 12|14@1+ (0.03125,0) [0|511.96875] "km/h" Vector__XXX
|
||||
SG_ WHL_SPD_FR : 26|14@1+ (0.03125,0) [0|511.96875] "km/h" Vector__XXX
|
||||
|
||||
BO_ 911 WHL_SPD13_FS: 5 iBAU
|
||||
SG_ CRC : 0|8@1+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ WHL_SPD13_AliveCounter : 8|4@1+ (1,0) [0|15] "" Vector__XXX
|
||||
SG_ WHL_SPD_RL : 12|14@1+ (0.03125,0) [0|511.96875] "km/h" Vector__XXX
|
||||
SG_ WHL_SPD_RR : 26|14@1+ (0.03125,0) [0|511.96875] "km/h" Vector__XXX
|
||||
|
||||
BO_ 865 ADAS_PRK_11: 8 ADAS_PRK
|
||||
SG_ CF_PCA_BrkReq : 24|1@1+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ CF_PCA_DclTrgtVal : 28|4@1+ (0.04,0) [0|0] "g" Vector__XXX
|
||||
SG_ PCA_ALIVE_CNT : 40|4@1+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ PCA_CHECK_SUM : 48|8@1+ (1,0) [0|0] "" Vector__XXX
|
||||
|
||||
BO_ 882 ELECT_GEAR: 8 XXX
|
||||
SG_ Elect_Gear_Shifter : 16|4@1+ (1,0) [0|7] "" CLU
|
||||
|
||||
BO_ 881 E_EMS11: 8 XXX
|
||||
SG_ Brake_Pedal_Pos : 0|8@1+ (1,0) [0|127] "" XXX
|
||||
SG_ IG_Reactive_Stat : 8|3@1+ (1,0) [0|3] "" XXX
|
||||
SG_ Gear_Change : 12|1@0+ (1,0) [0|31] "" XXX
|
||||
SG_ Cruise_Limit_Status : 13|1@1+ (1,0) [0|1] "" XXX
|
||||
SG_ Cruise_Limit_Target : 23|8@1+ (1,0) [0|15] "" XXX
|
||||
SG_ Accel_Pedal_Pos : 31|8@1+ (1,0) [0|7] "" XXX
|
||||
|
||||
BO_ 1355 EV_PC6: 8 CGW
|
||||
SG_ CF_Vcu_SbwWarnMsg : 16|3@1+ (1,0) [0|7] "" Vector__XXX
|
||||
|
||||
BO_ 1430 EV_PC2: 8 CGW
|
||||
SG_ CR_Ldc_ActVol_LS_V : 32|8@1+ (0.1,0) [0|0] "V" Vector__XXX
|
||||
|
||||
BO_ 1535 EV_PC10: 8 CGW
|
||||
SG_ CF_Vcu_EpbRequest : 37|1@1+ (1,0) [0|0] "" Vector__XXX
|
||||
|
||||
BO_ 908 RSPA11: 8 RSPA
|
||||
SG_ CF_RSPA_State : 0|4@1+ (1,0) [0|15] "" XXX
|
||||
SG_ CF_RSPA_Act : 4|2@1+ (1,0) [0|3] "" XXX
|
||||
SG_ CF_RSPA_DecCmd : 6|2@1+ (1,0) [0|3] "" XXX
|
||||
SG_ CF_RSPA_Trgt_Spd : 8|10@1+ (0.01,0) [0|10.23] "km/h" XXX
|
||||
SG_ CF_RSPA_StopReq : 18|1@1+ (1,0) [0|2] "" XXX
|
||||
SG_ CR_RSPA_EPB_Req : 22|2@1+ (1,0) [0|3] "" XXX
|
||||
SG_ CF_RSPA_ACC_ACT : 50|1@1+ (1,0) [0|2] "" XXX
|
||||
SG_ CF_RSPA_AliveCounter : 52|4@1+ (1,0) [0|15] "" XXX
|
||||
SG_ CF_RSPA_CRC : 56|8@1+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 914 S_MDPS11: 8 XXX
|
||||
SG_ CF_Mdps_Stat : 0|4@1+ (1,0) [0|15] "" XXX
|
||||
SG_ CR_Mdps_DrvTq : 8|12@1+ (1,0) [0|15] "" XXX
|
||||
SG_ CR_Mdps_StrAng : 24|16@1- (1,0) [0|65535] "" XXX
|
||||
SG_ CF_Mdps_AliveCnt : 47|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ CF_Mdps_Chksum : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 357 S_MDPS12: 8 XXX
|
||||
SG_ NEW_SIGNAL_1 : 0|12@1+ (1,0) [0|4095] "" XXX
|
||||
SG_ NEW_SIGNAL_2 : 12|12@1+ (1,0) [0|4095] "" XXX
|
||||
SG_ Counter : 48|4@1+ (1,0) [0|15] "" XXX
|
||||
SG_ Checksum : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 352 AHB1: 8 iBAU
|
||||
SG_ CF_Ahb_SLmp : 0|2@1+ (1,0) [0|3] "" CLU
|
||||
SG_ CF_Ahb_Def : 2|2@1+ (1,0) [0|3] "" CGW
|
||||
SG_ CF_Ahb_Act : 4|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CF_Ahb_Diag : 6|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CF_Ahb_WLmp : 7|1@1+ (1,0) [0|1] "" CLU
|
||||
SG_ CR_Ahb_StDep_mm : 8|16@1- (0.1,0) [-3276.8|3276.7] "mm" Vector__XXX
|
||||
SG_ CF_Ahb_SnsFail : 24|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CF_Ahb_PedalCalStat : 25|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CF_Ahb_Bzzr : 26|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CF_Ahb_ChkSum : 56|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
|
||||
BO_ 1191 4a7MFC: 8 XXX
|
||||
SG_ PAINT1 : 0|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 1162 BCA11: 8 BCW
|
||||
SG_ CF_BCA_State : 16|3@1+ (1,0) [0|7] "" CLU,iBAU
|
||||
SG_ CF_BCA_Warning : 19|2@1+ (1,0) [0|3] "" CLU,iBAU
|
||||
SG_ AliveCounter : 21|4@1+ (1,0) [0|15] "" CLU,iBAU
|
||||
SG_ RCCA_Brake_Command : 29|1@1+ (1,0) [0|1] "" iBAU
|
||||
SG_ Check_Sum : 56|8@1+ (1,0) [0|16] "" iBAU
|
||||
|
||||
BO_ 1136 P_STS: 6 CGW
|
||||
SG_ HCU1_STS : 6|2@1+ (1,0) [0|3] "" BCW,EPB,FCA,MDPS,SCC,iBAU
|
||||
SG_ HCU5_STS : 8|2@1+ (1,0) [0|3] "" EPB,FCA,MDPS,iBAU
|
||||
|
||||
BO_ 304 YRS11: 8 ACU
|
||||
SG_ CR_Yrs_Yr : 0|16@1+ (0.005,-163.84) [-163.84|163.83] "deg/s" CGW,iBAU
|
||||
SG_ CR_Yrs_LatAc : 16|16@1+ (0.000127465,-4.17677312) [-4.17677312|4.17651819] "g" iBAU
|
||||
SG_ CF_Yrs_YrStat : 32|4@1+ (1,0) [0|15] "" iBAU
|
||||
SG_ CF_Yrs_LatAcStat : 36|4@1+ (1,0) [0|15] "" iBAU
|
||||
SG_ CF_Yrs_MCUStat : 40|4@1+ (1,0) [0|15] "" iBAU
|
||||
SG_ CR_Yrs_MsgCnt1 : 48|4@1+ (1,0) [0|15] "" iBAU
|
||||
SG_ CR_Yrs_Crc1 : 56|8@1+ (1,0) [0|255] "" iBAU
|
||||
|
||||
BO_ 320 YRS12: 8 ACU
|
||||
SG_ CF_Yrs_LongAcStat : 16|4@1+ (1,0) [0|15] "" iBAU
|
||||
SG_ CF_IMU_ResetStat : 20|4@1+ (1,0) [0|15] "" iBAU
|
||||
SG_ YRS_Temp : 24|8@1+ (1,-68) [-68|187] "" iBAU
|
||||
SG_ YRS_TempStat : 32|4@1+ (1,0) [0|15] "" iBAU
|
||||
SG_ CF_Yrs_Type : 36|4@1+ (1,0) [0|15] "" iBAU
|
||||
SG_ CR_Yrs_MsgCnt2 : 48|4@1+ (1,0) [0|15] "" iBAU
|
||||
SG_ CR_Yrs_Crc2 : 56|8@1+ (1,0) [0|255] "" iBAU
|
||||
SG_ CR_Yrs_LongAc : 0|16@1+ (0.000127465,-4.17677312) [-4.17677312|4.17651819] "g" CGW,iBAU
|
||||
|
||||
BO_ 1173 YRS13: 8 ACU
|
||||
SG_ YRS_SeralNo : 16|48@1+ (1,0) [0|281474976710655] "" iBAU
|
||||
|
||||
BO_ 870 366_EMS: 8 EMS
|
||||
SG_ N : 7|16@0+ (1,0.25) [0|16383.75] "rpm" XXX
|
||||
SG_ EMS_Related : 23|16@0+ (1,0) [0|65535] "" XXX
|
||||
SG_ TQFR : 39|8@0+ (0.390625,0) [0|99.6094] "%" XXX
|
||||
SG_ VS : 40|8@1+ (1,0) [0|255] "km/h" MDPS
|
||||
SG_ SWI_IGK : 48|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 854 356: 8 XXX
|
||||
SG_ PAINT1 : 32|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PAINT2 : 34|2@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PAINT3 : 36|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ PAINT4 : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 1042 ICM_412h: 8 ICM
|
||||
SG_ T_Outside_input : 0|9@0+ (0.01,0) [0|5] "V" Vector__XXX
|
||||
SG_ WarningSoundOutput_1Group : 5|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ WarningSoundOutput_2Group : 6|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ WarningSoundOutput_3Group : 7|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ TRIP_A_DT_Display_clock : 22|7@0+ (1,0) [0|99] "clock" Vector__XXX
|
||||
SG_ TRIP_A_DT_Display_minute : 29|6@0+ (1,0) [0|59] "minute" Vector__XXX
|
||||
SG_ TRIP_B_DT_Display_clock : 38|7@0+ (1,0) [0|99] "clock" Vector__XXX
|
||||
SG_ TRIP_B_DT_Display_minute : 45|6@0+ (1,0) [0|59] "minute" Vector__XXX
|
||||
SG_ PopupMessageOutput_1Level : 48|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ PopupMessageOutput_2Level : 49|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ PopupMessageOutput_3Level : 50|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ PopupMessageOutput_4Level : 51|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ PopupMessageOutput_5Level : 52|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ PopupMessageOutput_6Level : 53|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ PopupMessageOutput_7Level : 54|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ PopupMessageOutput_8Level : 55|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
|
||||
VAL_ 909 CF_VSM_Warn 2 "FCW" 3 "AEB";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
|
||||
|
||||
|
||||
CM_ "Imported file _comma.dbc starts here"
|
||||
CM_ "Imported file _comma.dbc starts here";
|
||||
BO_ 359 STEERING_IPAS_COMMA: 8 IPAS
|
||||
SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ ANGLE : 3|12@0- (1.5,0) [-510|510] "deg" XXX
|
||||
@@ -9,10 +9,10 @@ BO_ 359 STEERING_IPAS_COMMA: 8 IPAS
|
||||
SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ DIRECTION_CMD : 38|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ SET_ME_X40 : 47|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ SET_ME_X00 : 55|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ SET_ME_X00_1 : 55|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
CM BO_ STEERING_IPAS_COMMA "Copy of msg 614 so we can do angle control while the Park Assist ECU is connected (Panda spoofs 614 with 359 on connector J70). Note that addresses 0x266 and 0x167 are checksum-invariant";
|
||||
CM_ "BO_ STEERING_IPAS_COMMA: Copy of msg 614 so we can do angle control while the Park Assist ECU is connected (Panda spoofs 614 with 359 on connector J70). Note that addresses 0x266 and 0x167 are checksum-invariant";
|
||||
|
||||
BO_ 512 GAS_COMMAND: 6 EON
|
||||
SG_ GAS_COMMAND : 7|16@0+ (0.159375,-75.555) [0|1] "" INTERCEPTOR
|
||||
@@ -30,8 +30,13 @@ CM BO_ STEERING_IPAS_COMMA "Copy of msg 614 so we can do angle control while the
|
||||
|
||||
VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ;
|
||||
|
||||
BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX
|
||||
SG_ ZORRO_STEER : 7|24@0- (0.004901594652,0) [-500|500] "" XXX
|
||||
|
||||
CM_ "Imported file _toyota_2017.dbc starts here"
|
||||
CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss";
|
||||
|
||||
|
||||
CM_ "Imported file _toyota_2017.dbc starts here";
|
||||
VERSION ""
|
||||
|
||||
|
||||
@@ -311,7 +316,7 @@ CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd";
|
||||
CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set";
|
||||
CM_ SG_ 37 STEER_RATE "factor is tbd";
|
||||
CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors";
|
||||
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isnt perfect";
|
||||
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect";
|
||||
CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph";
|
||||
CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?";
|
||||
CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque";
|
||||
@@ -320,7 +325,7 @@ CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active";
|
||||
CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control";
|
||||
CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control";
|
||||
CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking";
|
||||
CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was "SET_ME_1" and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG.";
|
||||
CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG.";
|
||||
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
|
||||
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
|
||||
CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel";
|
||||
@@ -328,7 +333,7 @@ CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces";
|
||||
CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts";
|
||||
CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit.";
|
||||
CM_ SG_ 1161 SYNCID1 "counter from 1 to f at 1 Hz";
|
||||
CM_ SG_ 1161 SPDVAL2 "conditional speed value 70"
|
||||
CM_ SG_ 1161 SPDVAL2 "conditional speed value 70";
|
||||
CM_ SG_ 1162 SGNNUMP "1 if SPDVAL1 is set, otherwise 0";
|
||||
CM_ SG_ 1162 SYNCID2 "counter from 1 to f at 1 Hz";
|
||||
CM_ SG_ 1163 TSREQPD "always 1";
|
||||
@@ -362,7 +367,7 @@ VAL_ 1162 SPLSGN3 15 "conditional blank" 4 "wet road" 5 "rain" 0 "none";
|
||||
|
||||
CM_ "CHFFR_METRIC 37 STEER_ANGLE STEER_ANGLE 0.36 180";
|
||||
|
||||
CM_ "lexus_ct200h_2018_pt.dbc starts here"
|
||||
CM_ "lexus_ct200h_2018_pt.dbc starts here";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -311,7 +311,7 @@ CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd";
|
||||
CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set";
|
||||
CM_ SG_ 37 STEER_RATE "factor is tbd";
|
||||
CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors";
|
||||
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isnt perfect";
|
||||
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect";
|
||||
CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph";
|
||||
CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?";
|
||||
CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque";
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user