Compare commits

..

13 Commits
0.8.4 ... 0.8.5

Author SHA1 Message Date
eFini
16a8e69382 Merge pull request #92 from loveloveses/0.8.5
enableBsm for CRV HYBRID
2021-08-17 18:12:36 +08:00
loveloveses
76c77a1fb9 enable bsm for CRV HYBRID 2021-08-13 12:08:23 +08:00
loveloveses
a85f8d141e enable bsm for CRV HYBRID 2021-08-13 12:05:54 +08:00
loveloveses
9b76c108c6 enableBsm for CRV HYBRID
enableBsm for CRV HYBRID
2021-08-13 12:00:52 +08:00
eFini
2185eb440f Update HOWTO-ONEPLUS.md 2021-07-22 12:43:20 +10:00
eFini
e334014a25 Fix command error 2021-07-22 12:42:34 +10:00
eFini
2a5d5c08c2 Bug fix 2021-07-07 10:06:19 +10:00
Rick Lan
3b0aed3ed2 bug fixes 2021-07-03 12:14:44 +08:00
Rick Lan
522fb06db7 dragonpilot mod for 0.8.5-4 2021-07-02 12:49:43 +08:00
Adeeb Shihadeh
145b222f0d Fix Honda Accord transmission type detection (#21247) 2021-06-12 20:53:59 -07:00
Adeeb Shihadeh
0ef3ce173a Hotfix: fix UI crash when going onroad after onboarding 2021-06-11 16:57:52 -07:00
Vehicle Researcher
c1112e4400 openpilot v0.8.5 release 2021-06-07 22:13:57 +00:00
Adeeb Shihadeh
bbc546fcf3 Hotfix: fix update error alerts under some network conditions (#21059)
This reverts commit 3c9e46d8a2.
2021-05-27 15:36:59 -07:00
205 changed files with 2898 additions and 3630 deletions

View File

@@ -1,3 +1,33 @@
dragonpilot 0.8.5-4
========================
* Added multiple toggles.
* Code clean up.
* Android app support. (see selfdrive/dragonpilot/HOWTO-APPD.md)
* Better support for VW MPQ (Thanks to @Saber)
dragonpilot 0.8.5-3
========================
* Added Jetson support toggle.
* Added Steering Ratio controller.
* Reduce Following Profile to 3 modes only. (1.8s / 1.5s / 1.2s)
* Bug fixes.
dragonpilot 0.8.5-2
========================
* Added black panda simulation toggle.
* Added No GPS toggle.
* Added No Battery Toggle.
* Bug fixes.
dragonpilot 0.8.5-1
========================
* Based on openpilot 0.8.5 devel.
* 基於 openpilot 0.8.5 devel.
* Support 1+3t / C2 / Jetson Xavier NX.
* 支持 1+3t / C2 / Jetson Xavier NX.
* No White/Grey Panda Support.
* 不支持白灰熊.
dragonpilot 0.8.4-3
========================
* 簡化 1+3t 安裝方法. (請查閱 HOWTO-ONEPLUS.md)

28
CONTRIBUTORS.md Normal file
View File

@@ -0,0 +1,28 @@
# CONTRIBUTORS
Due to the way we manage the source code, it is not possible to see all the contributors info, hence we create a list here.
If you have contributed to DP project before and your name is not listed here, feel free to send us a PR to update this!
name | github | contribution
------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------
andy741217 | [andy741217](https://github.com/andy741217) | New features, bug fixes
Arne Schwarck | [arne182](https://github.com/arne182) | New features, bug fixes
berno22 | [berno22](https://github.com/berno22) | New car fingerprint
Bobbydough | [Bobbydough](https://github.com/bobbydough) | Bug fixes
Curtis Jenkins | [actuallylemoncurd](https://github.com/actuallylemoncurd) | New Features
DFyffe | [donfyffe](https://github.com/donfyffe) | New features, bug fixes
dinglx | [dingliangxue](https://github.com/dingliangxue) | New features, bug fixes
eyezenheim | [eyezenheim](https://github.com/eyezenheim) | Tester
kegman | [kegman](https://github.com/kegman) | New features, bug fixes
kumar | [rav4kumar](https://github.com/rav4kumar) | New features, bug fixes
lijunhao731 | [lijunhao731](https://github.com/lijunhao731) | New car fingerprint
lirudy | [lirudy](https://github.com/lirudy) | Bug fixes
LOVEChen | [LOVEChen](https://github.com/LOVEChen) | Bug fixes
loveloveses | [loveloveses](https://github.com/loveloveses) | Bug fixes, DP wiki main maintainer
menwenliang | [menwenliang](https://github.com/menwenliang) | New features
Rick Lan | [efinilan](https://github.com/efinilan) | Project lead
rming | [Rming](https://github.com/rming) | Bug fixes, wiki contributor
sebastian4k | [sebastian4k](https://github.com/sebastian4k) | Bug fixes
Shane Smiskol | [sshane](https://github.com/sshane) | New features, bug fixes
toyboxZ | [toyboxZ](https://github.com/toyboxZ) | New features, bug fixes

View File

@@ -1,31 +1,25 @@
How to install on Oneplus 3t?
------
1. clone dragonpilot to /data/ and make sure it's named openpilot:
(手動安裝切換至 dragonpilot 0.8.4 branch)
(手動安裝切換至 dragonpilot 0.8.5 branch)
```
cd /data/ && rm -fr openpilot; git clone https://github.com/dragonpilot-community/dragonpilot.git openpilot -b 0.8.4
cd /data/ && rm -fr openpilot; git clone https://github.com/dragonpilot-community/dragonpilot.git openpilot -b 0.8.5
```
2. run command:
(在 ssh 畫面下,輸入)
(在 ssh 畫面下,輸入)
```
cd /data/openpilot/scripts/ && ./oneplus_update_neos.sh
```
3. Let it download and complete it update, after a couple of reboot, your screen will then stay in fastboot mode.
(等待下載並讓它重新開機,沒錯誤的話會進入 Android 機器人更新畫面,等自動重新開機)
(等待下載並讓它重新開機,沒錯誤的話會進入 Android 機器人更新畫面,等自動重新開機)
4. In fastboot mode, select use volume button to select to `Recovery mode` then press power button.
(在 fastboot 模式,用音量鍵上下選到 Recovery mode 再按下電源鍵)
(在 fastboot 模式,用音量鍵上下選到 Recovery mode 再按下電源鍵)
5. In Recovery mode, tap `apply update` -> `Choose from emulated` -> `0/` -> `update.zip` -> `Reboot system now`
(在 Recovery mode點選 `apply update` -> `Choose from emulated` -> `0/` -> `update.zip` -> `Reboot system now`)
(在 Recovery mode點選 `apply update` -> `Choose from emulated` -> `0/` -> `update.zip` -> `Reboot system now`)
6. You should be able to boot into openpilot, if touch screen is not working, try to reboot again.
(你現在應該可以進入 openpilot 畫面,如果點擊畫面沒有反應,請再重新開機一次)
(你現在應該可以進入 openpilot 畫面,如果點擊畫面沒有反應,請再重新開機一次)

22
Jenkinsfile vendored
View File

@@ -36,7 +36,7 @@ EOF"""
def phone_steps(String device_type, steps) {
lock(resource: "", label: device_type, inversePrecedence: true, variable: 'device_ip', quantity: 1) {
timeout(time: 90, unit: 'MINUTES') {
timeout(time: 150, unit: 'MINUTES') {
phone(device_ip, "git checkout", readFile("selfdrive/test/setup_device_ci.sh"),)
steps.each { item ->
phone(device_ip, item[0], item[1])
@@ -52,7 +52,7 @@ pipeline {
TEST_DIR = "/data/openpilot"
}
options {
timeout(time: 1, unit: 'HOURS')
timeout(time: 3, unit: 'HOURS')
}
stages {
@@ -78,7 +78,7 @@ pipeline {
when {
not {
anyOf {
branch 'master-ci'; branch 'devel'; branch 'devel-staging'; branch 'release2'; branch 'release2-staging'; branch 'dashcam'; branch 'dashcam-staging'; branch 'testing-closet*'
branch 'master-ci'; branch 'devel'; branch 'devel-staging'; branch 'release2'; branch 'release2-staging'; branch 'dashcam'; branch 'dashcam-staging'; branch 'testing-closet*'; branch 'hotfix-*'
}
}
}
@@ -127,7 +127,7 @@ pipeline {
stage('Devel Tests') {
steps {
phone_steps("eon-build", [
["build devel", "cd release && SCONS_CACHE=1 DEVEL_TEST=1 ./build_devel.sh"],
["build devel", "cd release && DEVEL_TEST=1 ./build_devel.sh"],
["test manager", "python selfdrive/manager/test/test_manager.py"],
["onroad tests", "cd selfdrive/test/ && ./test_onroad.py"],
["test car interfaces", "cd selfdrive/car/tests/ && ./test_car_interfaces.py"],
@@ -138,8 +138,8 @@ pipeline {
stage('Replay Tests') {
steps {
phone_steps("eon2", [
["build QCOM_REPLAY", "SCONS_CACHE=1 QCOM_REPLAY=1 scons -j4"],
["camerad/modeld replay", "cd selfdrive/test/process_replay && ./camera_replay.py"],
["build", "cd selfdrive/manager && ./build.py"],
["model replay", "cd selfdrive/test/process_replay && ./model_replay.py"],
])
}
}
@@ -147,7 +147,7 @@ pipeline {
stage('HW + Unit Tests') {
steps {
phone_steps("eon", [
["build", "SCONS_CACHE=1 scons -j4"],
["build", "cd selfdrive/manager && ./build.py"],
["test athena", "nosetests -s selfdrive/athena/tests/test_athenad_old.py"],
["test sounds", "nosetests -s selfdrive/test/test_sounds.py"],
["test boardd loopback", "nosetests -s selfdrive/boardd/tests/test_boardd_loopback.py"],
@@ -166,7 +166,7 @@ pipeline {
timeout(time: 90, unit: 'MINUTES') {
sh script: "/home/batman/tools/zookeeper/enable_and_wait.py $device_ip 120", label: "turn on device"
phone(device_ip, "git checkout", readFile("selfdrive/test/setup_device_ci.sh"),)
phone(device_ip, "build", "SCONS_CACHE=1 scons -j4 && sync")
phone(device_ip, "build", "scons -j4 && sync")
sh script: "/home/batman/tools/zookeeper/disable.py $device_ip", label: "turn off device"
sh script: "/home/batman/tools/zookeeper/enable_and_wait.py $device_ip 120", label: "turn on device"
sh script: "/home/batman/tools/zookeeper/check_consumption.py 60 3", label: "idle power consumption after boot"
@@ -186,7 +186,7 @@ pipeline {
}
steps {
phone_steps("tici", [
["build", "SCONS_CACHE=1 scons -j16"],
["build", "cd selfdrive/manager && ./build.py"],
["test loggerd", "python selfdrive/loggerd/tests/test_loggerd.py"],
["test encoder", "LD_LIBRARY_PATH=/usr/local/lib python selfdrive/loggerd/tests/test_encoder.py"],
["onroad tests", "cd selfdrive/test/ && ./test_onroad.py"],
@@ -198,7 +198,7 @@ pipeline {
stage('camerad') {
steps {
phone_steps("eon-party", [
["build", "SCONS_CACHE=1 scons -j16"],
["build", "cd selfdrive/manager && ./build.py"],
["test camerad", "python selfdrive/camerad/test/test_camerad.py"],
["test exposure", "python selfdrive/camerad/test/test_exposure.py"],
])
@@ -208,7 +208,7 @@ pipeline {
stage('Tici camerad') {
steps {
phone_steps("tici-party", [
["build", "SCONS_CACHE=1 scons -j16"],
["build", "cd selfdrive/manager && ./build.py"],
["test camerad", "python selfdrive/camerad/test/test_camerad.py"],
["test exposure", "python selfdrive/camerad/test/test_exposure.py"],
])

View File

@@ -97,7 +97,9 @@ Supported Cars
| 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 |
| Lexus | UX Hybrid 2019 | All | openpilot | 0mph | 0mph |
| Toyota | Avalon 2016-21 | TSS-P | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
| Toyota | Avalon Hybrid 2019 | TSS-P | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
| Toyota | Camry 2018-20 | 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 |
@@ -133,8 +135,9 @@ Community Maintained Cars and Features
| Make | Model (US Market Reference) | Supported Package | ACC | No ACC accel below | No ALC below |
| ----------| ------------------------------| ------------------| -----------------| -------------------| -------------|
| Audi | A3 2014-17 | Prestige | Stock | 0mph | 0mph |
| Audi | A3 2014-18 | Prestige | Stock | 0mph | 0mph |
| Audi | A3 Sportback e-tron 2017-18 | Prestige | Stock | 0mph | 0mph |
| Audi | Q2 2018 | Driver Assistance | Stock | 0mph | 0mph |
| Buick | Regal 2018<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
| Cadillac | ATS 2018<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
| Chevrolet | Malibu 2017<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
@@ -148,7 +151,7 @@ Community Maintained Cars and Features
| Genesis | G90 2018 | All | Stock | 0mph | 0mph |
| 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 | Elantra 2017-19, 2021 | SCC + LKAS | Stock | 19mph | 34mph |
| Hyundai | Genesis 2015-16 | SCC + LKAS | Stock | 19mph | 37mph |
| Hyundai | Ioniq Electric 2019 | SCC + LKAS | Stock | 0mph | 32mph |
| Hyundai | Ioniq Electric 2020 | SCC + LKAS | Stock | 0mph | 0mph |
@@ -167,12 +170,14 @@ Community Maintained Cars and Features
| Kia | Sorento 2018-19 | SCC + LKAS | Stock | 0mph | 0mph |
| Kia | Stinger 2018 | SCC + LKAS | Stock | 0mph | 0mph |
| Kia | Ceed 2019 | SCC + LKAS | Stock | 0mph | 0mph |
| Nissan | Altima 2020 | ProPILOT | Stock | 0mph | 0mph |
| Nissan | Altima 2019-20 | ProPILOT | Stock | 0mph | 0mph |
| Nissan | Leaf 2018-20 | ProPILOT | Stock | 0mph | 0mph |
| Nissan | Rogue 2018-20 | ProPILOT | Stock | 0mph | 0mph |
| Nissan | X-Trail 2017 | ProPILOT | Stock | 0mph | 0mph |
| SEAT | Ateca 2018 | Driver Assistance | Stock | 0mph | 0mph |
| SEAT | Leon 2014-2020 | Driver Assistance | Stock | 0mph | 0mph |
| Škoda | Kodiaq 2018 | Driver Assistance | Stock | 0mph | 0mph |
| Škoda | Octavia 2015, 2019 | Driver Assistance | Stock | 0mph | 0mph |
| Škoda | Scala 2020 | Driver Assistance | Stock | 0mph | 0mph |
| Škoda | Superb 2015-18 | Driver Assistance | Stock | 0mph | 0mph |
| Subaru | Ascent 2019 | EyeSight | Stock | 0mph | 0mph |

View File

@@ -1,3 +1,18 @@
Version 0.8.5 (2021-06-11)
========================
* NEOS update: improved reliability and stability with better voltage regulator configuration
* Smart model-based Forward Collision Warning
* CAN-based fingerprinting moved behind community features toggle
* Improved longitudinal control on Toyotas with a comma pedal
* Improved auto-brightness using road-facing camera
* Added "Software" settings page with updater controls
* Audi Q2 2018 support thanks to jyoung8607!
* Hyundai Elantra 2021 support thanks to CruiseBrantley!
* Lexus UX Hybrid 2019-2020 support thanks to brianhaugen2!
* Toyota Avalon Hybrid 2019 support thanks to jbates9011!
* SEAT Leon 2017 & 2020 support thanks to jyoung8607!
* Škoda Octavia 2015 & 2019 support thanks to jyoung8607!
Version 0.8.4 (2021-05-17)
========================
* Delay controls start until system is ready

View File

@@ -39,6 +39,10 @@ AddOption('--mpc-generate',
action='store_true',
help='regenerates the mpc sources')
AddOption('--snpe',
action='store_true',
help='use SNPE on PC')
AddOption('--external-sconscript',
action='store',
metavar='FILE',
@@ -53,7 +57,6 @@ if arch == "aarch64" and TICI:
arch = "larch64"
USE_WEBCAM = os.getenv("USE_WEBCAM") is not None
QCOM_REPLAY = arch == "aarch64" and os.getenv("QCOM_REPLAY") is not None
USE_MIPI = os.getenv("USE_MIPI") is not None
if arch == "aarch64" and JETSON:
@@ -104,10 +107,6 @@ if arch == "aarch64" or arch == "larch64":
cflags = ["-DQCOM", "-mcpu=cortex-a57"]
cxxflags = ["-DQCOM", "-mcpu=cortex-a57"]
rpath = []
if QCOM_REPLAY:
cflags += ["-DQCOM_REPLAY"]
cxxflags += ["-DQCOM_REPLAY"]
else:
cflags = []
cxxflags = []
@@ -145,6 +144,7 @@ else:
libpath = [
"#phonelibs/snpe/x86_64-linux-clang",
"#phonelibs/libyuv/x64/lib",
"#phonelibs/mapbox-gl-native-qt/x86_64",
"#cereal",
"#selfdrive/common",
"/usr/lib",
@@ -208,6 +208,7 @@ env = Environment(
"#phonelibs/android_system_core/include",
"#phonelibs/linux/include",
"#phonelibs/snpe/include",
"#phonelibs/mapbox-gl-native-qt/include",
"#phonelibs/nanovg",
"#phonelibs/qrcode",
"#phonelibs",
@@ -240,15 +241,10 @@ env = Environment(
if GetOption('compile_db'):
env.CompilationDatabase('compile_commands.json')
if os.environ.get('SCONS_CACHE'):
cache_dir = '/tmp/scons_cache'
if TICI:
cache_dir = '/data/scons_cache'
if QCOM_REPLAY:
cache_dir = '/tmp/scons_cache_qcom_replay'
CacheDir(cache_dir)
# Setup cache dir
cache_dir = '/data/scons_cache' if TICI else '/tmp/scons_cache'
CacheDir(cache_dir)
Clean(["."], cache_dir)
node_interval = 5
node_count = 0
@@ -290,7 +286,7 @@ Export('envCython')
# Qt build environment
qt_env = env.Clone()
qt_modules = ["Widgets", "Gui", "Core", "Network", "Concurrent", "Multimedia", "Quick", "Qml", "QuickWidgets"]
qt_modules = ["Widgets", "Gui", "Core", "Network", "Concurrent", "Multimedia", "Quick", "Qml", "QuickWidgets", "Location", "Positioning"]
if arch != "aarch64":
qt_modules += ["DBus"]
@@ -356,7 +352,8 @@ if GetOption("clazy"):
qt_env['ENV']['CLAZY_IGNORE_DIRS'] = qt_dirs[0]
qt_env['ENV']['CLAZY_CHECKS'] = ','.join(checks)
Export('env', 'qt_env', 'arch', 'real_arch', 'SHARED', 'USE_WEBCAM', 'QCOM_REPLAY', 'USE_MIPI')
zmq = 'zmq'
Export('env', 'qt_env', 'arch', 'real_arch', 'SHARED', 'USE_WEBCAM', 'zmq', 'USE_MIPI')
# cereal and messaging are shared with the system
SConscript(['cereal/SConscript'])

View File

@@ -1,4 +1,4 @@
Import('env', 'envCython', 'arch', 'QCOM_REPLAY')
Import('env', 'envCython', 'arch', 'zmq')
import shutil
@@ -40,6 +40,13 @@ messaging_objects = env.SharedObject([
messaging_lib = env.Library('messaging', messaging_objects)
Depends('messaging/impl_zmq.cc', services_h)
# note, this rebuilds the deps shared, zmq is statically linked to make APK happy
# TODO: get APK to load system zmq to remove the static link
if arch == "aarch64":
zmq_static = FindFile("libzmq.a", "/usr/lib")
shared_lib_shared_lib = [zmq_static, 'm', 'stdc++', "gnustl_shared", "kj", "capnp"]
env.SharedLibrary('messaging_shared', messaging_objects, LIBS=shared_lib_shared_lib)
env.Program('messaging/bridge', ['messaging/bridge.cc'], LIBS=[messaging_lib, 'zmq'])
Depends('messaging/bridge.cc', services_h)
@@ -54,7 +61,7 @@ vipc_sources = [
'visionipc/visionbuf.cc',
]
if arch in ["aarch64", "larch64"] and (not QCOM_REPLAY):
if arch in ["aarch64", "larch64"]:
vipc_sources += ['visionipc/visionbuf_ion.cc']
else:
vipc_sources += ['visionipc/visionbuf_cl.cc']
@@ -64,6 +71,8 @@ vipc = env.Library('visionipc', vipc_objects)
libs = envCython["LIBS"]+["OpenCL", "zmq", vipc, messaging_lib]
if arch == "aarch64":
libs += ["adreno_utils"]
if arch == "Darwin":
del libs[libs.index('OpenCL')]
envCython['FRAMEWORKS'] += ['OpenCL']

73
cereal/_SConstruct Normal file
View File

@@ -0,0 +1,73 @@
import os
import platform
import subprocess
import sysconfig
arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
if platform.system() == "Darwin":
arch = "Darwin"
cereal_dir = Dir('.')
messaging_dir = Dir('./messaging')
cpppath = [
cereal_dir,
messaging_dir,
'/usr/lib/include',
'/opt/homebrew/include',
sysconfig.get_paths()['include'],
]
libpath = [
'/opt/homebrew/lib',
]
AddOption('--test',
action='store_true',
help='build test files')
AddOption('--asan',
action='store_true',
help='turn on ASAN')
ccflags_asan = ["-fsanitize=address", "-fno-omit-frame-pointer"] if GetOption('asan') else []
ldflags_asan = ["-fsanitize=address"] if GetOption('asan') else []
env = Environment(
ENV=os.environ,
CC='clang',
CXX='clang++',
CCFLAGS=[
"-g",
"-fPIC",
"-O2",
"-Wunused",
"-Werror",
] + ccflags_asan,
LDFLAGS=ldflags_asan,
LINKFLAGS=ldflags_asan,
CFLAGS="-std=gnu11",
CXXFLAGS="-std=c++1z",
CPPPATH=cpppath,
LIBPATH=libpath,
CYTHONCFILESUFFIX=".cpp",
tools=["default", "cython"]
)
Export('env', 'arch')
envCython = env.Clone(LIBS=[])
envCython["CCFLAGS"] += ["-Wno-#warnings", "-Wno-deprecated-declarations"]
if arch == "Darwin":
envCython["LINKFLAGS"] = ["-bundle", "-undefined", "dynamic_lookup"]
elif arch == "aarch64":
envCython["LINKFLAGS"] = ["-shared"]
envCython["LIBS"] = [os.path.basename(sysconfig.get_paths()['include'])]
else:
envCython["LINKFLAGS"] = ["-pthread", "-shared"]
Export('envCython')
SConscript(['SConscript'])

View File

@@ -52,7 +52,7 @@ struct CarEvent @0x9b1657f34caf3ad3 {
manualRestart @30;
lowSpeedLockout @31;
plannerError @32;
debugAlert @34;
joystickDebug @34;
steerTempUnavailableUserOverride @35;
resumeRequired @36;
preDriverDistracted @37;
@@ -90,6 +90,7 @@ struct CarEvent @0x9b1657f34caf3ad3 {
startupNoControl @77;
startupMaster @78;
startupFuzzyFingerprint @97;
startupNoFw @104;
fcw @79;
steerSaturated @80;
belowEngageSpeed @84;
@@ -103,6 +104,11 @@ struct CarEvent @0x9b1657f34caf3ad3 {
processNotRunning @95;
dashcamMode @96;
controlsInitializing @98;
usbError @99;
roadCameraError @100;
driverCameraError @101;
wideRoadCameraError @102;
localizerMalfunction @103;
radarCanErrorDEPRECATED @15;
radarCommIssueDEPRECATED @67;
@@ -125,16 +131,16 @@ struct CarEvent @0x9b1657f34caf3ad3 {
startupOneplusDEPRECATED @82;
#dp
preLaneChangeLeftALC @99;
preLaneChangeRightALC @100;
manualSteeringRequired @101;
manualSteeringRequiredBlinkersOn @102;
leadCarMoving @103;
preLaneChangeLeftALC @105;
preLaneChangeRightALC @106;
manualSteeringRequired @107;
manualSteeringRequiredBlinkersOn @108;
leadCarMoving @109;
# timebomb assist
timebombWarn @104;
timebombBypassing @105;
timebombBypassed @106;
timebombWarn @110;
timebombBypassing @111;
timebombBypassed @112;
}
}
@@ -159,7 +165,6 @@ struct CarState {
# brake pedal, 0.0-1.0
brake @5 :Float32; # this is user pedal only
brakePressed @6 :Bool; # this is user pedal only
brakeLights @19 :Bool;
# steering wheel
steeringAngleDeg @7 :Float32;
@@ -257,6 +262,7 @@ struct CarState {
}
errorsDEPRECATED @0 :List(CarEvent.EventName);
brakeLights @19 :Bool;
}
# ******* radar state @ 20hz *******
@@ -377,6 +383,7 @@ struct CarParams {
enableDsu @5 :Bool; # driving support unit
enableApgs @6 :Bool; # advanced parking guidance system
enableBsm @56 :Bool; # blind spot monitoring
hasStockCamera @57 :Bool; # factory LKAS/LDW camera is present
minEnableSpeed @7 :Float32;
minSteerSpeed @8 :Float32;
@@ -528,6 +535,7 @@ struct CarParams {
automatic @1; # Traditional auto, including DSG
manual @2; # True "stick shift" only
direct @3; # Electric vehicle or other direct drive
cvt @4;
}
struct CarFw {
@@ -572,5 +580,5 @@ struct CarParams {
gateway @1; # Integration at vehicle's CAN gateway
}
isPandaBlack @39: Bool;
isPandaBlackDEPRECATED @39: Bool;
}

View File

@@ -14,16 +14,16 @@ struct DragonConf {
dpThermalStarted @0 :Bool;
dpThermalOverheat @1 :Bool;
dpAtl @2 :Bool;
dpAutoShutdown @3 :Bool;
dpAthenad @4 :Bool;
dpUploader @5 :Bool;
dpSteeringOnSignal @6 :Bool;
dpSignalOffDelay @7 :UInt8;
dpAssistedLcMinMph @8 :Float32;
dpAutoLc @9 :Bool;
dpAutoLcCont @10 :Bool;
dpAutoLcMinMph @11 :Float32;
dpAutoLcDelay @12 :Float32;
dpDashcamd @3 :Bool;
dpAutoShutdown @4 :Bool;
dpAthenad @5 :Bool;
dpUploader @6 :Bool;
dpLateralMode @7 :UInt8;
dpSignalOffDelay @8 :Float32;
dpLcMinMph @9 :UInt8;
dpLcAutoCont @10 :Bool;
dpLcAutoMinMph @11 :UInt8;
dpLcAutoDelay @12 :Float32;
dpAllowGas @13 :Bool;
dpFollowingProfileCtrl @14 :Bool;
dpFollowingProfile @15 :UInt8;
@@ -31,7 +31,7 @@ struct DragonConf {
dpAccelProfile @17 :UInt8;
dpGearCheck @18 :Bool;
dpSpeedCheck @19 :Bool;
dpUiScreenOffReversing @20 :Bool;
dpUiDisplayMode @20 :UInt8;
dpUiSpeed @21 :Bool;
dpUiEvent @22 :Bool;
dpUiMaxSpeed @23 :Bool;
@@ -41,18 +41,17 @@ struct DragonConf {
dpUiDev @27 :Bool;
dpUiDevMini @28 :Bool;
dpUiBlinker @29 :Bool;
dpAppExtGps @30 :Bool;
dpAppTomtom @31 :Bool;
dpAppTomtomAuto @32 :Bool;
dpAppTomtomManual @33 :Int8;
dpAppMixplorer @34 :Bool;
dpAppMixplorerManual @35 :Int8;
dpCarDetected @36 :Text;
dpToyotaLdw @37 :Bool;
dpToyotaSng @38 :Bool;
dpVwPanda @39 :Bool;
dpVwTimebombAssist @40 :Bool;
dpIpAddr @41 :Text;
dpLocale @42 :Text;
dpDebug @43 :Bool;
dpUiBrightness @30 :UInt8;
dpUiVolume @31 :Int8;
dpToyotaLdw @32 :Bool;
dpToyotaSng @33 :Bool;
dpVwTimebombAssist @34 :Bool;
dpIpAddr @35 :Text;
dpCameraOffset @36 :Int8;
dpPathOffset @37 :Int8;
dpLocale @38 :Text;
dpSrLearner @39 :Bool;
dpSrCustom @40 :Float32;
dpAppd @41 :Bool;
dpDebug @42 :Bool;
}

View File

@@ -24,6 +24,7 @@ struct Map(Key, Value) {
struct InitData {
kernelArgs @0 :List(Text);
kernelVersion @15 :Text;
osVersion @18 :Text;
gctx @1 :Text;
dongleId @2 :Text;
@@ -282,6 +283,7 @@ struct DeviceState @0xa4d8b5af2aa492eb {
cpuUsagePercent @20 :Int8;
usbOnline @12 :Bool;
networkType @22 :NetworkType;
networkInfo @31 :NetworkInfo;
offroadPowerUsageUwh @23 :UInt32;
networkStrength @24 :NetworkStrength;
carBatteryCapacityUwh @25 :UInt32;
@@ -290,6 +292,8 @@ struct DeviceState @0xa4d8b5af2aa492eb {
started @11 :Bool;
startedMonoTime @13 :UInt64;
lastAthenaPingTime @32 :UInt64;
# power
batteryPercent @8 :Int16;
batteryStatus @9 :Text;
@@ -330,6 +334,15 @@ struct DeviceState @0xa4d8b5af2aa492eb {
great @4;
}
struct NetworkInfo {
technology @0 :Text;
operator @1 :Text;
band @2 :Text;
channel @3 :UInt16;
extra @4 :Text;
state @5 :Text;
}
# deprecated
cpu0DEPRECATED @0 :UInt16;
cpu1DEPRECATED @1 :UInt16;
@@ -363,6 +376,8 @@ struct PandaState @0xa7649e2575e4591e {
powerSaveEnabled @16 :Bool;
uptime @17 :UInt32;
faults @18 :List(FaultType);
harnessStatus @21 :HarnessStatus;
heartbeatLost @22 :Bool;
enum FaultStatus {
none @0;
@@ -413,6 +428,12 @@ struct PandaState @0xa7649e2575e4591e {
dcp @3;
}
enum HarnessStatus {
notConnected @0;
normal @1;
flipped @2;
}
startedSignalDetectedDEPRECATED @5 :Bool;
}
@@ -678,10 +699,24 @@ struct ModelDataV2 {
struct MetaData {
engagedProb @0 :Float32;
desirePrediction @1 :List(Float32);
brakeDisengageProb @2 :Float32;
gasDisengageProb @3 :Float32;
steerOverrideProb @4 :Float32;
desireState @5 :List(Float32);
disengagePredictions @6 :DisengagePredictions;
hardBrakePredicted @7 :Bool;
# deprecated
brakeDisengageProbDEPRECATED @2 :Float32;
gasDisengageProbDEPRECATED @3 :Float32;
steerOverrideProbDEPRECATED @4 :Float32;
}
struct DisengagePredictions {
t @0 :List(Float32);
brakeDisengageProbs @1 :List(Float32);
gasDisengageProbs @2 :List(Float32);
steerOverrideProbs @3 :List(Float32);
brake3MetersPerSecondSquaredProbs @4 :List(Float32);
brake4MetersPerSecondSquaredProbs @5 :List(Float32);
brake5MetersPerSecondSquaredProbs @6 :List(Float32);
}
}
@@ -872,6 +907,8 @@ struct LiveLocationKalman {
gpsOK @19 :Bool = true;
sensorsOK @21 :Bool = true;
deviceStable @22 :Bool = true;
timeSinceReset @23 :Float64;
excessiveResets @24 :Bool;
enum Status {
uninitialized @0;
@@ -1255,6 +1292,7 @@ struct Sentinel {
startOfRoute @3;
}
type @0 :SentinelType;
signal @1 :Int32;
}
struct ManagerState {

View File

@@ -66,13 +66,13 @@ public:
class SubMaster {
public:
SubMaster(const std::initializer_list<const char *> &service_list,
const char *address = nullptr, const std::initializer_list<const char *> &ignore_alive = {});
SubMaster(const std::vector<const char *> &service_list,
const char *address = nullptr, const std::vector<const char *> &ignore_alive = {});
void update(int timeout = 1000);
void update_msgs(uint64_t current_time, std::vector<std::pair<std::string, cereal::Event::Reader>> messages);
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); }
inline bool allAlive(const std::vector<const char *> &service_list = {}) { return all_(service_list, false, true); }
inline bool allValid(const std::vector<const char *> &service_list = {}) { return all_(service_list, true, false); }
inline bool allAliveAndValid(const std::vector<const char *> &service_list = {}) { return all_(service_list, true, true); }
void drain();
~SubMaster();
@@ -82,10 +82,10 @@ public:
bool valid(const char *name) const;
uint64_t rcv_frame(const char *name) const;
uint64_t rcv_time(const char *name) const;
cereal::Event::Reader &operator[](const char *name);
cereal::Event::Reader &operator[](const char *name) const;
private:
bool all_(const std::initializer_list<const char *> &service_list, bool valid, bool alive);
bool all_(const std::vector<const char *> &service_list, bool valid, bool alive);
Poller *poller_ = nullptr;
struct SubMessage;
std::map<SubSocket *, SubMessage *> messages_;
@@ -117,7 +117,7 @@ private:
class PubMaster {
public:
PubMaster(const std::initializer_list<const char *> &service_list);
PubMaster(const std::vector<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, MessageBuilder &msg);
~PubMaster();

View File

@@ -5,7 +5,7 @@
#include <atomic>
#define DEFAULT_SEGMENT_SIZE (10 * 1024 * 1024)
#define NUM_READERS 8
#define NUM_READERS 10
#define ALIGN(n) ((n + (8 - 1)) & -8)
#define UNPACK64(higher, lower, input) do {uint64_t tmp = input; higher = tmp >> 32; lower = tmp & 0xFFFFFFFF;} while (0)

View File

@@ -2,6 +2,7 @@
#include <assert.h>
#include <stdlib.h>
#include <string>
#include <mutex>
#include "services.h"
#include "messaging.h"
@@ -21,7 +22,7 @@ static const service *get_service(const char *name) {
return nullptr;
}
static inline bool inList(const std::initializer_list<const char *> &list, const char *value) {
static inline bool inList(const std::vector<const char *> &list, const char *value) {
for (auto &v : list) {
if (strcmp(value, v) == 0) return true;
}
@@ -30,11 +31,18 @@ static inline bool inList(const std::initializer_list<const char *> &list, const
class MessageContext {
public:
MessageContext() { ctx_ = Context::create(); }
MessageContext() : ctx_(nullptr) {};
~MessageContext() { delete ctx_; }
inline Context *context() {
std::call_once(init_flag, [=]() { ctx_ = Context::create(); });
return ctx_;
}
private:
Context *ctx_;
std::once_flag init_flag;
};
MessageContext ctx;
MessageContext message_context;
struct SubMaster::SubMessage {
std::string name;
@@ -48,13 +56,13 @@ struct SubMaster::SubMessage {
cereal::Event::Reader event;
};
SubMaster::SubMaster(const std::initializer_list<const char *> &service_list, const char *address,
const std::initializer_list<const char *> &ignore_alive) {
SubMaster::SubMaster(const std::vector<const char *> &service_list, const char *address,
const std::vector<const char *> &ignore_alive) {
poller_ = Poller::create();
for (auto name : service_list) {
const service *serv = get_service(name);
assert(serv != nullptr);
SubSocket *socket = SubSocket::create(ctx.ctx_, name, address ? address : "127.0.0.1", true);
SubSocket *socket = SubSocket::create(message_context.context(), name, address ? address : "127.0.0.1", true);
assert(socket != 0);
poller_->registerSocket(socket);
SubMessage *m = new SubMessage{
@@ -63,6 +71,7 @@ SubMaster::SubMaster(const std::initializer_list<const char *> &service_list, co
.freq = serv->frequency,
.ignore_alive = inList(ignore_alive, name),
.allocated_msg_reader = malloc(sizeof(capnp::FlatArrayMessageReader))};
m->msg_reader = new (m->allocated_msg_reader) capnp::FlatArrayMessageReader({});
messages_[socket] = m;
services_[name] = m;
}
@@ -82,9 +91,7 @@ void SubMaster::update(int timeout) {
SubMessage *m = messages_.at(s);
if (m->msg_reader) {
m->msg_reader->~FlatArrayMessageReader();
}
m->msg_reader->~FlatArrayMessageReader();
m->msg_reader = new (m->allocated_msg_reader) capnp::FlatArrayMessageReader(m->aligned_buf.align(msg));
delete msg;
messages.push_back({m->name, m->msg_reader->getRoot<cereal::Event>()});
@@ -118,7 +125,7 @@ void SubMaster::update_msgs(uint64_t current_time, std::vector<std::pair<std::st
}
}
bool SubMaster::all_(const std::initializer_list<const char *> &service_list, bool valid, bool alive) {
bool SubMaster::all_(const std::vector<const char *> &service_list, bool valid, bool alive) {
int found = 0;
for (auto &kv : messages_) {
SubMessage *m = kv.second;
@@ -162,7 +169,7 @@ uint64_t SubMaster::rcv_time(const char *name) const {
return services_.at(name)->rcv_time;
}
cereal::Event::Reader &SubMaster::operator[](const char *name) {
cereal::Event::Reader &SubMaster::operator[](const char *name) const {
return services_.at(name)->event;
};
@@ -170,19 +177,17 @@ SubMaster::~SubMaster() {
delete poller_;
for (auto &kv : messages_) {
SubMessage *m = kv.second;
if (m->msg_reader) {
m->msg_reader->~FlatArrayMessageReader();
}
m->msg_reader->~FlatArrayMessageReader();
free(m->allocated_msg_reader);
delete m->socket;
delete m;
}
}
PubMaster::PubMaster(const std::initializer_list<const char *> &service_list) {
PubMaster::PubMaster(const std::vector<const char *> &service_list) {
for (auto name : service_list) {
assert(get_service(name) != nullptr);
PubSocket *socket = PubSocket::create(ctx.ctx_, name);
PubSocket *socket = PubSocket::create(message_context.context(), name);
assert(socket);
sockets_[name] = socket;
}

12
cereal/services.py Normal file → Executable file
View File

@@ -2,7 +2,7 @@
import os
from typing import Optional
EON = os.path.isfile('/EON')
TICI = os.path.isfile('/TICI')
RESERVED_PORT = 8022 # sshd
STARTING_PORT = 8001
@@ -55,10 +55,10 @@ services = {
"thumbnail": (True, 0.2, 1),
"carEvents": (True, 1., 1),
"carParams": (True, 0.02, 1),
"driverCameraState": (True, 10. if EON else 20., 1),
"driverEncodeIdx": (True, 10. if EON else 20., 1),
"driverState": (True, 10. if EON else 20., 1),
"driverMonitoringState": (True, 10. if EON else 20., 1),
"driverCameraState": (True, 10. if not TICI else 20., 1),
"driverEncodeIdx": (True, 10. if not TICI else 20., 1),
"driverState": (True, 10. if not TICI else 20., 1),
"driverMonitoringState": (True, 10. if not TICI else 20., 1),
"offroadLayout": (False, 0.),
"wideRoadEncodeIdx": (True, 20., 1),
"wideRoadCameraState": (True, 20., 1),
@@ -88,7 +88,7 @@ def build_header():
for k, v in service_list.items():
should_log = "true" if v.should_log else "false"
decimation = -1 if v.decimation is None else v.decimation
h += ' { .name = "%s", .port = %d, .should_log = %s, .frequency = %d, .decimation = %d },\n' % \
h += ' { "%s", %d, %s, %d, %d },\n' % \
(k, v.port, should_log, v.frequency, decimation)
h += "};\n"
h += "#endif\n"

View File

@@ -15,7 +15,7 @@ extern "C" void compute_aligned_width_and_height(int width,
#endif
void visionbuf_compute_aligned_width_and_height(int width, int height, int *aligned_w, int *aligned_h) {
#if defined(QCOM) && !defined(QCOM_REPLAY)
#ifdef QCOM
compute_aligned_width_and_height(ALIGN(width, 32), ALIGN(height, 32), 3, 0, 0, 512, aligned_w, aligned_h);
#else
*aligned_w = width; *aligned_h = height;

View File

@@ -16,7 +16,7 @@ def is_online():
def common_controller_ctrl(enabled, dragonconf, blinker_on, steer_req, v_ego):
if enabled:
if dragonconf.dpSteeringOnSignal and blinker_on:
if dragonconf.dpLateralMode == 0 and blinker_on:
steer_req = 0 if isinstance(steer_req, int) else False
return steer_req
@@ -32,7 +32,7 @@ def common_interface_atl(ret, atl):
return enable_acc
def common_interface_get_params_lqr(ret):
if params.get('dp_lqr') == b'1':
if params.get_bool('dp_lqr'):
ret.lateralTuning.init('lqr')
ret.lateralTuning.lqr.scale = 1500.0
ret.lateralTuning.lqr.ki = 0.05

View File

@@ -9,7 +9,7 @@ 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.)
* update_once: True, False (the param will only load up once, need both param and struct defined)
'''
confs = [
# thermald data
@@ -17,117 +17,85 @@ confs = [
{'name': 'dp_thermal_overheat', 'default': False, 'type': 'Bool', 'conf_type': ['struct']},
{'name': 'dp_atl', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct'], 'update_once': True},
# 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_ui', 'default': 0, 'type': 'Bool', 'conf_type': ['param', 'struct']},
{'name': 'dp_dashcamd', 'default': False, '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']},
{'name': 'dp_auto_shutdown_in', 'default': 90, 'type': 'UInt16', 'min': 0, 'max': 600, 'depends': [{'name': 'dp_auto_shutdown', 'vals': [True]}], 'conf_type': ['param']},
# service
{'name': 'dp_updated', 'default': True, 'type': 'Bool', 'conf_type': ['param']},
{'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_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']},
# {'name': 'dp_steering_limit_alert', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_lat_ctrl', 'vals': [True]}], 'conf_type': ['param', 'struct']},
{'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': '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': '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']},
{'name': 'dp_lateral_mode', 'default': 1, 'type': 'UInt8', 'min': 0, 'max': 2, 'conf_type': ['param', 'struct']},
{'name': 'dp_signal_off_delay', 'default': 3., 'type': 'Float32', 'min': 0., 'max': 10., 'depends': [{'name': 'dp_lateral_mode', 'vals': [0]}], 'conf_type': ['param', 'struct']},
{'name': 'dp_lc_min_mph', 'default': 45, 'type': 'UInt8', 'min': 0, 'max': 255, 'depends': [{'name': 'dp_lateral_mode', 'vals': [1,2]}], 'conf_type': ['param', 'struct']},
{'name': 'dp_lc_auto_cont', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_lateral_mode', 'vals': [2]}], 'conf_type': ['param', 'struct']},
{'name': 'dp_lc_auto_min_mph', 'default': 60, 'type': 'UInt8', 'min': 0, 'max': 255, 'depends': [{'name': 'dp_lateral_mode', 'vals': [2]}], 'conf_type': ['param', 'struct']},
{'name': 'dp_lc_auto_delay', 'default': 3., 'type': 'Float32', 'min': 0., 'max': 10., 'depends': [{'name': 'dp_lateral_mode', 'vals': [2]}], 'conf_type': ['param', 'struct']},
# long ctrl
{'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_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_following_profile_ctrl', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param', 'struct']},
{'name': 'dp_following_profile', 'default': 0, 'type': 'UInt8', 'min': 0, 'max': 4, 'depends': [{'name': 'dp_atl', 'vals': [False]}, {'name': 'dp_following_profile_ctrl', 'vals': [True]}], 'conf_type': ['param', 'struct']},
{'name': 'dp_following_profile', 'default': 0, 'type': 'UInt8', 'min': 0, 'max': 2, 'depends': [{'name': 'dp_atl', 'vals': [False]}, {'name': 'dp_following_profile_ctrl', 'vals': [True]}], 'conf_type': ['param', 'struct']},
{'name': 'dp_accel_profile_ctrl', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param', 'struct']},
{'name': 'dp_accel_profile', 'default': 0, 'type': 'UInt8', 'min': 0, 'max': 3, 'depends': [{'name': 'dp_atl', 'vals': [False]}, {'name': 'dp_accel_profile_ctrl', 'vals': [True]}], 'conf_type': ['param', 'struct']},
{'name': 'dp_accel_profile', 'default': 0, 'type': 'UInt8', 'min': 0, 'max': 2, 'depends': [{'name': 'dp_atl', 'vals': [False]}, {'name': 'dp_accel_profile_ctrl', 'vals': [True]}], '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_speed_check', 'default': True, 'type': 'Bool', 'depends': [{'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param', 'struct']},
{'name': 'dp_speed_check', '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': [], 'conf_type': ['param', 'struct']},
{'name': 'dp_ui_speed', 'default': True, 'type': 'Bool', 'depends': [], 'conf_type': ['param', 'struct']},
{'name': 'dp_ui_event', 'default': True, 'type': 'Bool', 'depends': [], 'conf_type': ['param', 'struct']},
{'name': 'dp_ui_max_speed', 'default': True, 'type': 'Bool', 'depends': [], 'conf_type': ['param', 'struct']},
{'name': 'dp_ui_face', 'default': True, 'type': 'Bool', 'depends': [], 'conf_type': ['param', 'struct']},
{'name': 'dp_ui_lane', 'default': True, 'type': 'Bool', 'depends': [], 'conf_type': ['param', 'struct']},
# {'name': 'dp_ui_path', 'default': True, 'type': 'Bool', 'depends': [], 'conf_type': ['param', 'struct']},
{'name': 'dp_ui_lead', 'default': True, 'type': 'Bool', 'depends': [], 'conf_type': ['param', 'struct']},
{'name': 'dp_ui_display_mode', 'default': 0, 'type': 'UInt8', 'min': 0, 'max': 2, 'conf_type': ['param', 'struct']},
{'name': 'dp_ui_speed', 'default': True, 'type': 'Bool', 'conf_type': ['param', 'struct']},
{'name': 'dp_ui_event', 'default': True, 'type': 'Bool', 'conf_type': ['param', 'struct']},
{'name': 'dp_ui_max_speed', 'default': True, 'type': 'Bool', 'conf_type': ['param', 'struct']},
{'name': 'dp_ui_face', 'default': True, 'type': 'Bool', 'conf_type': ['param', 'struct']},
{'name': 'dp_ui_lane', 'default': True, 'type': 'Bool', 'conf_type': ['param', 'struct']},
{'name': 'dp_ui_lead', 'default': True, 'type': 'Bool', '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': [], '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
# {'name': 'dp_app_auto_update', 'default': True, 'type': 'Bool', 'conf_type': ['param', 'struct']},
{'name': 'dp_app_ext_gps', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
{'name': 'dp_app_tomtom', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
{'name': 'dp_app_tomtom_auto', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_app_tomtom', 'vals': [True]}], 'conf_type': ['param', 'struct']},
{'name': 'dp_app_tomtom_manual', 'default': 0, 'type': 'Int8', 'min': -1, 'max': 1, 'depends': [{'name': 'dp_app_tomtom', 'vals': [True]}], 'conf_type': ['param', 'struct']},
# {'name': 'dp_app_autonavi', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
# {'name': 'dp_app_autonavi_auto', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_app_autonavi', 'vals': [True]}], 'conf_type': ['param', 'struct']},
# {'name': 'dp_app_autonavi_manual', 'default': 0, 'type': 'Int8', 'min': -1, 'max': 1, 'depends': [{'name': 'dp_app_autonavi', 'vals': [True]}], 'conf_type': ['param', 'struct']},
# {'name': 'dp_app_aegis', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
# {'name': 'dp_app_aegis_auto', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_app_aegis', 'vals': [True]}], 'conf_type': ['param', 'struct']},
# {'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']},
# 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', 'struct']},
{'name': 'dp_ui_blinker', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
{'name': 'dp_ui_brightness', 'default': 0, 'type': 'UInt8', 'min': 0, 'max': 100, 'conf_type': ['param', 'struct']},
{'name': 'dp_ui_volume', 'default': -5, 'type': 'Int8', 'min': -5, 'max': 100, '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']},
{'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_disable_relay', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
# 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']},
# volkswagen
{'name': 'dp_vw_panda', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct'], 'update_once': True},
{'name': 'dp_vw_panda', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
{'name': 'dp_vw_timebomb_assist', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
#misc
{'name': 'dp_ip_addr', 'default': '', 'type': 'Text', 'conf_type': ['struct']},
{'name': 'dp_c2_fan_quiet_mode', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
{'name': 'dp_fan_mode', 'default': 0, 'type': 'UInt8', 'min': 0, 'max': 2, 'conf_type': ['param']},
{'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_camera_offset', 'default': 6, 'type': 'Int8', 'min': -100, 'max': 100, 'conf_type': ['param', 'struct']},
{'name': 'dp_path_offset', 'default': 0, 'type': 'Int8', 'min': -100, 'max': 100, 'conf_type': ['param', 'struct']},
{'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_reg', 'default': True, 'type': 'Bool', 'conf_type': ['param']},
# sr learner related
{'name': 'dp_sr_learner', 'default': True, 'type': 'Bool', 'conf_type': ['param', 'struct']},
{'name': 'dp_sr_custom', 'default': 9.99, 'min': 9.99, 'max': 30., 'type': 'Float32', 'depends': [{'name': 'dp_sr_learner', 'vals': [False]}], 'conf_type': ['param', 'struct']},
{'name': 'dp_sr_stock', 'default': 9.99, 'min': 9.99, 'max': 100., 'type': 'Float32', 'conf_type': ['param']},
{'name': 'dp_sr_learner', 'default': True, 'type': 'Bool', 'conf_type': ['param']},
{'name': 'dp_lqr', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
{'name': 'dp_reset_live_param_on_start', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
{'name': 'dp_jetson', 'default': False, 'type': 'Bool', 'conf_type': ['param'], 'update_once': True},
{'name': 'dp_appd', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
{'name': 'dp_jetson', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
{'name': 'dp_car_assigned', 'default': '', 'type': 'Text', 'conf_type': ['param']},
{'name': 'dp_car_list', 'default': '', 'type': 'Text', 'conf_type': ['param']},
{'name': 'dp_no_batt', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
{'name': 'dp_panda_fake_black', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
{'name': 'dp_panda_no_gps', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
{'name': 'dp_last_candidate', 'default': '', 'type': 'Text', 'conf_type': ['param']},
{'name': 'dp_debug', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
]
@@ -198,7 +166,7 @@ function to generate support car list
'''
def get_support_car_list():
attrs = ['FINGERPRINTS', 'FW_VERSIONS']
cars = dict()
cars = dict({"cars": []})
for car_folder in [x[0] for x in os.walk('/data/openpilot/selfdrive/car')]:
try:
car_name = car_folder.split('/')[-1]
@@ -210,13 +178,13 @@ def get_support_car_list():
attr_values = getattr(values, attr)
else:
continue
if isinstance(attr_values, dict):
for f, v in attr_values.items():
if f not in names:
names.append(f)
names.sort()
cars[car_name] = names
brand_models = {"brand": car_name.upper(), "models": names }
cars["cars"].append(brand_models)
except (ImportError, IOError, ValueError):
pass
return json.dumps(cars)
@@ -236,7 +204,7 @@ def init_params_vals(params):
def gen_params_cc_keys():
for conf in confs:
if 'param' in conf['conf_type']:
print("{\"%s\", PERSISTENT}," % conf['name'])
print(" {\"%s\", PERSISTENT}," % conf['name'])
if __name__ == "__main__":

View File

@@ -12,7 +12,8 @@ cdef extern from "selfdrive/common/params.h":
PERSISTENT
CLEAR_ON_MANAGER_START
CLEAR_ON_PANDA_DISCONNECT
CLEAR_ON_IGNITION
CLEAR_ON_IGNITION_ON
CLEAR_ON_IGNITION_OFF
ALL
cdef cppclass Params:

View File

@@ -13,7 +13,8 @@ cdef class ParamKeyType:
PERSISTENT = c_ParamKeyType.PERSISTENT
CLEAR_ON_MANAGER_START = c_ParamKeyType.CLEAR_ON_MANAGER_START
CLEAR_ON_PANDA_DISCONNECT = c_ParamKeyType.CLEAR_ON_PANDA_DISCONNECT
CLEAR_ON_IGNITION = c_ParamKeyType.CLEAR_ON_IGNITION
CLEAR_ON_IGNITION_ON = c_ParamKeyType.CLEAR_ON_IGNITION_ON
CLEAR_ON_IGNITION_OFF = c_ParamKeyType.CLEAR_ON_IGNITION_OFF
ALL = c_ParamKeyType.ALL
def ensure_bytes(v):

View File

@@ -3,6 +3,7 @@ import gc
import os
import time
import multiprocessing
from typing import Optional
from common.clock import sec_since_boot # pylint: disable=no-name-in-module, import-error
from selfdrive.hardware import PC, TICI, JETSON
@@ -31,49 +32,49 @@ class Priority:
CTRL_HIGH = 53
def set_realtime_priority(level):
def set_realtime_priority(level: int) -> None:
if JETSON or not PC:
os.sched_setscheduler(0, os.SCHED_FIFO, os.sched_param(level))
os.sched_setscheduler(0, os.SCHED_FIFO, os.sched_param(level)) # type: ignore[attr-defined]
def set_core_affinity(core):
def set_core_affinity(core: int) -> None:
if JETSON or not PC:
os.sched_setaffinity(0, [core,])
def config_realtime_process(core, priority):
def config_realtime_process(core: int, priority: int) -> None:
gc.disable()
set_realtime_priority(priority)
set_core_affinity(core)
class Ratekeeper():
def __init__(self, rate, print_delay_threshold=0.):
class Ratekeeper:
def __init__(self, rate: int, print_delay_threshold: Optional[float] = 0.0) -> None:
"""Rate in Hz for ratekeeping. print_delay_threshold must be nonnegative."""
self._interval = 1. / rate
self._next_frame_time = sec_since_boot() + self._interval
self._print_delay_threshold = print_delay_threshold
self._frame = 0
self._remaining = 0
self._remaining = 0.0
self._process_name = multiprocessing.current_process().name
@property
def frame(self):
def frame(self) -> int:
return self._frame
@property
def remaining(self):
def remaining(self) -> float:
return self._remaining
# Maintain loop rate by calling this at the end of each loop
def keep_time(self):
def keep_time(self) -> bool:
lagged = self.monitor_time()
if self._remaining > 0:
time.sleep(self._remaining)
return lagged
# this only monitor the cumulative lag, but does not enforce a rate
def monitor_time(self):
def monitor_time(self) -> bool:
lagged = False
remaining = self._next_frame_time - sec_since_boot()
self._next_frame_time += self._interval

View File

@@ -1,6 +1,6 @@
{
"ota_url": "https://commadist.azureedge.net/neosupdate/ota-signed-969e22c42e5c6314e54bc3ccaa5c6a684f3130a53a7a70e0cea9f1453ceb0b06.zip",
"ota_hash": "969e22c42e5c6314e54bc3ccaa5c6a684f3130a53a7a70e0cea9f1453ceb0b06",
"ota_url": "https://commadist.azureedge.net/neosupdate/ota-signed-c4f56c62c5603c86e2ae9d83008a8d42a91319979661d0c42fb97b85d9112266.zip",
"ota_hash": "c4f56c62c5603c86e2ae9d83008a8d42a91319979661d0c42fb97b85d9112266",
"recovery_url": "https://commadist.azureedge.net/neosupdate/recovery-db31ffe79dfd60be966fba6d1525a5081a920062b883644dc8f5734bcc6806bb.img",
"recovery_len": 15926572,
"recovery_hash": "db31ffe79dfd60be966fba6d1525a5081a920062b883644dc8f5734bcc6806bb"

View File

@@ -1,7 +1,7 @@
{
"ota_url": "https://commadist.azureedge.net/neosupdate/ota-signed-969e22c42e5c6314e54bc3ccaa5c6a684f3130a53a7a70e0cea9f1453ceb0b06.zip",
"ota_hash": "969e22c42e5c6314e54bc3ccaa5c6a684f3130a53a7a70e0cea9f1453ceb0b06",
"recovery_url": "https://commadist.azureedge.net/neosupdate/recovery-9c784a24826c25df315d0ace864224478e9c0e86b904f5d1f8e18ea1037e842b.img",
"ota_url": "https://commadist.azureedge.net/neosupdate/ota-signed-c4f56c62c5603c86e2ae9d83008a8d42a91319979661d0c42fb97b85d9112266.zip",
"ota_hash": "c4f56c62c5603c86e2ae9d83008a8d42a91319979661d0c42fb97b85d9112266",
"recovery_url": "https://commadist.azureedge.net/neosupdate/recovery-c5db3790c3b09756e8e896187ddb3f1258315eb0a86030468baa187b84a3bbf5.img",
"recovery_len": 15209772,
"recovery_hash": "9c784a24826c25df315d0ace864224478e9c0e86b904f5d1f8e18ea1037e842b"
"recovery_hash": "c5db3790c3b09756e8e896187ddb3f1258315eb0a86030468baa187b84a3bbf5"
}

View File

@@ -1,803 +0,0 @@
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <unistd.h>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <memory>
#include <mutex>
#include <sstream>
#include <string>
#include <thread>
#include <curl/curl.h>
#include <openssl/sha.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES3/gl3.h>
#include "nanovg.h"
#define NANOVG_GLES3_IMPLEMENTATION
#include "json11.hpp"
#include "nanovg_gl.h"
#include "nanovg_gl_utils.h"
#include "selfdrive/common/framebuffer.h"
#include "selfdrive/common/touch.h"
#include "selfdrive/common/util.h"
#define USER_AGENT "NEOSUpdater-0.2"
#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"
#define UPDATE_DIR "/data/neoupdate"
extern const uint8_t bin_opensans_regular[] asm("_binary_opensans_regular_ttf_start");
extern const uint8_t bin_opensans_regular_end[] asm("_binary_opensans_regular_ttf_end");
extern const uint8_t bin_opensans_semibold[] asm("_binary_opensans_semibold_ttf_start");
extern const uint8_t bin_opensans_semibold_end[] asm("_binary_opensans_semibold_ttf_end");
extern const uint8_t bin_opensans_bold[] asm("_binary_opensans_bold_ttf_start");
extern const uint8_t bin_opensans_bold_end[] asm("_binary_opensans_bold_ttf_end");
namespace {
std::string sha256_file(std::string fn, size_t limit=0) {
SHA256_CTX ctx;
SHA256_Init(&ctx);
FILE *file = fopen(fn.c_str(), "rb");
if (!file) return "";
const size_t buf_size = 8192;
std::unique_ptr<char[]> buffer( new char[ buf_size ] );
bool read_limit = (limit != 0);
while (true) {
size_t read_size = buf_size;
if (read_limit) read_size = std::min(read_size, limit);
size_t bytes_read = fread(buffer.get(), 1, read_size, file);
if (!bytes_read) break;
SHA256_Update(&ctx, buffer.get(), bytes_read);
if (read_limit) {
limit -= bytes_read;
if (limit == 0) break;
}
}
uint8_t hash[SHA256_DIGEST_LENGTH];
SHA256_Final(hash, &ctx);
fclose(file);
return util::tohex(hash, sizeof(hash));
}
size_t download_string_write(void *ptr, size_t size, size_t nmeb, void *up) {
size_t sz = size * nmeb;
((std::string*)up)->append((char*)ptr, sz);
return sz;
}
std::string download_string(CURL *curl, std::string url) {
std::string os;
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 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);
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, download_string_write);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &os);
CURLcode res = curl_easy_perform(curl);
if (res != CURLE_OK) {
return "";
}
return os;
}
size_t download_file_write(void *ptr, size_t size, size_t nmeb, void *up) {
return fwrite(ptr, size, nmeb, (FILE*)up);
}
int battery_capacity() {
std::string bat_cap_s = util::read_file("/sys/class/power_supply/battery/capacity");
return atoi(bat_cap_s.c_str());
}
int battery_current() {
std::string current_now_s = util::read_file("/sys/class/power_supply/battery/current_now");
return atoi(current_now_s.c_str());
}
bool check_battery() {
int bat_cap = battery_capacity();
int current_now = battery_current();
return bat_cap > 35 || (current_now < 0 && bat_cap > 10);
}
bool check_space() {
struct statvfs stat;
if (statvfs("/data/", &stat) != 0) {
return false;
}
size_t space = stat.f_bsize * stat.f_bavail;
return space > 2000000000ULL; // 2GB
}
static void start_settings_activity(const char* name) {
char launch_cmd[1024];
snprintf(launch_cmd, sizeof(launch_cmd),
"am start -W --ez :settings:show_fragment_as_subsetting true -n 'com.android.settings/.%s'", 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;
TouchState touch;
int fb_w, fb_h;
std::unique_ptr<FrameBuffer> fb;
NVGcontext *vg = NULL;
int font_regular;
int font_semibold;
int font_bold;
std::thread update_thread_handle;
std::mutex lock;
enum UpdateState {
CONFIRMATION,
LOW_BATTERY,
RUNNING,
ERROR,
};
UpdateState state;
std::string progress_text;
float progress_frac;
std::string error_text;
std::string low_battery_text;
std::string low_battery_title;
std::string low_battery_context;
std::string battery_cap_text;
int min_battery_cap = 35;
// button
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;
void ui_init() {
touch_init(&touch);
fb = std::make_unique<FrameBuffer>("updater", 0x00001000, false, &fb_w, &fb_h);
fb->set_power(HWC_POWER_MODE_NORMAL);
vg = nvgCreateGLES3(NVG_ANTIALIAS | NVG_STENCIL_STROKES | NVG_DEBUG);
assert(vg);
font_regular = nvgCreateFontMem(vg, "opensans_regular", (unsigned char*)bin_opensans_regular, (bin_opensans_regular_end - bin_opensans_regular), 0);
assert(font_regular >= 0);
font_semibold = nvgCreateFontMem(vg, "opensans_semibold", (unsigned char*)bin_opensans_semibold, (bin_opensans_semibold_end - bin_opensans_semibold), 0);
assert(font_semibold >= 0);
font_bold = nvgCreateFontMem(vg, "opensans_bold", (unsigned char*)bin_opensans_bold, (bin_opensans_bold_end - bin_opensans_bold), 0);
assert(font_bold >= 0);
b_w = 640;
balt_x = 200;
b_x = fb_w-b_w-200;
b_y = 720;
b_h = 220;
if (download_stage(true)) {
state = RUNNING;
update_thread_handle = std::thread(&Updater::run_stages, this);
} else {
state = CONFIRMATION;
}
}
int download_file_xferinfo(curl_off_t dltotal, curl_off_t dlno,
curl_off_t ultotal, curl_off_t ulnow) {
{
std::lock_guard<std::mutex> guard(lock);
if (dltotal != 0) {
progress_frac = (float) dlno / dltotal;
}
}
// printf("info: %ld %ld %f\n", dltotal, dlno, progress_frac);
return 0;
}
bool download_file(std::string url, std::string out_fn) {
FILE *of = fopen(out_fn.c_str(), "ab");
assert(of);
CURLcode res;
long last_resume_from = 0;
fseek(of, 0, SEEK_END);
int tries = 4;
bool ret = false;
while (true) {
long resume_from = ftell(of);
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 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);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, download_file_write);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, of);
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
curl_easy_setopt(curl, CURLOPT_XFERINFODATA, this);
curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, &Updater::download_file_xferinfo);
CURLcode res = curl_easy_perform(curl);
long response_code = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
// double content_length = 0.0;
// curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &content_length);
printf("download %s res %d, code %ld, resume from %ld\n", url.c_str(), res, response_code, resume_from);
if (res == CURLE_OK) {
ret = true;
break;
} else if (res == CURLE_HTTP_RETURNED_ERROR && response_code == 416) {
// failed because the file is already complete?
ret = true;
break;
} else if (resume_from == last_resume_from) {
// failed and dind't make make forward progress. only retry a couple times
tries--;
if (tries <= 0) {
break;
}
}
last_resume_from = resume_from;
}
// printf("res %d\n", res);
// printf("- %ld %f\n", response_code, content_length);
fclose(of);
return ret;
}
void set_progress(std::string text) {
std::lock_guard<std::mutex> guard(lock);
progress_text = text;
}
void set_error(std::string text) {
std::lock_guard<std::mutex> guard(lock);
error_text = text;
state = ERROR;
}
void set_battery_low() {
std::lock_guard<std::mutex> guard(lock);
state = LOW_BATTERY;
}
void set_running() {
std::lock_guard<std::mutex> guard(lock);
state = RUNNING;
}
std::string download(std::string url, std::string hash, std::string name, bool dry_run) {
std::string out_fn = UPDATE_DIR "/" + util::base_name(url);
std::string fn_hash = sha256_file(out_fn);
if (dry_run) {
return (hash.compare(fn_hash) != 0) ? "" : out_fn;
}
// start or resume downloading if hash doesn't match
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 + "...");
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;
}
bool download_stage(bool dry_run = false) {
curl = curl_easy_init();
assert(curl);
// ** quick checks before download **
if (!check_space()) {
if (!dry_run) 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", dry_run);
if (recovery_fn.empty()) {
// error'd
return false;
}
}
}
// ** handle ota download **
ota_fn = download(ota_url, ota_hash, "update", dry_run);
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();
while(battery_cap < min_battery_cap) {
battery_cap = battery_capacity();
battery_cap_text = std::to_string(battery_cap);
util::sleep_for(1000);
}
set_running();
}
bool sucess = download_stage();
if (!sucess) {
return;
}
// ** install update **
if (!check_battery()) {
set_battery_low();
int battery_cap = battery_capacity();
while(battery_cap < min_battery_cap) {
battery_cap = battery_capacity();
battery_cap_text = std::to_string(battery_cap);
util::sleep_for(1000);
}
set_running();
}
if (!recovery_fn.empty()) {
// flash recovery
set_progress("Flashing recovery...");
FILE *flash_file = fopen(recovery_fn.c_str(), "rb");
if (!flash_file) {
set_error("failed to flash recovery");
return;
}
FILE *recovery_dev = fopen(RECOVERY_DEV, "w+b");
if (!recovery_dev) {
fclose(flash_file);
set_error("failed to flash recovery");
return;
}
const size_t buf_size = 4096;
std::unique_ptr<char[]> buffer( new char[ buf_size ] );
while (true) {
size_t bytes_read = fread(buffer.get(), 1, buf_size, flash_file);
if (!bytes_read) break;
size_t bytes_written = fwrite(buffer.get(), 1, bytes_read, recovery_dev);
if (bytes_read != bytes_written) {
fclose(recovery_dev);
fclose(flash_file);
set_error("failed to flash recovery: write failed");
return;
}
}
fclose(recovery_dev);
fclose(flash_file);
set_progress("Verifying flash...");
std::string new_recovery_hash = sha256_file(RECOVERY_DEV, recovery_len);
printf("new recovery hash: %s\n", new_recovery_hash.c_str());
if (new_recovery_hash != recovery_hash) {
set_error("recovery flash corrupted");
return;
}
}
// write arguments to recovery
FILE *cmd_file = fopen(RECOVERY_COMMAND, "wb");
if (!cmd_file) {
set_error("failed to reboot into recovery");
return;
}
fprintf(cmd_file, "--update_package=%s\n", ota_fn.c_str());
fclose(cmd_file);
set_progress("Rebooting");
// remove the continue.sh so we come back into the setup.
// maybe we should go directly into the installer, but what if we don't come back with internet? :/
//unlink("/data/data/com.termux/files/continue.sh");
// TODO: this should be generic between android versions
// IPowerManager.reboot(confirm=false, reason="recovery", wait=true)
system("service call power 16 i32 0 s16 recovery i32 1");
while(1) pause();
// execl("/system/bin/reboot", "recovery");
// set_error("failed to reboot into recovery");
}
void draw_ack_screen(const char *title, const char *message, const char *button, const char *altbutton) {
nvgFillColor(vg, nvgRGBA(255,255,255,255));
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE);
nvgFontFace(vg, "opensans_bold");
nvgFontSize(vg, 120.0f);
nvgTextBox(vg, 110, 220, fb_w-240, title, NULL);
nvgFontFace(vg, "opensans_regular");
nvgFontSize(vg, 86.0f);
nvgTextBox(vg, 130, 380, fb_w-260, message, NULL);
// draw button
if (button) {
nvgBeginPath(vg);
nvgFillColor(vg, nvgRGBA(8, 8, 8, 255));
nvgRoundedRect(vg, b_x, b_y, b_w, b_h, 20);
nvgFill(vg);
nvgFillColor(vg, nvgRGBA(255, 255, 255, 255));
nvgFontFace(vg, "opensans_semibold");
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE);
nvgText(vg, b_x+b_w/2, b_y+b_h/2, button, NULL);
nvgBeginPath(vg);
nvgStrokeColor(vg, nvgRGBA(255, 255, 255, 50));
nvgStrokeWidth(vg, 5);
nvgRoundedRect(vg, b_x, b_y, b_w, b_h, 20);
nvgStroke(vg);
}
// draw button
if (altbutton) {
nvgBeginPath(vg);
nvgFillColor(vg, nvgRGBA(8, 8, 8, 255));
nvgRoundedRect(vg, balt_x, b_y, b_w, b_h, 20);
nvgFill(vg);
nvgFillColor(vg, nvgRGBA(255, 255, 255, 255));
nvgFontFace(vg, "opensans_semibold");
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE);
nvgText(vg, balt_x+b_w/2, b_y+b_h/2, altbutton, NULL);
nvgBeginPath(vg);
nvgStrokeColor(vg, nvgRGBA(255, 255, 255, 50));
nvgStrokeWidth(vg, 5);
nvgRoundedRect(vg, balt_x, b_y, b_w, b_h, 20);
nvgStroke(vg);
}
}
void draw_battery_screen() {
low_battery_title = "Low Battery";
low_battery_text = "Please connect EON to your charger. Update will continue once EON battery reaches 35%.";
low_battery_context = "Current battery charge: " + battery_cap_text + "%";
nvgFillColor(vg, nvgRGBA(255,255,255,255));
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE);
nvgFontFace(vg, "opensans_bold");
nvgFontSize(vg, 120.0f);
nvgTextBox(vg, 110, 220, fb_w-240, low_battery_title.c_str(), NULL);
nvgFontFace(vg, "opensans_regular");
nvgFontSize(vg, 86.0f);
nvgTextBox(vg, 130, 380, fb_w-260, low_battery_text.c_str(), NULL);
nvgFontFace(vg, "opensans_bold");
nvgFontSize(vg, 86.0f);
nvgTextBox(vg, 130, 700, fb_w-260, low_battery_context.c_str(), NULL);
}
void draw_progress_screen() {
// draw progress message
nvgFontSize(vg, 64.0f);
nvgFillColor(vg, nvgRGBA(255,255,255,255));
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE);
nvgFontFace(vg, "opensans_bold");
nvgFontSize(vg, 86.0f);
nvgTextBox(vg, 0, 380, fb_w, progress_text.c_str(), NULL);
// draw progress bar
{
int progress_width = 1000;
int progress_x = fb_w/2-progress_width/2;
int progress_y = 520;
int progress_height = 50;
int powerprompt_y = 312;
nvgFontFace(vg, "opensans_regular");
nvgFontSize(vg, 64.0f);
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,
progress_width - 2, progress_height, 3, 4, nvgRGB(27, 27, 27), nvgRGB(27, 27, 27));
nvgBeginPath(vg);
nvgRoundedRect(vg, progress_x, progress_y, progress_width, progress_height, 12);
nvgFillPaint(vg, paint);
nvgFill(vg);
float value = std::min(std::max(0.0f, progress_frac), 1.0f);
int bar_pos = ((progress_width - 2) * value);
paint = nvgBoxGradient(
vg, progress_x, progress_y,
bar_pos+1.5f, progress_height-1, 3, 4,
nvgRGB(245, 245, 245), nvgRGB(105, 105, 105));
nvgBeginPath(vg);
nvgRoundedRect(
vg, progress_x+1, progress_y+1,
bar_pos, progress_height-2, 12);
nvgFillPaint(vg, paint);
nvgFill(vg);
}
}
void ui_draw() {
std::lock_guard<std::mutex> guard(lock);
nvgBeginFrame(vg, fb_w, fb_h, 1.0f);
switch (state) {
case CONFIRMATION:
draw_ack_screen("An update to NEOS is required.",
"Your device will now be reset and upgraded. You may want to connect to wifi as download is around 1 GB. Existing data on device should not be lost.",
"Continue",
"Connect to WiFi");
break;
case LOW_BATTERY:
draw_battery_screen();
break;
case RUNNING:
draw_progress_screen();
break;
case ERROR:
draw_ack_screen("There was an error", (error_text).c_str(), NULL, "Reboot");
break;
}
nvgEndFrame(vg);
}
void ui_update() {
std::lock_guard<std::mutex> guard(lock);
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()) {
if (touch_x >= b_x && touch_x < b_x+b_w && touch_y >= b_y && touch_y < b_y+b_h) {
if (state == CONFIRMATION) {
state = RUNNING;
update_thread_handle = std::thread(&Updater::run_stages, this);
}
}
if (touch_x >= balt_x && touch_x < balt_x+b_w && touch_y >= b_y && touch_y < b_y+b_h) {
if (state == CONFIRMATION) {
start_settings_activity("Settings$WifiSettingsActivity");
} else if (state == ERROR) {
do_exit = 1;
}
}
}
}
}
void go() {
ui_init();
while (!do_exit) {
ui_update();
glClearColor(0.08, 0.08, 0.08, 1.0);
glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
// background
nvgBeginPath(vg);
NVGpaint bg = nvgLinearGradient(vg, fb_w, 0, fb_w, fb_h,
nvgRGBA(0, 0, 0, 0), nvgRGBA(0, 0, 0, 255));
nvgFillPaint(vg, bg);
nvgRect(vg, 0, 0, fb_w, fb_h);
nvgFill(vg);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
ui_draw();
glDisable(GL_BLEND);
fb->swap();
assert(glGetError() == GL_NO_ERROR);
// no simple way to do 30fps vsync with surfaceflinger...
util::sleep_for(30);
}
if (update_thread_handle.joinable()) {
update_thread_handle.join();
}
// reboot
system("service call power 16 i32 0 i32 0 i32 1");
}
};
}
int main(int argc, char *argv[]) {
bool background_cache = false;
if (argc > 1) {
if (strcmp(argv[1], "local") == 0) {
manifest_url = MANIFEST_URL_NEOS_LOCAL;
} else if (strcmp(argv[1], "staging") == 0) {
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;
int err = 0;
if (background_cache) {
err = !updater.download_stage();
} else {
updater.go();
}
return err;
}

View File

@@ -9,6 +9,7 @@ source "$BASEDIR/launch_env.sh"
if ! $(grep -q "letv" /proc/cmdline); then
mount -o remount,rw /system
sed -i -e 's#/dev/input/event1#/dev/input/event2#g' ~/.bash_profile
touch /ONEPLUS
mount -o remount,r /system
fi
@@ -119,6 +120,7 @@ function two_init {
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'
nmcli connection modify --temporary lte gsm.auto-config yes
# set success flag for current boot slot
sudo abctl --set_success
@@ -235,6 +237,9 @@ function launch {
ln -sfn $(pwd) /data/pythonpath
export PYTHONPATH="$PWD"
# dp - ignore chmod changes
git -C $DIR config core.fileMode false
# hardware specific init
if [ -f /EON ]; then
two_init

View File

@@ -7,11 +7,11 @@ export OPENBLAS_NUM_THREADS=1
export VECLIB_MAXIMUM_THREADS=1
if [ -z "$REQUIRED_NEOS_VERSION" ]; then
export REQUIRED_NEOS_VERSION="16.2"
export REQUIRED_NEOS_VERSION="17"
fi
if [ -z "$AGNOS_VERSION" ]; then
export AGNOS_VERSION="0.14"
export AGNOS_VERSION="0.18"
fi
if [ -z "$PASSIVE" ]; then

Binary file not shown.

Binary file not shown.

View File

@@ -36,6 +36,8 @@ cdef class CANParser:
def __init__(self, dbc_name, signals, checks=None, bus=0, enforce_checks=True):
if checks is None:
checks = []
checks = []
enforce_checks = False
self.can_valid = True
self.dbc_name = dbc_name
self.dbc = dbc_lookup(dbc_name)
@@ -74,7 +76,7 @@ cdef class CANParser:
c = (self.msg_name_to_address[name], c[1])
checks[i] = c
if False: #enforce_checks:
if enforce_checks:
checked_addrs = {c[0] for c in checks}
signal_addrs = {s[1] for s in signals}
unchecked = signal_addrs - checked_addrs

View File

@@ -380,7 +380,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_2018_can.dbc starts here";
BO_ 304 GAS_PEDAL_2: 8 PCM
@@ -389,8 +389,14 @@ 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
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_ 401 GEARBOX_15T: 8 PCM
SG_ GEAR_SHIFTER : 5|6@0+ (1,0) [0|63] "" EON
SG_ BOH : 45|6@0+ (1,0) [0|63] "" XXX
SG_ GEAR2 : 31|8@0+ (1,0) [0|1] "" XXX
@@ -430,6 +436,7 @@ BO_ 1302 ODOMETER: 8 XXX
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_ 401 GEAR_SHIFTER 32 "L" 16 "S" 8 "D" 4 "N" 2 "R" 1 "P" ;
VAL_ 401 GEAR 7 "L" 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ;
VAL_ 545 ECON_ON_2 0 "off" 3 "on" ;

View File

@@ -1,438 +0,0 @@
CM_ "AUTOGENERATED FILE, DO NOT EDIT";
CM_ "Imported file _bosch_2018.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_ STEER_DOWN_TO_ZERO : 38|1@0+ (1,0) [0|1] "" 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_ 330 STEERING_SENSORS: 8 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_ STEER_SENSOR_STATUS_1 : 34|1@0+ (1,0) [0|1] "" EON
SG_ STEER_SENSOR_STATUS_2 : 33|1@0+ (1,0) [0|1] "" EON
SG_ STEER_SENSOR_STATUS_3 : 32|1@0+ (1,0) [0|1] "" EON
SG_ STEER_WHEEL_ANGLE : 47|16@0- (-0.1,0) [-500|500] "deg" EON
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 59|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_ "honda_accord_s2t_2018_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";

View File

@@ -261,6 +261,7 @@ BO_ 1556 STEERING_LEVERS: 8 XXX
SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX
BO_ 1568 SEATS_DOORS: 8 XXX
SG_ METER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX
SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX

View File

@@ -261,6 +261,7 @@ BO_ 1556 STEERING_LEVERS: 8 XXX
SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX
BO_ 1568 SEATS_DOORS: 8 XXX
SG_ METER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX
SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX

View File

@@ -261,6 +261,7 @@ BO_ 1556 STEERING_LEVERS: 8 XXX
SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX
BO_ 1568 SEATS_DOORS: 8 XXX
SG_ METER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX
SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX

View File

@@ -261,6 +261,7 @@ BO_ 1556 STEERING_LEVERS: 8 XXX
SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX
BO_ 1568 SEATS_DOORS: 8 XXX
SG_ METER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX
SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX

View File

@@ -261,6 +261,7 @@ BO_ 1556 STEERING_LEVERS: 8 XXX
SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX
BO_ 1568 SEATS_DOORS: 8 XXX
SG_ METER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX
SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX

View File

@@ -261,6 +261,7 @@ BO_ 1556 STEERING_LEVERS: 8 XXX
SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX
BO_ 1568 SEATS_DOORS: 8 XXX
SG_ METER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX
SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX

View File

@@ -168,17 +168,16 @@ BO_ 581 CAM_IDK3: 8 XXX
SG_ S9 : 56|8@1+ (1,0) [0|255] "" XXX
BO_ 863 CAM_TRAFFIC_SIGNS: 8 XXX
SG_ STOP_SIGN : 31|4@0+ (1,0) [0|1] "" XXX
SG_ NEW_SIGNAL_3 : 55|1@0+ (1,0) [0|127] "" XXX
SG_ FORWARD_COLLISION : 40|8@1+ (1,0) [0|7] "" XXX
SG_ SPEED_SIGN : 4|7@0+ (1,0) [0|15] "" XXX
SG_ NEW_SIGNAL_2 : 52|5@0+ (1,0) [0|31] "" XXX
SG_ NEW_SIGNAL_4 : 33|1@0+ (1,0) [0|1] "" XXX
SG_ NEW_SIGNAL_1 : 13|2@0+ (1,0) [0|3] "" XXX
SG_ SPEED_SIGN_CAM : 32|1@0+ (1,0) [0|32767] "" XXX
SG_ SPEED_SIGN_ON : 12|1@0+ (1,0) [0|3] "" XXX
SG_ STOP_SIGN : 31|4@0+ (1,0) [0|1] "" XXX
SG_ NEW_SIGNAL_4 : 33|1@0+ (1,0) [0|1] "" XXX
BO_ 1157 CAM_SETTINGS: 8 XXX
SG_ NEW_SIGNAL_2 : 14|1@0+ (1,0) [0|1] "" XXX
SG_ SBS_WARNING_DISTANCE : 25|2@0+ (1,0) [0|127] "" XXX
SG_ SBS_SCBC : 28|2@0+ (1,0) [0|7] "" XXX
SG_ LKAS_ASSIT_TIMING : 13|1@0+ (1,0) [0|1] "" XXX
@@ -186,8 +185,10 @@ BO_ 1157 CAM_SETTINGS: 8 XXX
SG_ ILKAS_NTERVENTION_ON2 : 17|1@0+ (1,0) [0|255] "" XXX
SG_ LANEE_DEPARTURE_ALERT : 16|2@0+ (1,0) [0|1] "" XXX
SG_ LKAS_INERVENTION_ON1 : 15|1@0+ (1,0) [0|1] "" XXX
SG_ NEW_SIGNAL_1 : 12|1@0+ (1,0) [0|7] "" XXX
SG_ WARNING : 11|1@0+ (1,0) [0|1] "" XXX
SG_ BIT1 : 12|1@0+ (1,0) [0|7] "" XXX
SG_ BIT2 : 14|1@0+ (1,0) [0|1] "" XXX
SG_ BIT3 : 18|1@0+ (1,0) [0|1] "" XXX
BO_ 1160 CAM_Empty3: 8 XXX
SG_ NEW_SIGNAL_1 : 47|24@0+ (1,0) [0|16777215] "" XXX
@@ -759,6 +760,7 @@ CM_ SG_ 605 BRAKE_WARNING "Flashing brake warning and audible alert for potentia
CM_ SG_ 579 STEERING_ANGLE "steering angle aligns with 0.022 factor and -45.06 offset";
CM_ SG_ 863 SPEED_SIGN "speed limit in MPH";
CM_ SG_ 863 SPEED_SIGN_CAM "1: The speed limit is recognized by the camera. 0: speed limit is map based or is not available";
CM_ SG_ 863 STOP_SIGN "value 9 when stop sign is active";
CM_ SG_ 1157 SBS_WARNING_DISTANCE "1 far, 2 mid, 3 near";
CM_ SG_ 1157 SBS_SCBC "1 off, 2 on";
CM_ SG_ 1157 LKAS_ASSIT_TIMING "1 at, 0 before";
@@ -773,4 +775,4 @@ CM_ SG_ 552 GEAR "0 Shifting, 1 P, 2 R, 3 N, 4 D";
CM_ SG_ 552 GEAR_BOX "0 P, 14 R, 1 though 6 D for speeds, 15 Shift";
CM_ SG_ 540 HANDS_ON_STEER_WARN "0 no warning, b warning";
CM_ SG_ 1143 REAR_CT_ALERT "Rear Cross Traffic Alert";
VAL_ 552 GEAR 1 "P" 2 "R" 3 "N" 4 "D";
VAL_ 552 GEAR 1 "P" 2 "R" 3 "N" 4 "D" ;

View File

@@ -76,13 +76,17 @@ BO_ 212 Wheel_Speeds: 8 XXX
BO_ 320 Throttle: 8 XXX
SG_ Throttle_Pedal : 0|8@1+ (0.392157,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Signal1 : 12|2@1+ (1,0) [0|7] "" XXX
SG_ Not_Full_Throttle : 14|1@1+ (1,0) [0|1] "" XXX
SG_ Signal2 : 15|1@1+ (1,0) [0|1] "" XXX
SG_ Engine_RPM : 16|14@1+ (1,0) [0|32767] "" XXX
SG_ Off_Throttle : 30|1@1+ (1,0) [0|1] "" XXX
SG_ Signal3 : 31|1@1+ (1,0) [0|1] "" XXX
SG_ Throttle_Cruise : 32|8@1+ (1,0) [0|255] "" XXX
SG_ Throttle_Combo : 40|8@1+ (1,0) [0|255] "" XXX
SG_ Throttle_Body : 48|8@1+ (1,0) [0|255] "" XXX
SG_ Off_Throttle_2 : 56|1@1+ (1,0) [0|1] "" XXX
SG_ Signal4 : 57|7@1+ (1,0) [0|127] "" XXX
BO_ 321 Engine: 8 XXX
SG_ Engine_Torque : 0|15@1+ (1,0) [0|255] "" XXX
@@ -124,7 +128,7 @@ BO_ 338 Stalk: 8 XXX
BO_ 352 ES_Brake: 8 XXX
SG_ Brake_Pressure : 0|16@1+ (1,0) [0|255] "" XXX
SG_ Brake_Light : 20|1@1+ (1,0) [0|1] "" XXX
SG_ ES_Error : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Fault : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Brake_On : 22|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Activated : 23|1@1+ (1,0) [0|1] "" XXX
SG_ Counter : 48|3@1+ (1,0) [0|7] "" XXX
@@ -136,17 +140,17 @@ BO_ 353 ES_CruiseThrottle: 8 XXX
SG_ Cruise_Activated : 16|1@1+ (1,0) [0|1] "" XXX
SG_ Signal2 : 17|3@1+ (1,0) [0|7] "" XXX
SG_ Brake_On : 20|1@1+ (1,0) [0|1] "" XXX
SG_ DistanceSwap : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Distance_Swap : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Standstill : 22|1@1+ (1,0) [0|1] "" XXX
SG_ Signal3 : 23|1@1+ (1,0) [0|1] "" XXX
SG_ CloseDistance : 24|8@1+ (0.0196,0) [0|255] "m" XXX
SG_ Close_Distance : 24|8@1+ (0.0196,0) [0|255] "m" XXX
SG_ Signal4 : 32|9@1+ (1,0) [0|255] "" XXX
SG_ Standstill_2 : 41|1@1+ (1,0) [0|1] "" XXX
SG_ ES_Error : 42|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Fault : 42|1@1+ (1,0) [0|1] "" XXX
SG_ Signal5 : 43|1@1+ (1,0) [0|1] "" XXX
SG_ Counter : 44|3@1+ (1,0) [0|7] "" XXX
SG_ Signal6 : 47|1@1+ (1,0) [0|1] "" XXX
SG_ Button : 48|3@1+ (1,0) [0|7] "" XXX
SG_ Cruise_Button : 48|3@1+ (1,0) [0|7] "" XXX
SG_ Signal7 : 51|5@1+ (1,0) [0|31] "" XXX
SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX
@@ -213,6 +217,9 @@ BO_ 864 Engine_Temp: 8 XXX
BO_ 866 Fuel: 8 XXX
BO_ 977 Dash_State2: 8 XXX
SG_ Units : 15|1@1+ (1,0) [0|1] "" XXX
BO_ 1745 Dash_State: 8 XXX
SG_ Units : 15|1@1+ (1,0) [0|1] "" XXX
@@ -220,7 +227,7 @@ CM_ SG_ 320 Off_Throttle_2 "Less sensitive";
CM_ SG_ 320 Throttle_Body "Throttle related";
CM_ SG_ 328 Gear "15 = P, 14 = R, 0 = N, 1-6=gear";
CM_ SG_ 328 Gear_2 "15 = P, 14 = R, 0 = N, 1-6=gear";
CM_ SG_ 353 Button "1 = main, 2 = set shallow, 3 = set deep, 4 = resume shallow, 5 resume deep";
CM_ SG_ 353 Cruise_Button "1 = main, 2 = set shallow, 3 = set deep, 4 = resume shallow, 5 resume deep";
CM_ SG_ 354 RPM "20hz version of Transmission_Engine under Transmission";
CM_ SG_ 359 Sig1Right_Depart "right depart, hill steep and seatbelt disengage";
CM_ SG_ 359 LKAS_Inactive_2017 "1 when not steering, 0 when lkas steering";
@@ -253,6 +260,6 @@ BO_ 355 ES_DashStatus: 8 XXX
BO_ 881 Steering_Torque: 8 XXX
SG_ Steering_Motor_Flat : 0|10@1+ (32,0) [0|1000] "" XXX
SG_ Steer_Torque_Output : 16|11@1- (-32,0) [-1000|1000] "" XXX
SG_ LKA_Lockout : 27|1@1+ (1,0) [0|1] "" XXX
SG_ Steer_Error_1 : 27|1@1+ (1,0) [0|1] "" XXX
SG_ Steer_Torque_Sensor : 29|11@1- (-1,0) [-1000|1000] "" XXX
SG_ Steering_Angle : 40|16@1- (-0.033,0) [-600|600] "" XXX

View File

@@ -48,11 +48,13 @@ BO_ 2 Steering: 8 XXX
BO_ 64 Throttle: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Signal1 : 12|4@1+ (1,0) [0|15] "" XXX
SG_ Engine_RPM : 16|12@1+ (1,0) [0|4095] "" XXX
SG_ Signal2 : 28|4@1+ (1,0) [0|15] "" XXX
SG_ Throttle_Pedal : 32|8@1+ (1,0) [0|255] "" XXX
SG_ Throttle_Cruise : 40|8@1+ (1,0) [0|255] "" XXX
SG_ Throttle_Combo : 48|8@1+ (1,0) [0|255] "" XXX
SG_ Signal1 : 56|4@1+ (1,0) [0|15] "" XXX
SG_ Signal3 : 56|4@1+ (1,0) [0|15] "" XXX
SG_ Off_Accel : 60|4@1+ (1,0) [0|15] "" XXX
BO_ 316 Brake_Status: 8 XXX

View File

@@ -76,13 +76,17 @@ BO_ 212 Wheel_Speeds: 8 XXX
BO_ 320 Throttle: 8 XXX
SG_ Throttle_Pedal : 0|8@1+ (0.392157,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Signal1 : 12|2@1+ (1,0) [0|7] "" XXX
SG_ Not_Full_Throttle : 14|1@1+ (1,0) [0|1] "" XXX
SG_ Signal2 : 15|1@1+ (1,0) [0|1] "" XXX
SG_ Engine_RPM : 16|14@1+ (1,0) [0|32767] "" XXX
SG_ Off_Throttle : 30|1@1+ (1,0) [0|1] "" XXX
SG_ Signal3 : 31|1@1+ (1,0) [0|1] "" XXX
SG_ Throttle_Cruise : 32|8@1+ (1,0) [0|255] "" XXX
SG_ Throttle_Combo : 40|8@1+ (1,0) [0|255] "" XXX
SG_ Throttle_Body : 48|8@1+ (1,0) [0|255] "" XXX
SG_ Off_Throttle_2 : 56|1@1+ (1,0) [0|1] "" XXX
SG_ Signal4 : 57|7@1+ (1,0) [0|127] "" XXX
BO_ 321 Engine: 8 XXX
SG_ Engine_Torque : 0|15@1+ (1,0) [0|255] "" XXX
@@ -124,7 +128,7 @@ BO_ 338 Stalk: 8 XXX
BO_ 352 ES_Brake: 8 XXX
SG_ Brake_Pressure : 0|16@1+ (1,0) [0|255] "" XXX
SG_ Brake_Light : 20|1@1+ (1,0) [0|1] "" XXX
SG_ ES_Error : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Fault : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Brake_On : 22|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Activated : 23|1@1+ (1,0) [0|1] "" XXX
SG_ Counter : 48|3@1+ (1,0) [0|7] "" XXX
@@ -136,17 +140,17 @@ BO_ 353 ES_CruiseThrottle: 8 XXX
SG_ Cruise_Activated : 16|1@1+ (1,0) [0|1] "" XXX
SG_ Signal2 : 17|3@1+ (1,0) [0|7] "" XXX
SG_ Brake_On : 20|1@1+ (1,0) [0|1] "" XXX
SG_ DistanceSwap : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Distance_Swap : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Standstill : 22|1@1+ (1,0) [0|1] "" XXX
SG_ Signal3 : 23|1@1+ (1,0) [0|1] "" XXX
SG_ CloseDistance : 24|8@1+ (0.0196,0) [0|255] "m" XXX
SG_ Close_Distance : 24|8@1+ (0.0196,0) [0|255] "m" XXX
SG_ Signal4 : 32|9@1+ (1,0) [0|255] "" XXX
SG_ Standstill_2 : 41|1@1+ (1,0) [0|1] "" XXX
SG_ ES_Error : 42|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Fault : 42|1@1+ (1,0) [0|1] "" XXX
SG_ Signal5 : 43|1@1+ (1,0) [0|1] "" XXX
SG_ Counter : 44|3@1+ (1,0) [0|7] "" XXX
SG_ Signal6 : 47|1@1+ (1,0) [0|1] "" XXX
SG_ Button : 48|3@1+ (1,0) [0|7] "" XXX
SG_ Cruise_Button : 48|3@1+ (1,0) [0|7] "" XXX
SG_ Signal7 : 51|5@1+ (1,0) [0|31] "" XXX
SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX
@@ -213,6 +217,9 @@ BO_ 864 Engine_Temp: 8 XXX
BO_ 866 Fuel: 8 XXX
BO_ 977 Dash_State2: 8 XXX
SG_ Units : 15|1@1+ (1,0) [0|1] "" XXX
BO_ 1745 Dash_State: 8 XXX
SG_ Units : 15|1@1+ (1,0) [0|1] "" XXX
@@ -220,7 +227,7 @@ CM_ SG_ 320 Off_Throttle_2 "Less sensitive";
CM_ SG_ 320 Throttle_Body "Throttle related";
CM_ SG_ 328 Gear "15 = P, 14 = R, 0 = N, 1-6=gear";
CM_ SG_ 328 Gear_2 "15 = P, 14 = R, 0 = N, 1-6=gear";
CM_ SG_ 353 Button "1 = main, 2 = set shallow, 3 = set deep, 4 = resume shallow, 5 resume deep";
CM_ SG_ 353 Cruise_Button "1 = main, 2 = set shallow, 3 = set deep, 4 = resume shallow, 5 resume deep";
CM_ SG_ 354 RPM "20hz version of Transmission_Engine under Transmission";
CM_ SG_ 359 Sig1Right_Depart "right depart, hill steep and seatbelt disengage";
CM_ SG_ 359 LKAS_Inactive_2017 "1 when not steering, 0 when lkas steering";
@@ -252,22 +259,22 @@ BO_ 358 ES_DashStatus: 8 XXX
SG_ Signal1 : 18|1@1+ (1,0) [0|1] "" XXX
SG_ WHEELS_MOVING_2015 : 19|1@1+ (1,0) [0|1] "" XXX
SG_ Driver_Input : 20|1@1+ (1,0) [0|1] "" XXX
SG_ Distance_Bars : 21|3@1+ (1,0) [0|7] "" XXX
SG_ Cruise_Distance : 21|3@1+ (1,0) [0|7] "" XXX
SG_ Cruise_Set_Speed : 24|8@1+ (1,0) [0|255] "" XXX
SG_ ES_Error : 32|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Fault : 32|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_On_2 : 34|1@1+ (1,0) [0|1] "" XXX
SG_ Counter : 37|3@1+ (1,0) [0|7] "" XXX
SG_ Steep_Hill_Disengage : 44|1@1+ (1,0) [0|3] "" XXX
SG_ Lead_Car : 46|1@1+ (1,0) [0|1] "" XXX
SG_ Obstacle_Distance : 48|4@1+ (5,0) [0|15] "m" XXX
SG_ Car_Follow : 46|1@1+ (1,0) [0|1] "" XXX
SG_ Far_Distance : 48|4@1+ (5,0) [0|15] "m" XXX
BO_ 881 Steering_Torque: 8 XXX
SG_ Steering_Motor_Flat : 0|10@1+ (32,0) [0|1000] "" XXX
SG_ Steer_Torque_Output : 16|11@1- (-32,0) [-1000|1000] "" XXX
SG_ LKA_Lockout : 27|1@1+ (1,0) [0|1] "" XXX
SG_ Steer_Error_1 : 27|1@1+ (1,0) [0|1] "" XXX
SG_ Steer_Torque_Sensor : 29|11@1- (1,0) [-1000|1000] "" XXX
SG_ Steering_Angle : 40|16@1- (-0.033,0) [-600|600] "" XXX
CM_ SG_ 358 Disengage_Alert "seatbelt and steep hill disengage";
CM_ SG_ 358 ES_Error "No engagement until restart";
CM_ SG_ 358 Lead_Car "front car detected";
CM_ SG_ 358 Cruise_Fault "No engagement until restart";
CM_ SG_ 358 Car_Follow "lead car detected";

View File

@@ -76,13 +76,17 @@ BO_ 212 Wheel_Speeds: 8 XXX
BO_ 320 Throttle: 8 XXX
SG_ Throttle_Pedal : 0|8@1+ (0.392157,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Signal1 : 12|2@1+ (1,0) [0|7] "" XXX
SG_ Not_Full_Throttle : 14|1@1+ (1,0) [0|1] "" XXX
SG_ Signal2 : 15|1@1+ (1,0) [0|1] "" XXX
SG_ Engine_RPM : 16|14@1+ (1,0) [0|32767] "" XXX
SG_ Off_Throttle : 30|1@1+ (1,0) [0|1] "" XXX
SG_ Signal3 : 31|1@1+ (1,0) [0|1] "" XXX
SG_ Throttle_Cruise : 32|8@1+ (1,0) [0|255] "" XXX
SG_ Throttle_Combo : 40|8@1+ (1,0) [0|255] "" XXX
SG_ Throttle_Body : 48|8@1+ (1,0) [0|255] "" XXX
SG_ Off_Throttle_2 : 56|1@1+ (1,0) [0|1] "" XXX
SG_ Signal4 : 57|7@1+ (1,0) [0|127] "" XXX
BO_ 321 Engine: 8 XXX
SG_ Engine_Torque : 0|15@1+ (1,0) [0|255] "" XXX
@@ -124,7 +128,7 @@ BO_ 338 Stalk: 8 XXX
BO_ 352 ES_Brake: 8 XXX
SG_ Brake_Pressure : 0|16@1+ (1,0) [0|255] "" XXX
SG_ Brake_Light : 20|1@1+ (1,0) [0|1] "" XXX
SG_ ES_Error : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Fault : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Brake_On : 22|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Activated : 23|1@1+ (1,0) [0|1] "" XXX
SG_ Counter : 48|3@1+ (1,0) [0|7] "" XXX
@@ -136,17 +140,17 @@ BO_ 353 ES_CruiseThrottle: 8 XXX
SG_ Cruise_Activated : 16|1@1+ (1,0) [0|1] "" XXX
SG_ Signal2 : 17|3@1+ (1,0) [0|7] "" XXX
SG_ Brake_On : 20|1@1+ (1,0) [0|1] "" XXX
SG_ DistanceSwap : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Distance_Swap : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Standstill : 22|1@1+ (1,0) [0|1] "" XXX
SG_ Signal3 : 23|1@1+ (1,0) [0|1] "" XXX
SG_ CloseDistance : 24|8@1+ (0.0196,0) [0|255] "m" XXX
SG_ Close_Distance : 24|8@1+ (0.0196,0) [0|255] "m" XXX
SG_ Signal4 : 32|9@1+ (1,0) [0|255] "" XXX
SG_ Standstill_2 : 41|1@1+ (1,0) [0|1] "" XXX
SG_ ES_Error : 42|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Fault : 42|1@1+ (1,0) [0|1] "" XXX
SG_ Signal5 : 43|1@1+ (1,0) [0|1] "" XXX
SG_ Counter : 44|3@1+ (1,0) [0|7] "" XXX
SG_ Signal6 : 47|1@1+ (1,0) [0|1] "" XXX
SG_ Button : 48|3@1+ (1,0) [0|7] "" XXX
SG_ Cruise_Button : 48|3@1+ (1,0) [0|7] "" XXX
SG_ Signal7 : 51|5@1+ (1,0) [0|31] "" XXX
SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX
@@ -213,6 +217,9 @@ BO_ 864 Engine_Temp: 8 XXX
BO_ 866 Fuel: 8 XXX
BO_ 977 Dash_State2: 8 XXX
SG_ Units : 15|1@1+ (1,0) [0|1] "" XXX
BO_ 1745 Dash_State: 8 XXX
SG_ Units : 15|1@1+ (1,0) [0|1] "" XXX
@@ -220,7 +227,7 @@ CM_ SG_ 320 Off_Throttle_2 "Less sensitive";
CM_ SG_ 320 Throttle_Body "Throttle related";
CM_ SG_ 328 Gear "15 = P, 14 = R, 0 = N, 1-6=gear";
CM_ SG_ 328 Gear_2 "15 = P, 14 = R, 0 = N, 1-6=gear";
CM_ SG_ 353 Button "1 = main, 2 = set shallow, 3 = set deep, 4 = resume shallow, 5 resume deep";
CM_ SG_ 353 Cruise_Button "1 = main, 2 = set shallow, 3 = set deep, 4 = resume shallow, 5 resume deep";
CM_ SG_ 354 RPM "20hz version of Transmission_Engine under Transmission";
CM_ SG_ 359 Sig1Right_Depart "right depart, hill steep and seatbelt disengage";
CM_ SG_ 359 LKAS_Inactive_2017 "1 when not steering, 0 when lkas steering";
@@ -252,22 +259,22 @@ BO_ 358 ES_DashStatus: 8 XXX
SG_ Signal1 : 18|1@1+ (1,0) [0|1] "" XXX
SG_ WHEELS_MOVING_2015 : 19|1@1+ (1,0) [0|1] "" XXX
SG_ Driver_Input : 20|1@1+ (1,0) [0|1] "" XXX
SG_ Distance_Bars : 21|3@1+ (1,0) [0|7] "" XXX
SG_ Cruise_Distance : 21|3@1+ (1,0) [0|7] "" XXX
SG_ Cruise_Set_Speed : 24|8@1+ (1,0) [0|255] "" XXX
SG_ ES_Error : 32|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Fault : 32|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_On_2 : 34|1@1+ (1,0) [0|1] "" XXX
SG_ Counter : 37|3@1+ (1,0) [0|7] "" XXX
SG_ Steep_Hill_Disengage : 44|1@1+ (1,0) [0|3] "" XXX
SG_ Lead_Car : 46|1@1+ (1,0) [0|1] "" XXX
SG_ Obstacle_Distance : 48|4@1+ (5,0) [0|15] "m" XXX
SG_ Car_Follow : 46|1@1+ (1,0) [0|1] "" XXX
SG_ Far_Distance : 48|4@1+ (5,0) [0|15] "m" XXX
BO_ 881 Steering_Torque: 8 XXX
SG_ Steering_Motor_Flat : 0|10@1+ (32,0) [0|1000] "" XXX
SG_ Steer_Torque_Output : 16|11@1- (-32,0) [-1000|1000] "" XXX
SG_ LKA_Lockout : 27|1@1+ (1,0) [0|1] "" XXX
SG_ Steer_Error_1 : 27|1@1+ (1,0) [0|1] "" XXX
SG_ Steer_Torque_Sensor : 29|11@1- (-1,0) [-1000|1000] "" XXX
SG_ Steering_Angle : 40|16@1- (-0.033,0) [-600|600] "" XXX
CM_ SG_ 358 Disengage_Alert "seatbelt and steep hill disengage";
CM_ SG_ 358 ES_Error "No engagement until restart";
CM_ SG_ 358 Lead_Car "front car detected";
CM_ SG_ 358 Cruise_Fault "No engagement until restart";
CM_ SG_ 358 Car_Follow "lead car detected";

View File

@@ -261,6 +261,7 @@ BO_ 1556 STEERING_LEVERS: 8 XXX
SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX
BO_ 1568 SEATS_DOORS: 8 XXX
SG_ METER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX
SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX

View File

@@ -261,6 +261,7 @@ BO_ 1556 STEERING_LEVERS: 8 XXX
SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX
BO_ 1568 SEATS_DOORS: 8 XXX
SG_ METER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX
SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX

View File

@@ -261,6 +261,7 @@ BO_ 1556 STEERING_LEVERS: 8 XXX
SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX
BO_ 1568 SEATS_DOORS: 8 XXX
SG_ METER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX
SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX

View File

@@ -261,6 +261,7 @@ BO_ 1556 STEERING_LEVERS: 8 XXX
SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX
BO_ 1568 SEATS_DOORS: 8 XXX
SG_ METER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX
SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX

View File

@@ -261,6 +261,7 @@ BO_ 1556 STEERING_LEVERS: 8 XXX
SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX
BO_ 1568 SEATS_DOORS: 8 XXX
SG_ METER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX
SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX

View File

@@ -291,6 +291,7 @@ BO_ 1556 STEERING_LEVERS: 8 XXX
SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX
BO_ 1568 SEATS_DOORS: 8 XXX
SG_ METER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX
SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX

View File

@@ -291,6 +291,7 @@ BO_ 1556 STEERING_LEVERS: 8 XXX
SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX
BO_ 1568 SEATS_DOORS: 8 XXX
SG_ METER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX
SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX

View File

@@ -261,6 +261,7 @@ BO_ 1556 STEERING_LEVERS: 8 XXX
SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX
BO_ 1568 SEATS_DOORS: 8 XXX
SG_ METER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX
SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX

View File

@@ -261,6 +261,7 @@ BO_ 1556 STEERING_LEVERS: 8 XXX
SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX
BO_ 1568 SEATS_DOORS: 8 XXX
SG_ METER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX
SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX

View File

@@ -261,6 +261,7 @@ BO_ 1556 STEERING_LEVERS: 8 XXX
SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX
BO_ 1568 SEATS_DOORS: 8 XXX
SG_ METER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX
SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX

View File

@@ -261,6 +261,7 @@ BO_ 1556 STEERING_LEVERS: 8 XXX
SG_ HAZARD_LIGHT : 27|1@0+ (1,0) [0|1] "" XXX
BO_ 1568 SEATS_DOORS: 8 XXX
SG_ METER_DIMMED : 38|1@0+ (1,0) [0|1] "" XXX
SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX

View File

@@ -1351,18 +1351,19 @@ BO_ 391 EV_Gearshift: 8 XXX
SG_ GearPosition : 16|4@1+ (1,0) [0|255] "" XXX
SG_ RegenBrakingMode : 12|2@1+ (1,0) [0|3] "" XXX
CM_ SG_ 173 COUNTERXX "Message not renamed to COUNTER because J533 rate-limiting makes it look like messages are being lost";
CM_ SG_ 134 LWI_Lenkradwinkel "Steering angle WITH variable ratio effect included";
CM_ SG_ 159 EPS_HCA_Status "Status of Heading Control Assist feature"
CM_ SG_ 159 EPS_Lenkmoment "Steering input by driver, torque";
CM_ SG_ 159 EPS_VZ_Lenkmoment "Steering input by driver, direction";
CM_ SG_ 159 EPS_Berechneter_LW "Raw steering angle, degrees";
CM_ SG_ 159 EPS_VZ_BLW "Raw steering angle, direction"
CM_ SG_ 173 COUNTERXX "Message not renamed to COUNTER because J533 rate-limiting makes it look like messages are being lost";
CM_ SG_ 294 3 "May be zero when sent by older cameras";
CM_ SG_ 294 7 "May be zero when sent by older cameras";
CM_ SG_ 294 254 "May be zero when sent by older cameras";
CM_ SG_ 294 Assist_Torque "Heading control input, torque";
CM_ SG_ 294 Assist_VZ "Heading control input, direction (sign)";
CM_ SG_ 294 HCA_Available "Must be 1 for steering rack to accept HCA commands";
CM_ SG_ 159 HCA_Ready "1 if HCA is okay, 0 if the rack doesn't have HCA configured or a timer/constraint has been violated, rack will not respond to HCA commands";
CM_ SG_ 159 Driver_Strain "Steering input by driver, torque";
CM_ SG_ 159 Driver_Strain_VZ "Steering input by driver, sign (direction)";
CM_ SG_ 159 Steering_Wheel_Angle "Steering angle WITHOUT variable ratio effect included";
CM_ SG_ 919 LDW_DLC "Probable DLC (distance to line crossing)";
CM_ SG_ 919 LDW_TLC "Probable TLC (time to line crossing)";
CM_ SG_ 919 LDW_Unknown "Might be a steering pressed / driver active flag";
@@ -1378,6 +1379,7 @@ CM_ SG_ 780 Abstand "Following distance";
CM_ SG_ 780 SetSpeed "ACC set speed";
CM_ SG_ 391 GearPosition "Traditional PRND plus B-mode aggressive regen, B-mode mapped to Drive";
CM_ SG_ 960 ZAS_Kl_15 "Indicates ignition on";
VAL_ 159 EPS_HCA_Status 0 "disabled" 1 "initializing" 2 "fault" 3 "ready" 4 "rejected" 5 "active";
VAL_ 173 GE_Fahrstufe 5 "P" 6 "R" 7 "N" 8 "D" 9 "S" 10 "E" 14 "T";
VAL_ 391 GearPosition 2 "P" 3 "R" 4 "N" 5 "D" 6 "D";
VAL_ 391 RegenBrakingMode 0 "default" 1 "B1" 2 "B2" 3 "B3";

View File

@@ -36,11 +36,16 @@ else:
"-g",
]
if FindFile('dp_vw', '/data/params/d') != None:
with open('/data/params/d/dp_vw') as f:
if FindFile('dp_vw_panda', '/data/params/d') != None:
with open('/data/params/d/dp_vw_panda') as f:
if (int(f.read().strip())) == 1:
PROJECT_FLAGS += ['-Dvw']
if FindFile('dp_panda_fake_black', '/data/params/d') != None:
with open('/data/params/d/dp_panda_fake_black') as f:
if (int(f.read().strip())) == 1:
PROJECT_FLAGS += ['-Dfake_black_panda']
if not PC:
PROJECT_FLAGS += ["-DEON"]
BUILDER = "EON"

View File

@@ -26,9 +26,9 @@ void dos_enable_can_transceivers(bool enabled) {
for(uint8_t i=1U; i<=4U; i++){
// Leave main CAN always on for CAN-based ignition detection
if((car_harness_status == HARNESS_STATUS_FLIPPED) ? (i == 3U) : (i == 1U)){
uno_enable_can_transceiver(i, true);
dos_enable_can_transceiver(i, true);
} else {
uno_enable_can_transceiver(i, enabled);
dos_enable_can_transceiver(i, enabled);
}
}
}

View File

@@ -42,6 +42,7 @@
extern int _app_start[0xc000]; // Only first 3 sectors of size 0x4000 are used
// When changing this struct, boardd and python/__init__.py needs to be kept up to date!
struct __attribute__((packed)) health_t {
uint32_t uptime_pkt;
uint32_t voltage_pkt;
@@ -61,6 +62,7 @@ struct __attribute__((packed)) health_t {
int16_t safety_param_pkt;
uint8_t fault_status_pkt;
uint8_t power_save_enabled_pkt;
uint8_t heartbeat_lost_pkt;
};
@@ -154,6 +156,7 @@ void set_safety_mode(uint16_t mode, int16_t param) {
case SAFETY_ELM327:
set_intercept_relay(false);
heartbeat_counter = 0U;
heartbeat_lost = false;
if (board_has_obd()) {
current_board->set_can_mode(CAN_MODE_OBD_CAN2);
}
@@ -162,6 +165,7 @@ void set_safety_mode(uint16_t mode, int16_t param) {
default:
set_intercept_relay(true);
heartbeat_counter = 0U;
heartbeat_lost = false;
if (board_has_obd()) {
current_board->set_can_mode(CAN_MODE_NORMAL);
}
@@ -196,6 +200,7 @@ int get_health_pkt(void *dat) {
health->safety_mode_pkt = (uint8_t)(current_safety_mode);
health->safety_param_pkt = current_safety_param;
health->power_save_enabled_pkt = (uint8_t)(power_save_status == POWER_SAVE_STATUS_ENABLED);
health->heartbeat_lost_pkt = (uint8_t)(heartbeat_lost);
health->fault_status_pkt = fault_status;
health->faults_pkt = faults;
@@ -342,7 +347,11 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired)
break;
// **** 0xc1: get hardware type
case 0xc1:
#ifdef fake_black_panda
resp[0] = HW_TYPE_BLACK_PANDA;
#else
resp[0] = hw_type;
#endif
resp_len = 1;
break;
// **** 0xd0: fetch serial number
@@ -609,6 +618,7 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired)
case 0xf3:
{
heartbeat_counter = 0U;
heartbeat_lost = false;
break;
}
// **** 0xf4: k-line/l-line 5 baud initialization
@@ -746,6 +756,9 @@ void TIM1_BRK_TIM9_IRQ_Handler(void) {
set_power_save_state(POWER_SAVE_STATUS_ENABLED);
}
// set flag to indicate the heartbeat was lost
heartbeat_lost = true;
// Also disable IR when the heartbeat goes missing
current_board->set_ir_power(0U);

View File

@@ -13,5 +13,6 @@ const board *current_board;
bool is_enumerated = 0;
uint32_t heartbeat_counter = 0;
uint32_t uptime_cnt = 0;
bool heartbeat_lost = false;
bool siren_enabled = false;
bool green_led_enabled = false;

View File

@@ -37,7 +37,8 @@ const int HONDA_RX_CHECKS_LEN = sizeof(honda_rx_checks) / sizeof(honda_rx_checks
AddrCheckStruct honda_bh_rx_checks[] = {
{.msg = {{0x296, 1, 4, .check_checksum = true, .max_counter = 3U, .expected_timestep = 40000U}}},
{.msg = {{0x158, 1, 8, .check_checksum = true, .max_counter = 3U, .expected_timestep = 10000U}}},
{.msg = {{0x17C, 1, 8, .check_checksum = true, .max_counter = 3U, .expected_timestep = 10000U}}},
{.msg = {{0x17C, 1, 8, .check_checksum = true, .max_counter = 3U, .expected_timestep = 10000U},
{0x1BE, 1, 3, .check_checksum = true, .max_counter = 3U, .expected_timestep = 20000U}}},
};
const int HONDA_BH_RX_CHECKS_LEN = sizeof(honda_bh_rx_checks) / sizeof(honda_bh_rx_checks[0]);

View File

@@ -332,8 +332,8 @@ class Panda(object):
# ******************* health *******************
def health(self):
dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd2, 0, 0, 41)
a = struct.unpack("IIIIIIIIBBBBBBBBB", dat)
dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd2, 0, 0, 44)
a = struct.unpack("<IIIIIIIIBBBBBBBHBBB", dat)
return {
"uptime": a[0],
"voltage": a[1],
@@ -350,8 +350,10 @@ class Panda(object):
"car_harness_status": a[12],
"usb_power_mode": a[13],
"safety_mode": a[14],
"fault_status": a[15],
"power_save_enabled": a[16]
"safety_param": a[15],
"fault_status": a[16],
"power_save_enabled": a[17],
"heartbeat_lost": a[18],
}
# ******************* control *******************

View File

@@ -49,7 +49,7 @@ popd
# Build stuff
ln -sfn /data/openpilot /data/pythonpath
export PYTHONPATH="/data/openpilot:/data/openpilot/pyextra"
SCONS_CACHE=1 scons -j3
scons -j3
# Run tests
python selfdrive/manager/test/test_manager.py

View File

@@ -1,10 +1,10 @@
#!/usr/bin/bash
if [ $1 -eq 1 ]; then
printf %s "1" > /data/params/d/dp_disable_relay
printf %s "1" > /data/params/d/dp_toyota_disable_relay
fi
if [ $1 -eq 0 ]; then
printf %s "0" > /data/params/d/dp_disable_relay
printf %s "0" > /data/params/d/dp_toyota_disable_relay
fi
rm -rf /data/openpilot/selfdrive/boardd/boardd && reboot

View File

@@ -1,16 +0,0 @@
#!/usr/bin/bash
if [ $1 -eq 1 ]; then
printf %s "1" > /data/params/d/dp_jetson
printf %s "0" > /data/params/d/dp_uploader
printf %s "0" > /data/params/d/dp_logger
printf %s "0" > /data/params/d/dp_athenad
fi
if [ $1 -eq 0 ]; then
printf %s "0" > /data/params/d/dp_jetson
cd /data/openpilot || exit
git reset --hard @{u}
git clean -xdf
fi
reboot

View File

@@ -4,6 +4,5 @@ export LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib
export HOME=/data/data/com.termux/files/home
export PATH=/usr/local/bin:/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/sbin:/data/data/com.termux/files/usr/bin/applets:/bin:/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin:/data/data/com.termux/files/usr/bin/python
export PYTHONPATH=/data/openpilot
printf %s "1" > /data/params/d/DragonUpdating
rm /data/openpilot/panda/board/obj/panda.bin
cd /data/openpilot/panda || exit ; pkill -f boardd ; python -c "from panda import Panda; Panda().flash()" && reboot

View File

@@ -1,9 +1,9 @@
#!/usr/bin/bash
if [ $1 -eq 1 ]; then
printf %s "1" > /data/params/d/dp_vw
printf %s "1" > /data/params/d/dp_vw_panda
fi
if [ $1 -eq 0 ]; then
printf %s "0" > /data/params/d/dp_vw
printf %s "0" > /data/params/d/dp_vw_panda
fi
rm /data/openpilot/panda/board/obj/panda.bin

View File

@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="triangle-11"
width="75.758675"
height="89.153732"
viewBox="0 0 75.758675 89.153734"
sodipodi:docname="triangle.svg"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)">
<metadata
id="metadata8">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs6" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1278"
inkscape:window-height="1418"
id="namedview4"
showgrid="false"
inkscape:zoom="3.7926636"
inkscape:cx="58.39757"
inkscape:cy="42.569591"
inkscape:window-x="2480"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="triangle-11" />
<path
id="rect3338"
d="m 38.008927,0.00304862 c -1.672524,-0.07115 -3.24191,1.10742798 -4.103539,3.08128498 L 0.63797357,79.511649 c -1.85216397,4.240355 0.59099403,9.61933 3.95882353,9.642068 3.3678291,0.02287 28.1477799,-24.380023 33.9100889,-24.380023 5.762307,0 29.946434,24.380314 32.624742,24.380023 2.678305,-2.9e-4 3.249598,-1.351011 4.021616,-3.231338 0.772007,-1.880328 0.863286,-4.290554 -0.06281,-6.41073 L 58.456744,41.297993 41.823037,3.0843336 C 41.013805,1.2321186 39.577483,0.07190362 38.008927,0.00304862 Z"
inkscape:connector-curvature="0"
style="fill:#cccccc;stroke-width:9.76952076"
sodipodi:nodetypes="ccczzzscccc" />
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -25,12 +25,11 @@ from common.api import Api
from common.basedir import PERSIST
from common.params import Params
from common.realtime import sec_since_boot
from selfdrive.hardware import HARDWARE, PC, JETSON
from selfdrive.hardware import HARDWARE, PC, TICI, JETSON
from selfdrive.loggerd.config import ROOT
from selfdrive.loggerd.xattr_cache import getxattr, setxattr
from selfdrive.swaglog import cloudlog, SWAGLOG_DIR
import selfdrive.crash as crash
from selfdrive.version import dirty, origin, branch, commit
from selfdrive.version import get_version, get_git_remote, get_git_branch, get_git_commit
ATHENA_HOST = os.getenv('ATHENA_HOST', 'wss://athena.comma.ai')
HANDLER_THREADS = int(os.getenv('HANDLER_THREADS', "4"))
@@ -38,6 +37,7 @@ LOCAL_PORT_WHITELIST = set([8022])
LOG_ATTR_NAME = 'user.upload'
LOG_ATTR_VALUE_MAX_UNIX_TIME = int.to_bytes(2147483647, 4, sys.byteorder)
RECONNECT_TIMEOUT_S = 70
dispatcher["echo"] = lambda s: s
recv_queue: Any = queue.Queue()
@@ -53,12 +53,12 @@ def handle_long_poll(ws):
end_event = threading.Event()
threads = [
threading.Thread(target=ws_recv, args=(ws, end_event)),
threading.Thread(target=ws_send, args=(ws, end_event)),
threading.Thread(target=upload_handler, args=(end_event,)),
threading.Thread(target=log_handler, args=(end_event,)),
threading.Thread(target=ws_recv, args=(ws, end_event), name='ws_recv'),
threading.Thread(target=ws_send, args=(ws, end_event), name='wc_send'),
threading.Thread(target=upload_handler, args=(end_event,), name='upload_handler'),
threading.Thread(target=log_handler, args=(end_event,), name='log_handler'),
] + [
threading.Thread(target=jsonrpc_handler, args=(end_event,))
threading.Thread(target=jsonrpc_handler, args=(end_event,), name=f'worker_{x}')
for x in range(HANDLER_THREADS)
]
@@ -72,17 +72,20 @@ def handle_long_poll(ws):
raise
finally:
for thread in threads:
cloudlog.debug(f"athena.joining {thread.name}")
thread.join()
def jsonrpc_handler(end_event):
dispatcher["startLocalProxy"] = partial(startLocalProxy, end_event)
while not end_event.is_set():
try:
data = recv_queue.get(timeout=1)
if "method" in data:
cloudlog.debug(f"athena.jsonrpc_handler.call_method {data}")
response = JSONRPCResponseManager.handle(data, dispatcher)
send_queue.put_nowait(response.json)
elif "result" in data and "id" in data:
elif "id" in data and ("result" in data or "error" in data):
log_recv_queue.put_nowait(data)
else:
raise Exception("not a valid request or response")
@@ -131,6 +134,27 @@ def getMessage(service=None, timeout=1000):
return ret.to_dict()
@dispatcher.add_method
def getVersion():
return {
"version": get_version(),
"remote": get_git_remote(),
"branch": get_git_branch(),
"commit": get_git_commit(),
}
@dispatcher.add_method
def setNavDestination(latitude=0, longitude=0):
destination = {
"latitude": latitude,
"longitude": longitude,
}
Params().put("NavDestination", json.dumps(destination))
return {"success": 1}
@dispatcher.add_method
def listDataDirectory():
files = [os.path.relpath(os.path.join(dp, f), ROOT) for dp, dn, fn in os.walk(ROOT) for f in fn]
@@ -190,6 +214,8 @@ def startLocalProxy(global_end_event, remote_ws_uri, local_port):
if local_port not in LOCAL_PORT_WHITELIST:
raise Exception("Requested local port not whitelisted")
cloudlog.debug("athena.startLocalProxy.starting")
params = Params()
dongle_id = params.get("DongleId").decode('utf8')
identity_token = Api(dongle_id).get_token()
@@ -210,6 +236,7 @@ def startLocalProxy(global_end_event, remote_ws_uri, local_port):
for thread in threads:
thread.start()
cloudlog.debug("athena.startLocalProxy.started")
return {"success": 1}
except Exception as e:
cloudlog.exception("athenad.startLocalProxy.exception")
@@ -282,56 +309,60 @@ def log_handler(end_event):
log_files = []
last_scan = 0
log_retries = 0
while not end_event.is_set():
try:
try:
result = json.loads(log_recv_queue.get(timeout=1))
log_success = result.get("success")
log_entry = result.get("id")
log_path = os.path.join(SWAGLOG_DIR, log_entry)
if log_entry and log_success:
try:
setxattr(log_path, LOG_ATTR_NAME, LOG_ATTR_VALUE_MAX_UNIX_TIME)
except OSError:
pass # file could be deleted by log rotation
except queue.Empty:
pass
curr_scan = sec_since_boot()
if curr_scan - last_scan > 10:
log_files = get_logs_to_send_sorted()
last_scan = curr_scan
# never send last log file because it is the active log
# and only send one log file at a time (most recent first)
if not len(log_files) or not log_send_queue.empty():
continue
# send one log
curr_log = None
if len(log_files) > 0:
log_entry = log_files.pop()
cloudlog.debug(f"athena.log_handler.forward_request {log_entry}")
try:
curr_time = int(time.time())
log_path = os.path.join(SWAGLOG_DIR, log_entry)
setxattr(log_path, LOG_ATTR_NAME, int.to_bytes(curr_time, 4, sys.byteorder))
with open(log_path, "r") as f:
jsonrpc = {
"method": "forwardLogs",
"params": {
"logs": f.read()
},
"jsonrpc": "2.0",
"id": log_entry
}
log_send_queue.put_nowait(json.dumps(jsonrpc))
curr_log = log_entry
except OSError:
pass # file could be deleted by log rotation
# wait for response up to ~100 seconds
# always read queue at least once to process any old responses that arrive
for _ in range(100):
if end_event.is_set():
break
try:
log_resp = json.loads(log_recv_queue.get(timeout=1))
log_entry = log_resp.get("id")
log_success = "result" in log_resp and log_resp["result"].get("success")
cloudlog.debug(f"athena.log_handler.forward_response {log_entry} {log_success}")
if log_entry and log_success:
log_path = os.path.join(SWAGLOG_DIR, log_entry)
try:
setxattr(log_path, LOG_ATTR_NAME, LOG_ATTR_VALUE_MAX_UNIX_TIME)
except OSError:
pass # file could be deleted by log rotation
if curr_log == log_entry:
break
except queue.Empty:
if curr_log is None:
break
log_entry = log_files.pop()
try:
curr_time = int(time.time())
log_path = os.path.join(SWAGLOG_DIR, log_entry)
setxattr(log_path, LOG_ATTR_NAME, int.to_bytes(curr_time, 4, sys.byteorder))
with open(log_path, "r") as f:
jsonrpc = {
"method": "forwardLogs",
"params": {
"logs": f.read()
},
"jsonrpc": "2.0",
"id": log_entry
}
log_send_queue.put_nowait(json.dumps(jsonrpc))
except OSError:
pass # file could be deleted by log rotation
log_retries = 0
except Exception:
cloudlog.exception("athena.log_handler.exception")
log_retries += 1
if log_retries != 0:
time.sleep(backoff(log_retries))
def ws_proxy_recv(ws, local_sock, ssock, end_event, global_end_event):
@@ -345,8 +376,11 @@ def ws_proxy_recv(ws, local_sock, ssock, end_event, global_end_event):
cloudlog.exception("athenad.ws_proxy_recv.exception")
break
cloudlog.debug("athena.ws_proxy_recv closing sockets")
ssock.close()
local_sock.close()
cloudlog.debug("athena.ws_proxy_recv done closing sockets")
end_event.set()
@@ -370,10 +404,13 @@ def ws_proxy_send(ws, local_sock, signal_sock, end_event):
cloudlog.exception("athenad.ws_proxy_send.exception")
end_event.set()
cloudlog.debug("athena.ws_proxy_send closing sockets")
signal_sock.close()
cloudlog.debug("athena.ws_proxy_send done closing sockets")
def ws_recv(ws, end_event):
last_ping = int(sec_since_boot() * 1e9)
while not end_event.is_set():
try:
opcode, data = ws.recv_data(control_frame=True)
@@ -382,9 +419,13 @@ def ws_recv(ws, end_event):
data = data.decode("utf-8")
recv_queue.put_nowait(data)
elif opcode == ABNF.OPCODE_PING:
Params().put("LastAthenaPingTime", str(int(sec_since_boot() * 1e9)))
last_ping = int(sec_since_boot() * 1e9)
Params().put("LastAthenaPingTime", str(last_ping))
except WebSocketTimeoutException:
pass
ns_since_last_ping = int(sec_since_boot() * 1e9) - last_ping
if ns_since_last_ping > RECONNECT_TIMEOUT_S * 1e9:
cloudlog.exception("athenad.wc_recv.timeout")
end_event.set()
except Exception:
cloudlog.exception("athenad.ws_recv.exception")
end_event.set()
@@ -409,26 +450,41 @@ def backoff(retries):
return random.randrange(0, min(128, int(2 ** retries)))
def manage_tokens(api):
if not TICI:
return
try:
params = Params()
mapbox = api.get(f"/v1/tokens/mapbox/{api.dongle_id}/", timeout=5.0, access_token=api.get_token())
if mapbox.status_code == 200:
params.put("MapboxToken", mapbox.json()["token"])
else:
params.delete("MapboxToken")
except Exception:
cloudlog.exception("Failed to update tokens")
def main():
params = Params()
dongle_id = params.get("DongleId", encoding='utf-8')
crash.init()
crash.bind_user(id=dongle_id)
crash.bind_extra(dirty=dirty, origin=origin, branch=branch, commit=commit,
device=HARDWARE.get_device_type())
ws_uri = ATHENA_HOST + "/ws/v2/" + dongle_id
api = Api(dongle_id)
conn_retries = 0
while 1:
try:
cloudlog.event("athenad.main.connecting_ws", ws_uri=ws_uri)
ws = create_connection(ws_uri,
cookie="jwt=" + api.get_token(),
enable_multithread=True)
cloudlog.event("athenad.main.connected_ws", ws_uri=ws_uri)
enable_multithread=True,
timeout=1.0)
ws.settimeout(1)
cloudlog.event("athenad.main.connected_ws", ws_uri=ws_uri)
manage_tokens(api)
conn_retries = 0
handle_long_poll(ws)
except (KeyboardInterrupt, SystemExit):
@@ -437,7 +493,6 @@ def main():
conn_retries += 1
params.delete("LastAthenaPingTime")
except Exception:
crash.capture_exception()
cloudlog.exception("athenad.main.exception")
conn_retries += 1

View File

@@ -11,7 +11,7 @@ from common.spinner import Spinner
from common.file_helpers import mkdirs_exists_ok
from common.basedir import PERSIST
from selfdrive.controls.lib.alertmanager import set_offroad_alert
from selfdrive.hardware import HARDWARE
from selfdrive.hardware import HARDWARE, JETSON
from selfdrive.swaglog import cloudlog
@@ -20,6 +20,10 @@ UNREGISTERED_DONGLE_ID = "UnregisteredDevice"
def register(show_spinner=False) -> str:
params = Params()
if not params.get_bool('dp_reg') or params.get_bool('dp_jetson'):
return UNREGISTERED_DONGLE_ID
if JETSON:
return UNREGISTERED_DONGLE_ID
params.put("SubscriberInfo", HARDWARE.get_subscriber_info())
IMEI = params.get("IMEI", encoding='utf8')

View File

@@ -1,9 +1,15 @@
Import('env', 'envCython', 'common', 'cereal', 'messaging')
# dp - Add read dp_disable_relay value
if FindFile('dp_disable_relay', '/data/params/d') != None:
with open('/data/params/d/dp_disable_relay') as f:
# dp - Add read dp_toyota_disable_relay value
if FindFile('dp_toyota_disable_relay', '/data/params/d') != None:
with open('/data/params/d/dp_toyota_disable_relay') as f:
if (int(f.read().strip())) == 1:
env.Append(CCFLAGS='-DDisableRelay')
if FindFile('dp_panda_no_gps', '/data/params/d') != None:
with open('/data/params/d/dp_panda_no_gps') as f:
if (int(f.read().strip())) == 1:
env.Append(CCFLAGS='-DNoGPS')
env.Program('boardd', ['boardd.cc', 'panda.cc', 'pigeon.cc'], LIBS=['usb-1.0', common, cereal, messaging, 'pthread', 'zmq', 'capnp', 'kj'])
env.Library('libcan_list_to_can_capnp', ['can_list_to_can_capnp.cc'])

View File

@@ -12,8 +12,6 @@
#include <atomic>
#include <bitset>
#include <cassert>
#include <ctime>
#include <iostream>
#include <thread>
#include <unordered_map>
@@ -42,21 +40,7 @@ std::atomic<bool> safety_setter_thread_running(false);
std::atomic<bool> ignition(false);
ExitHandler do_exit;
struct tm get_time(){
time_t rawtime;
time(&rawtime);
struct tm sys_time;
gmtime_r(&rawtime, &sys_time);
return sys_time;
}
bool time_valid(struct tm sys_time){
int year = 1900 + sys_time.tm_year;
int month = 1 + sys_time.tm_mon;
return (year > 2020) || (year == 2020 && month >= 10);
}
void safety_setter_thread() {
LOGD("Starting safety setter thread");
@@ -167,10 +151,10 @@ bool usb_connect() {
if (tmp_panda->has_rtc){
setenv("TZ","UTC",1);
struct tm sys_time = get_time();
struct tm sys_time = util::get_time();
struct tm rtc_time = tmp_panda->get_rtc();
if (!time_valid(sys_time) && time_valid(rtc_time)) {
if (!util::time_valid(sys_time) && util::time_valid(rtc_time)) {
LOGE("System time wrong, setting from RTC. "
"System: %d-%02d-%02d %02d:%02d:%02d RTC: %d-%02d-%02d %02d:%02d:%02d",
sys_time.tm_year + 1900, sys_time.tm_mon + 1, sys_time.tm_mday,
@@ -324,7 +308,7 @@ void panda_state_thread(bool spoofing_started) {
// clear VIN, CarParams, and set new safety on car start
if (ignition && !ignition_last) {
params.clearAll(CLEAR_ON_IGNITION);
params.clearAll(CLEAR_ON_IGNITION_ON);
if (!safety_setter_thread_running) {
safety_setter_thread_running = true;
@@ -332,15 +316,17 @@ void panda_state_thread(bool spoofing_started) {
} else {
LOGW("Safety setter thread already running");
}
} else if (!ignition && ignition_last) {
params.clearAll(CLEAR_ON_IGNITION_OFF);
}
// Write to rtc once per minute when no ignition present
if ((panda->has_rtc) && !ignition && (no_ignition_cnt % 120 == 1)){
// Write time to RTC if it looks reasonable
setenv("TZ","UTC",1);
struct tm sys_time = get_time();
struct tm sys_time = util::get_time();
if (time_valid(sys_time)){
if (util::time_valid(sys_time)){
struct tm rtc_time = panda->get_rtc();
double seconds = difftime(mktime(&rtc_time), mktime(&sys_time));
@@ -362,7 +348,10 @@ void panda_state_thread(bool spoofing_started) {
// build msg
MessageBuilder msg;
auto ps = msg.initEvent().initPandaState();
auto evt = msg.initEvent();
evt.setValid(panda->comms_healthy);
auto ps = evt.initPandaState();
ps.setUptime(pandaState.uptime);
if (Hardware::TICI()) {
@@ -394,6 +383,8 @@ void panda_state_thread(bool spoofing_started) {
ps.setFanSpeedRpm(fan_speed_rpm);
ps.setFaultStatus(cereal::PandaState::FaultStatus(pandaState.fault_status));
ps.setPowerSaveEnabled((bool)(pandaState.power_save_enabled));
ps.setHeartbeatLost((bool)(pandaState.heartbeat_lost));
ps.setHarnessStatus(cereal::PandaState::HarnessStatus(pandaState.car_harness_status));
// Convert faults bitset to capnp list
std::bitset<sizeof(pandaState.faults) * 8> fault_bits(pandaState.faults);
@@ -488,16 +479,20 @@ static void pigeon_publish_raw(PubMaster &pm, const std::string &dat) {
}
void pigeon_thread() {
PubMaster pm({"ubloxRaw"});
bool ignition_last = false;
Pigeon *pigeon = Hardware::TICI() ? Pigeon::connect("/dev/ttyHS0") : Pigeon::connect(panda);
// dp - use toyota directly
#ifdef DisableRelay
panda->set_safety_model(cereal::CarParams::SafetyModel::TOYOTA);
#endif
// from @florianbrede-ayet, disable gps for white panda
#ifdef NoGPS
return;
#endif
PubMaster pm({"ubloxRaw"});
bool ignition_last = false;
Pigeon *pigeon = Hardware::TICI() ? Pigeon::connect("/dev/ttyHS0") : Pigeon::connect(panda);
std::unordered_map<char, uint64_t> last_recv_time;
std::unordered_map<char, int64_t> cls_max_dt = {
{(char)ublox::CLASS_NAV, int64_t(900000000ULL)}, // 0.9s
@@ -552,6 +547,7 @@ void pigeon_thread() {
} else if (!ignition && ignition_last) {
// power off on falling edge of ignition
LOGD("powering off pigeon\n");
pigeon->stop();
pigeon->set_power(false);
}

View File

@@ -3,7 +3,6 @@
#include <unistd.h>
#include <cassert>
#include <iostream>
#include <stdexcept>
#include <vector>
@@ -152,6 +151,7 @@ int Panda::usb_bulk_read(unsigned char endpoint, unsigned char* data, int length
if (err == LIBUSB_ERROR_TIMEOUT) {
break; // timeout is okay to exit, recv still happened
} else if (err == LIBUSB_ERROR_OVERFLOW) {
comms_healthy = false;
LOGE_100("overflow got 0x%x", transferred);
} else if (err != 0) {
handle_usb_issue(err, __func__);
@@ -296,9 +296,11 @@ int Panda::can_receive(kj::Array<capnp::word>& out_buf) {
size_t num_msg = recv / 0x10;
MessageBuilder msg;
auto canData = msg.initEvent().initCan(num_msg);
auto evt = msg.initEvent();
evt.setValid(comms_healthy);
// populate message
auto canData = evt.initCan(num_msg);
for (int i = 0; i < num_msg; i++) {
if (data[i*4] & 4) {
// extended

View File

@@ -1,7 +1,5 @@
#pragma once
#include <pthread.h>
#include <atomic>
#include <cstdint>
#include <ctime>
@@ -38,6 +36,7 @@ struct __attribute__((packed)) health_t {
int16_t safety_param;
uint8_t fault_status;
uint8_t power_save_enabled;
uint8_t heartbeat_lost;
};
@@ -54,6 +53,7 @@ class Panda {
~Panda();
std::atomic<bool> connected = true;
std::atomic<bool> comms_healthy = true;
cereal::PandaState::PandaType hw_type = cereal::PandaState::PandaType::UNKNOWN;
bool has_rtc = false;

View File

@@ -6,10 +6,12 @@
#include <unistd.h>
#include <cassert>
#include <optional>
#include "selfdrive/common/gpio.h"
#include "selfdrive/common/swaglog.h"
#include "selfdrive/common/util.h"
#include "selfdrive/locationd/ublox_msg.h"
// Termios on macos doesn't define all baud rate constants
#ifndef B460800
@@ -22,7 +24,8 @@ extern ExitHandler do_exit;
const std::string ack = "\xb5\x62\x05\x01\x02\x00";
const std::string nack = "\xb5\x62\x05\x00\x02\x00";
const std::string sos_ack = "\xb5\x62\x09\x14\x08\x00\x02\x00\x00\x00\x01\x00\x00\x00";
const std::string sos_nack = "\xb5\x62\x09\x14\x08\x00\x02\x00\x00\x00\x00\x00\x00\x00";
Pigeon * Pigeon::connect(Panda * p){
PandaPigeon * pigeon = new PandaPigeon();
@@ -38,7 +41,7 @@ Pigeon * Pigeon::connect(const char * tty){
return pigeon;
}
bool Pigeon::wait_for_ack(){
bool Pigeon::wait_for_ack(std::string ack, std::string nack){
std::string s;
while (!do_exit){
s += receive();
@@ -59,6 +62,10 @@ bool Pigeon::wait_for_ack(){
return false;
}
bool Pigeon::wait_for_ack(){
return wait_for_ack(ack, nack);
}
bool Pigeon::send_with_ack(std::string cmd){
send(cmd);
return wait_for_ack();
@@ -110,6 +117,11 @@ void Pigeon::init() {
if (!send_with_ack("\xB5\x62\x06\x01\x03\x00\x0A\x09\x01\x1E\x70"s)) continue;
if (!send_with_ack("\xB5\x62\x06\x01\x03\x00\x0A\x0B\x01\x20\x74"s)) continue;
auto time = util::get_time();
if (util::time_valid(time)){
LOGW("Sending current time to ublox");
send(ublox::build_ubx_mga_ini_time_utc(time));
}
LOGW("panda GPS on");
return;
@@ -117,6 +129,22 @@ void Pigeon::init() {
LOGE("failed to initialize panda GPS");
}
void Pigeon::stop(){
LOGW("Storing almanac in ublox flash");
// Controlled GNSS stop
send("\xB5\x62\x06\x04\x04\x00\x00\x00\x08\x00\x16\x74"s);
// Store almanac in flash
send("\xB5\x62\x09\x14\x04\x00\x00\x00\x00\x00\x21\xEC"s);
if (wait_for_ack(sos_ack, sos_nack)) {
LOGW("Done storing almanac");
} else {
LOGE("Error storing almanac");
}
}
void PandaPigeon::connect(Panda * p) {
panda = p;
}

View File

@@ -14,7 +14,9 @@ class Pigeon {
virtual ~Pigeon(){};
void init();
void stop();
bool wait_for_ack();
bool wait_for_ack(std::string ack, std::string nack);
bool send_with_ack(std::string cmd);
virtual void set_baud(int baud) = 0;
virtual void send(const std::string &s) = 0;

View File

@@ -1,13 +1,10 @@
Import('env', 'arch', 'cereal', 'messaging', 'common', 'gpucommon', 'visionipc', 'USE_WEBCAM', 'QCOM_REPLAY', 'USE_MIPI')
Import('env', 'arch', 'cereal', 'messaging', 'common', 'gpucommon', 'visionipc', 'USE_WEBCAM', 'USE_MIPI')
libs = ['m', 'pthread', common, 'jpeg', 'OpenCL', cereal, messaging, 'zmq', 'capnp', 'kj', visionipc, gpucommon]
if arch == "aarch64":
libs += ['gsl', 'CB', 'adreno_utils', 'EGL', 'GLESv3', 'cutils', 'ui']
if QCOM_REPLAY:
cameras = ['cameras/camera_frame_stream.cc']
else:
cameras = ['cameras/camera_qcom.cc']
cameras = ['cameras/camera_qcom.cc']
elif arch == "larch64":
libs += ['atomic']
cameras = ['cameras/camera_qcom2.cc']

View File

@@ -17,7 +17,7 @@
#include "selfdrive/common/util.h"
#include "selfdrive/hardware/hw.h"
#if defined(QCOM) && !defined(QCOM_REPLAY)
#ifdef QCOM
#include "selfdrive/camerad/cameras/camera_qcom.h"
#elif QCOM2
#include "selfdrive/camerad/cameras/camera_qcom2.h"

View File

@@ -1,6 +1,5 @@
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

View File

@@ -1,7 +1,5 @@
#pragma once
#include <stdbool.h>
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
#ifdef __APPLE__
#include <OpenCL/cl.h>

View File

@@ -4,8 +4,6 @@
#include <fcntl.h>
#include <math.h>
#include <poll.h>
#include <pthread.h>
#include <stdbool.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <unistd.h>

View File

@@ -1,7 +1,5 @@
#pragma once
#include <pthread.h>
#include <stdbool.h>
#include <stdint.h>
#include <atomic>

View File

@@ -273,7 +273,7 @@ void sensors_init(int video0_fd, int sensor_fd, int camera_num) {
power->count = 1;
power->cmd_type = CAMERA_SENSOR_CMD_TYPE_PWR_UP;
power->power_settings[0].power_seq_type = 0;
power->power_settings[0].config_val_low = 24000000; //Hz
power->power_settings[0].config_val_low = 19200000; //Hz
power = power_set_wait(power, 10);
// 8,1 is this reset?

View File

@@ -1,7 +1,6 @@
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include <pthread.h>
#include <media/cam_req_mgr.h>

View File

@@ -8,7 +8,7 @@ struct i2c_random_wr_payload init_array_ar0231[] = {
{0x302A, 0x0006}, // VT_PIX_CLK_DIV
{0x302C, 0x0001}, // VT_SYS_CLK_DIV
{0x302E, 0x0002}, // PRE_PLL_CLK_DIV
{0x3030, 0x0028}, // PLL_MULTIPLIER
{0x3030, 0x0032}, // PLL_MULTIPLIER
{0x3036, 0x000A}, // OP_WORD_CLK_DIV
{0x3038, 0x0001}, // OP_SYS_CLK_DIV

View File

@@ -15,7 +15,7 @@
#include "selfdrive/common/util.h"
#include "selfdrive/hardware/hw.h"
#if defined(QCOM) && !defined(QCOM_REPLAY)
#ifdef QCOM
#include "selfdrive/camerad/cameras/camera_qcom.h"
#elif QCOM2
#include "selfdrive/camerad/cameras/camera_qcom2.h"

View File

@@ -1,18 +1,21 @@
#!/usr/bin/env python3
import os
import signal
import subprocess
import time
import numpy as np
from PIL import Image
from typing import List
import cereal.messaging as messaging
from common.basedir import BASEDIR
from common.params import Params
from common.realtime import DT_MDL
from common.transformations.camera import eon_f_frame_size, eon_d_frame_size, leon_d_frame_size, tici_f_frame_size
from selfdrive.hardware import TICI
from selfdrive.controls.lib.alertmanager import set_offroad_alert
from selfdrive.manager.process_config import managed_processes
LM_THRESH = 120 # defined in selfdrive/camerad/imgproc/utils.h
def jpeg_write(fn, dat):
@@ -29,7 +32,13 @@ def extract_image(dat, frame_sizes):
return np.dstack([r, g, b])
def get_snapshots(frame="roadCameraState", front_frame="driverCameraState"):
def rois_in_focus(lapres: List[float]) -> float:
sz = len(lapres)
return sum([1. / sz for sharpness in
lapres if sharpness >= LM_THRESH])
def get_snapshots(frame="roadCameraState", front_frame="driverCameraState", focus_perc_threshold=0.):
frame_sizes = [eon_f_frame_size, eon_d_frame_size, leon_d_frame_size, tici_f_frame_size]
frame_sizes = {w * h: (w, h) for (w, h) in frame_sizes}
@@ -39,10 +48,17 @@ def get_snapshots(frame="roadCameraState", front_frame="driverCameraState"):
if front_frame is not None:
sockets.append(front_frame)
# wait 4 sec from camerad startup for focus and exposure
sm = messaging.SubMaster(sockets)
while min(sm.logMonoTime.values()) == 0:
while sm[sockets[0]].frameId < int(4. / DT_MDL):
sm.update()
start_t = time.monotonic()
while time.monotonic() - start_t < 10:
sm.update()
if min(sm.rcv_frame.values()) > 1 and rois_in_focus(sm[frame].sharpnessScore) >= focus_perc_threshold:
break
rear = extract_image(sm[frame].image, frame_sizes) if frame is not None else None
front = extract_image(sm[front_frame].image, frame_sizes) if front_frame is not None else None
return rear, front
@@ -63,7 +79,6 @@ def snapshot():
# Check if camerad is already started
try:
subprocess.check_call(["pgrep", "camerad"])
print("Camerad already running")
params.put_bool("IsTakingSnapshot", False)
params.delete("Offroad_IsTakingSnapshot")
@@ -71,23 +86,19 @@ def snapshot():
except subprocess.CalledProcessError:
pass
env = os.environ.copy()
env["SEND_ROAD"] = "1"
env["SEND_WIDE_ROAD"] = "1"
os.environ["SEND_ROAD"] = "1"
os.environ["SEND_WIDE_ROAD"] = "1"
if front_camera_allowed:
env["SEND_DRIVER"] = "1"
proc = subprocess.Popen(os.path.join(BASEDIR, "selfdrive/camerad/camerad"),
cwd=os.path.join(BASEDIR, "selfdrive/camerad"), env=env)
time.sleep(3.0)
os.environ["SEND_DRIVER"] = "1"
managed_processes['camerad'].start()
frame = "wideRoadCameraState" if TICI else "roadCameraState"
front_frame = "driverCameraState" if front_camera_allowed else None
rear, front = get_snapshots(frame, front_frame)
focus_perc_threshold = 0. if TICI else 10 / 12.
proc.send_signal(signal.SIGINT)
proc.communicate()
rear, front = get_snapshots(frame, front_frame, focus_perc_threshold)
managed_processes['camerad'].stop()
params.put_bool("IsTakingSnapshot", False)
set_offroad_alert("Offroad_IsTakingSnapshot", False)
@@ -103,6 +114,7 @@ if __name__ == "__main__":
if pic is not None:
print(pic.shape)
jpeg_write("/tmp/back.jpg", pic)
jpeg_write("/tmp/front.jpg", fpic)
if fpic is not None:
jpeg_write("/tmp/front.jpg", fpic)
else:
print("Error taking snapshot")

View File

@@ -121,14 +121,3 @@ def create_gas_command(packer, gas_amount, idx):
def make_can_msg(addr, dat, bus):
return [addr, 0, dat, bus]
def is_ecu_disconnected(fingerprint, fingerprint_list, ecu_fingerprint, car, ecu):
# check if a stock ecu is disconnected by looking for specific CAN msgs in the fingerprint
# return True if the reference car fingerprint contains the ecu fingerprint msg and
# fingerprint does not contains messages normally sent by a given ecu
ecu_in_car = False
for car_finger in fingerprint_list[car]:
if any(msg in car_finger for msg in ecu_fingerprint[ecu]):
ecu_in_car = True
return ecu_in_car and not any(msg in fingerprint for msg in ecu_fingerprint[ecu])

View File

@@ -2,7 +2,7 @@ import os
from common.params import Params, put_nonblocking
from common.basedir import BASEDIR
from selfdrive.version import comma_remote, tested_branch
from selfdrive.car.fingerprints import eliminate_incompatible_cars, all_known_cars
from selfdrive.car.fingerprints import eliminate_incompatible_cars, all_legacy_fingerprint_cars
from selfdrive.car.vin import get_vin, VIN_UNKNOWN
from selfdrive.car.fw_versions import get_fw_versions, match_fw_to_car
from selfdrive.swaglog import cloudlog
@@ -13,14 +13,17 @@ from cereal import car
EventName = car.CarEvent.EventName
def get_startup_event(car_recognized, controller_available, fuzzy_fingerprint):
if True: #comma_remote and tested_branch:
def get_startup_event(car_recognized, controller_available, fuzzy_fingerprint, fw_seen):
if True:
event = EventName.startup
else:
event = EventName.startupMaster
if not car_recognized:
event = EventName.startupNoCar
if fw_seen:
event = EventName.startupNoCar
else:
event = EventName.startupNoFw
elif car_recognized and not controller_available:
event = EventName.startupNoControl
elif car_recognized and fuzzy_fingerprint:
@@ -83,25 +86,16 @@ def only_toyota_left(candidate_cars):
# **** for use live only ****
def fingerprint(logcan, sendcan, has_relay):
params = Params()
car_selected = params.get('dp_car_selected', encoding='utf8')
car_detected = params.get('dp_car_detected', encoding='utf8')
cached_params = params.get("CarParamsCache")
if cached_params is None and car_selected == "" and car_detected != "":
put_nonblocking('dp_car_selected', car_detected)
put_nonblocking('dp_car_detected', "")
fixed_fingerprint = os.environ.get('FINGERPRINT', "")
if fixed_fingerprint == "" and cached_params is None and car_selected != "":
fixed_fingerprint = car_selected
def fingerprint(logcan, sendcan):
dp_car_assigned = Params().get('dp_car_assigned', encoding='utf8')
fixed_fingerprint = os.environ.get('FINGERPRINT', "" if dp_car_assigned is None else dp_car_assigned)
skip_fw_query = os.environ.get('SKIP_FW_QUERY', False)
if has_relay and not fixed_fingerprint and not skip_fw_query:
if not fixed_fingerprint and not skip_fw_query:
# Vin query only reliably works thorugh OBDII
bus = 1
# cached_params = Params().get("CarParamsCache")
cached_params = Params().get("CarParamsCache")
if cached_params is not None:
cached_params = car.CarParams.from_bytes(cached_params)
if cached_params.carName == "mock":
@@ -125,7 +119,7 @@ def fingerprint(logcan, sendcan, has_relay):
Params().put("CarVin", vin)
finger = gen_empty_fingerprint()
candidate_cars = {i: all_known_cars() for i in [0, 1]} # attempt fingerprint on both bus 0 and 1
candidate_cars = {i: all_legacy_fingerprint_cars() for i in [0, 1]} # attempt fingerprint on both bus 0 and 1
frame = 0
frame_fingerprint = 10 # 0.1s
car_fingerprint = None
@@ -181,8 +175,8 @@ def fingerprint(logcan, sendcan, has_relay):
return car_fingerprint, finger, vin, car_fw, source, exact_match
def get_car(logcan, sendcan, has_relay=False):
candidate, fingerprints, vin, car_fw, source, exact_match = fingerprint(logcan, sendcan, has_relay)
def get_car(logcan, sendcan):
candidate, fingerprints, vin, car_fw, source, exact_match = fingerprint(logcan, sendcan)
if candidate is None:
cloudlog.warning("car doesn't match any fingerprints: %r", fingerprints)
@@ -190,7 +184,16 @@ def get_car(logcan, sendcan, has_relay=False):
try:
CarInterface, CarController, CarState = interfaces[candidate]
car_params = CarInterface.get_params(candidate, fingerprints, car_fw, has_relay)
car_params = CarInterface.get_params(candidate, fingerprints, car_fw)
candidate_changed = Params().get('dp_last_candidate') != candidate
put_nonblocking("dp_sr_stock", str(car_params.steerRatio))
# update last candidate
if candidate_changed:
put_nonblocking('dp_last_candidate', candidate)
# update steering_ratio init val
dp_sr_custom = Params().get("dp_sr_custom", encoding='utf8')
if dp_sr_custom == '' or candidate_changed or (dp_sr_custom != '' and float(dp_sr_custom) <= 9.99):
put_nonblocking("dp_sr_custom", str(car_params.steerRatio))
car_params.carVin = vin
car_params.carFw = car_fw
car_params.fingerprintSource = source
@@ -198,7 +201,7 @@ def get_car(logcan, sendcan, has_relay=False):
return CarInterface(car_params, CarController, CarState), car_params
except KeyError:
put_nonblocking('dp_car_selected', "")
put_nonblocking('dp_car_detected', "")
put_nonblocking("dp_car_assigned", '')
put_nonblocking("dp_sr_custom", '9.99')
put_nonblocking("dp_sr_stock", '9.99')
return None, None

View File

@@ -9,48 +9,47 @@ from selfdrive.car.chrysler.values import DBC, STEER_THRESHOLD
class CarState(CarStateBase):
def __init__(self, CP):
super().__init__(CP)
can_define = CANDefine(DBC[CP.carFingerprint]['pt'])
self.shifter_values = can_define.dv["GEAR"]['PRNDL']
can_define = CANDefine(DBC[CP.carFingerprint]["pt"])
self.shifter_values = can_define.dv["GEAR"]["PRNDL"]
def update(self, cp, cp_cam):
ret = car.CarState.new_message()
self.frame = int(cp.vl["EPS_STATUS"]['COUNTER'])
self.frame = int(cp.vl["EPS_STATUS"]["COUNTER"])
ret.doorOpen = any([cp.vl["DOORS"]['DOOR_OPEN_FL'],
cp.vl["DOORS"]['DOOR_OPEN_FR'],
cp.vl["DOORS"]['DOOR_OPEN_RL'],
cp.vl["DOORS"]['DOOR_OPEN_RR']])
ret.seatbeltUnlatched = cp.vl["SEATBELT_STATUS"]['SEATBELT_DRIVER_UNLATCHED'] == 1
ret.doorOpen = any([cp.vl["DOORS"]["DOOR_OPEN_FL"],
cp.vl["DOORS"]["DOOR_OPEN_FR"],
cp.vl["DOORS"]["DOOR_OPEN_RL"],
cp.vl["DOORS"]["DOOR_OPEN_RR"]])
ret.seatbeltUnlatched = cp.vl["SEATBELT_STATUS"]["SEATBELT_DRIVER_UNLATCHED"] == 1
ret.brakePressed = cp.vl["BRAKE_2"]['BRAKE_PRESSED_2'] == 5 # human-only
ret.brakePressed = cp.vl["BRAKE_2"]["BRAKE_PRESSED_2"] == 5 # human-only
ret.brake = 0
ret.brakeLights = ret.brakePressed
ret.gas = cp.vl["ACCEL_GAS_134"]['ACCEL_134']
ret.gas = cp.vl["ACCEL_GAS_134"]["ACCEL_134"]
ret.gasPressed = ret.gas > 1e-5
ret.espDisabled = (cp.vl["TRACTION_BUTTON"]['TRACTION_OFF'] == 1)
ret.espDisabled = (cp.vl["TRACTION_BUTTON"]["TRACTION_OFF"] == 1)
ret.wheelSpeeds.fl = cp.vl['WHEEL_SPEEDS']['WHEEL_SPEED_FL']
ret.wheelSpeeds.rr = cp.vl['WHEEL_SPEEDS']['WHEEL_SPEED_RR']
ret.wheelSpeeds.rl = cp.vl['WHEEL_SPEEDS']['WHEEL_SPEED_RL']
ret.wheelSpeeds.fr = cp.vl['WHEEL_SPEEDS']['WHEEL_SPEED_FR']
ret.vEgoRaw = (cp.vl['SPEED_1']['SPEED_LEFT'] + cp.vl['SPEED_1']['SPEED_RIGHT']) / 2.
ret.wheelSpeeds.fl = cp.vl["WHEEL_SPEEDS"]["WHEEL_SPEED_FL"]
ret.wheelSpeeds.rr = cp.vl["WHEEL_SPEEDS"]["WHEEL_SPEED_RR"]
ret.wheelSpeeds.rl = cp.vl["WHEEL_SPEEDS"]["WHEEL_SPEED_RL"]
ret.wheelSpeeds.fr = cp.vl["WHEEL_SPEEDS"]["WHEEL_SPEED_FR"]
ret.vEgoRaw = (cp.vl["SPEED_1"]["SPEED_LEFT"] + cp.vl["SPEED_1"]["SPEED_RIGHT"]) / 2.
ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw)
ret.standstill = not ret.vEgoRaw > 0.001
ret.leftBlinker = cp.vl["STEERING_LEVERS"]['TURN_SIGNALS'] == 1
ret.rightBlinker = cp.vl["STEERING_LEVERS"]['TURN_SIGNALS'] == 2
ret.steeringAngleDeg = cp.vl["STEERING"]['STEER_ANGLE']
ret.steeringRateDeg = cp.vl["STEERING"]['STEERING_RATE']
ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(cp.vl['GEAR']['PRNDL'], None))
ret.leftBlinker = cp.vl["STEERING_LEVERS"]["TURN_SIGNALS"] == 1
ret.rightBlinker = cp.vl["STEERING_LEVERS"]["TURN_SIGNALS"] == 2
ret.steeringAngleDeg = cp.vl["STEERING"]["STEER_ANGLE"]
ret.steeringRateDeg = cp.vl["STEERING"]["STEERING_RATE"]
ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(cp.vl["GEAR"]["PRNDL"], None))
ret.cruiseState.enabled = cp.vl["ACC_2"]['ACC_STATUS_2'] == 7 # ACC is green.
ret.cruiseState.enabled = cp.vl["ACC_2"]["ACC_STATUS_2"] == 7 # ACC is green.
ret.cruiseState.available = ret.cruiseState.enabled # FIXME: for now same as enabled
ret.cruiseState.speed = cp.vl["DASHBOARD"]['ACC_SPEED_CONFIG_KPH'] * CV.KPH_TO_MS
ret.cruiseState.speed = cp.vl["DASHBOARD"]["ACC_SPEED_CONFIG_KPH"] * CV.KPH_TO_MS
# CRUISE_STATE is a three bit msg, 0 is off, 1 and 2 are Non-ACC mode, 3 and 4 are ACC mode, find if there are other states too
ret.cruiseState.nonAdaptive = cp.vl["DASHBOARD"]['CRUISE_STATE'] in [1, 2]
ret.cruiseState.nonAdaptive = cp.vl["DASHBOARD"]["CRUISE_STATE"] in [1, 2]
ret.steeringTorque = cp.vl["EPS_STATUS"]["TORQUE_DRIVER"]
ret.steeringTorqueEps = cp.vl["EPS_STATUS"]["TORQUE_MOTOR"]
@@ -58,15 +57,15 @@ class CarState(CarStateBase):
steer_state = cp.vl["EPS_STATUS"]["LKAS_STATE"]
ret.steerError = steer_state == 4 or (steer_state == 0 and ret.vEgo > self.CP.minSteerSpeed)
ret.genericToggle = bool(cp.vl["STEERING_LEVERS"]['HIGH_BEAM_FLASH'])
if self.CP.enableBsm:
ret.leftBlindspot = cp.vl["BLIND_SPOT_WARNINGS"]['BLIND_SPOT_LEFT'] == 1
ret.rightBlindspot = cp.vl["BLIND_SPOT_WARNINGS"]['BLIND_SPOT_RIGHT'] == 1
ret.genericToggle = bool(cp.vl["STEERING_LEVERS"]["HIGH_BEAM_FLASH"])
self.lkas_counter = cp_cam.vl["LKAS_COMMAND"]['COUNTER']
self.lkas_car_model = cp_cam.vl["LKAS_HUD"]['CAR_MODEL']
self.lkas_status_ok = cp_cam.vl["LKAS_HEARTBIT"]['LKAS_STATUS_OK']
if self.CP.enableBsm:
ret.leftBlindspot = cp.vl["BLIND_SPOT_WARNINGS"]["BLIND_SPOT_LEFT"] == 1
ret.rightBlindspot = cp.vl["BLIND_SPOT_WARNINGS"]["BLIND_SPOT_RIGHT"] == 1
self.lkas_counter = cp_cam.vl["LKAS_COMMAND"]["COUNTER"]
self.lkas_car_model = cp_cam.vl["LKAS_HUD"]["CAR_MODEL"]
self.lkas_status_ok = cp_cam.vl["LKAS_HEARTBIT"]["LKAS_STATUS_OK"]
return ret
@@ -126,8 +125,7 @@ class CarState(CarStateBase):
]
checks += [("BLIND_SPOT_WARNINGS", 2)]
checks = []
return CANParser(DBC[CP.carFingerprint]['pt'], signals, checks, 0)
return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 0)
@staticmethod
def get_cam_can_parser(CP):
@@ -142,5 +140,5 @@ class CarState(CarStateBase):
("LKAS_HEARTBIT", 10),
("LKAS_HUD", 4),
]
checks = []
return CANParser(DBC[CP.carFingerprint]['pt'], signals, checks, 2)
return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 2)

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python3
from cereal import car
from selfdrive.car.chrysler.values import CAR, Ecu, ECU_FINGERPRINT, FINGERPRINTS
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, is_ecu_disconnected
from selfdrive.car.chrysler.values import CAR
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint
from selfdrive.car.interfaces import CarInterfaceBase
from common.dp_common import common_interface_atl, common_interface_get_params_lqr
@@ -11,8 +11,8 @@ class CarInterface(CarInterfaceBase):
return float(accel) / 3.0
@staticmethod
def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None, has_relay=False):
ret = CarInterfaceBase.get_std_params(candidate, fingerprint, has_relay)
def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None):
ret = CarInterfaceBase.get_std_params(candidate, fingerprint)
ret.carName = "chrysler"
ret.safetyModel = car.CarParams.SafetyModel.chrysler
ret.lateralTuning.init('pid')
@@ -50,7 +50,8 @@ class CarInterface(CarInterfaceBase):
# mass and CG position, so all cars will have approximately similar dyn behaviors
ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront)
ret.enableCamera = is_ecu_disconnected(fingerprint[0], FINGERPRINTS, ECU_FINGERPRINT, candidate, Ecu.fwdCamera) or has_relay
ret.enableCamera = True
ret.enableBsm = 720 in fingerprint[0]
# dp

View File

@@ -39,11 +39,9 @@ FINGERPRINTS = {
{55: 8, 257: 5, 258: 8, 264: 8, 268: 8, 274: 2, 280: 8, 284: 8, 288: 7, 290: 6, 292: 8, 294: 8, 300: 8, 308: 8, 320: 8, 324: 8, 331: 8, 332: 8, 344: 8, 368: 8, 376: 3, 384: 8, 388: 4, 416: 7, 448: 6, 456: 4, 464: 8, 469: 8, 480: 8, 500: 8, 501: 8, 512: 8, 514: 8, 516: 7, 517: 7, 520: 8, 524: 8, 526: 6, 528: 8, 532: 8, 542: 8, 544: 8, 557: 8, 559: 8, 560: 4, 564: 8, 571: 3, 579: 8, 584: 8, 608: 8, 624: 8, 625: 8, 632: 8, 639: 8, 656: 4, 658: 6, 660: 8, 669: 3, 671: 8, 672: 8, 678: 8, 680: 8, 705: 8, 706: 8, 709: 8, 710: 8, 719: 8, 720: 6, 729: 5, 736: 8, 746: 5, 752: 2, 760: 8, 764: 8, 766: 8, 770: 8, 773: 8, 779: 8, 784: 8, 792: 8, 799: 8, 800: 8, 804: 8, 808: 8, 816: 8, 817: 8, 820: 8, 825: 2, 826: 8, 832: 8, 838: 2, 848: 8, 853: 8, 856: 4, 860: 6, 863: 8, 882: 8, 897: 8, 924: 8, 926: 3, 937: 8, 947: 8, 948: 8, 969: 4, 974: 5, 979: 8, 980: 8, 981: 8, 982: 8, 983: 8, 984: 8, 992: 8, 993: 7, 995: 8, 996: 8, 1000: 8, 1001: 8, 1002: 8, 1003: 8, 1008: 8, 1009: 8, 1010: 8, 1011: 8, 1012: 8, 1013: 8, 1014: 8, 1015: 8, 1024: 8, 1025: 8, 1026: 8, 1031: 8, 1033: 8, 1050: 8, 1059: 8, 1098: 8, 1100: 8, 1537: 8, 1538: 8, 1562: 8},
{55: 8, 257: 5, 258: 8, 264: 8, 268: 8, 274: 2, 280: 8, 284: 8, 288: 7, 290: 6, 292: 8, 294: 8, 300: 8, 308: 8, 320: 8, 324: 8, 331: 8, 332: 8, 344: 8, 368: 8, 376: 3, 384: 8, 388: 4, 416: 7, 448: 6, 456: 4, 464: 8, 469: 8, 480: 8, 500: 8, 501: 8, 512: 8, 514: 8, 516: 7, 517: 7, 520: 8, 524: 8, 526: 6, 528: 8, 532: 8, 542: 8, 544: 8, 557: 8, 559: 8, 560: 4, 564: 4, 571: 3, 584: 8, 608: 8, 624: 8, 625: 8, 632: 8, 639: 8, 656: 4, 658: 6, 660: 8, 669: 3, 671: 8, 672: 8, 678: 8, 680: 8, 705: 8, 706: 8, 709: 8, 710: 8, 719: 8, 720: 6, 729: 5, 736: 8, 746: 5, 752: 2, 760: 8, 764: 8, 766: 8, 770: 8, 773: 8, 779: 8, 784: 8, 792: 8, 799: 8, 800: 8, 804: 8, 808: 8, 816: 8, 817: 8, 820: 8, 825: 2, 826: 8, 832: 8, 838: 2, 848: 8, 853: 8, 856: 4, 860: 6, 863: 8, 882: 8, 897: 8, 924: 3, 926: 3, 937: 8, 947: 8, 948: 8, 969: 4, 974: 5, 979: 8, 980: 8, 981: 8, 982: 8, 983: 8, 984: 8, 992: 8, 993: 7, 995: 8, 996: 8, 1000: 8, 1001: 8, 1002: 8, 1003: 8, 1008: 8, 1009: 8, 1010: 8, 1011: 8, 1012: 8, 1013: 8, 1014: 8, 1015: 8, 1024: 8, 1025: 8, 1026: 8, 1031: 8, 1033: 8, 1050: 8, 1059: 8, 1098: 8, 1100: 8, 1537: 8, 1538: 8, 1562: 8},
],
CAR.PACIFICA_2020: [
{
55: 8, 179: 8, 181: 8, 257: 5, 258: 8, 264: 8, 268: 8, 274: 2, 280: 8, 284: 8, 288: 7, 290: 6, 292: 8, 294: 8, 300: 8, 308: 8, 320: 8, 324: 8, 331: 8, 332: 8, 344: 8, 368: 8, 376: 3, 384: 8, 388: 4, 416: 7, 448: 6, 456: 4, 464: 8, 469: 8, 480: 8, 500: 8, 501: 8, 512: 8, 514: 8, 520: 8, 528: 8, 532: 8, 542: 8, 544: 8, 557: 8, 559: 8, 560: 8, 564: 8, 571: 3, 579: 8, 584: 8, 608: 8, 624: 8, 625: 8, 632: 8, 639: 8, 650: 8, 658: 6, 660: 8, 669: 3, 671: 8, 672: 8, 676: 8, 678: 8, 680: 8, 683: 8, 703: 8, 705: 8, 706: 8, 709: 8, 710: 8, 719: 8, 720: 6, 729: 5, 736: 8, 746: 5, 752: 2, 754: 8, 760: 8, 764: 8, 766: 8, 770: 8, 773: 8, 779: 8, 782: 8, 784: 8, 792: 8, 799: 8, 800: 8, 804: 8, 808: 8, 816: 8, 817: 8, 820: 8, 825: 2, 826: 8, 832: 8, 838: 2, 847: 1, 848: 8, 853: 8, 856: 4, 860: 6, 863: 8, 882: 8, 897: 8, 906: 8, 924: 8, 926: 3, 937: 8, 938: 8, 939: 8, 940: 8, 941: 8, 942: 8, 943: 8, 947: 8, 948: 8, 962: 8, 969: 4, 973: 8, 974: 5, 979: 8, 980: 8, 981: 8, 982: 8, 983: 8, 984: 8, 992: 8, 993: 7, 995: 8, 996: 8, 1000: 8, 1001: 8, 1002: 8, 1003: 8, 1008: 8, 1009: 8, 1010: 8, 1011: 8, 1012: 8, 1013: 8, 1014: 8, 1015: 8, 1024: 8, 1025: 8, 1026: 8, 1031: 8, 1033: 8, 1050: 8, 1059: 8, 1098: 8, 1100: 8, 1216: 8, 1218: 8, 1220: 8, 1223: 7, 1225: 8, 1235: 8, 1242: 8, 1246: 8, 1250: 8, 1251: 8, 1252: 8, 1284: 8, 1568: 8, 1570: 8, 1856: 8, 1858: 8, 1860: 8, 1863: 8, 1865: 8, 1875: 8, 1882: 8, 1886: 8, 1890: 8, 1891: 8, 1892: 8, 2016: 8, 2017:8, 2024: 8, 2025: 8
}
],
CAR.PACIFICA_2020: [{
55: 8, 179: 8, 181: 8, 257: 5, 258: 8, 264: 8, 268: 8, 274: 2, 280: 8, 284: 8, 288: 7, 290: 6, 292: 8, 294: 8, 300: 8, 308: 8, 320: 8, 324: 8, 331: 8, 332: 8, 344: 8, 352: 8, 362: 8, 368: 8, 376: 3, 384: 8, 388: 4, 416: 7, 448: 6, 456: 4, 464: 8, 469: 8, 480: 8, 500: 8, 501: 8, 512: 8, 514: 8, 520: 8, 528: 8, 532: 8, 536: 8, 542: 8, 544: 8, 557: 8, 559: 8, 560: 8, 564: 8, 571: 3, 579: 8, 584: 8, 608: 8, 624: 8, 625: 8, 632: 8, 639: 8, 650: 8, 658: 6, 660: 8, 669: 3, 671: 8, 672: 8, 676: 8, 678: 8, 680: 8, 683: 8, 703: 8, 705: 8, 706: 8, 709: 8, 710: 8, 719: 8, 720: 6, 729: 5, 736: 8, 746: 5, 752: 2, 754: 8, 760: 8, 764: 8, 766: 8, 770: 8, 773: 8, 776: 8, 779: 8, 782: 8, 784: 8, 792: 8, 799: 8, 800: 8, 804: 8, 808: 8, 816: 8, 817: 8, 820: 8, 825: 2, 826: 8, 832: 8, 838: 2, 847: 1, 848: 8, 853: 8, 856: 4, 860: 6, 863: 8, 882: 8, 897: 8, 906: 8, 924: 8, 926: 3, 937: 8, 938: 8, 939: 8, 940: 8, 941: 8, 942: 8, 943: 8, 947: 8, 948: 8, 962: 8, 969: 4, 973: 8, 974: 5, 979: 8, 980: 8, 981: 8, 982: 8, 983: 8, 984: 8, 992: 8, 993: 7, 995: 8, 996: 8, 1000: 8, 1001: 8, 1002: 8, 1003: 8, 1008: 8, 1009: 8, 1010: 8, 1011: 8, 1012: 8, 1013: 8, 1014: 8, 1015: 8, 1024: 8, 1025: 8, 1026: 8, 1031: 8, 1033: 8, 1050: 8, 1059: 8, 1098: 8, 1100: 8, 1216: 8, 1218: 8, 1220: 8, 1223: 7, 1225: 8, 1227: 8, 1235: 8, 1242: 8, 1246: 8, 1250: 8, 1251: 8, 1252: 8, 1284: 8, 1543: 8, 1568: 8, 1570: 8, 1856: 8, 1858: 8, 1860: 8, 1863: 8, 1865: 8, 1867: 8, 1875: 8, 1882: 8, 1886: 8, 1890: 8, 1891: 8, 1892: 8, 2016: 8, 2017:8, 2024: 8, 2025: 8
}],
CAR.PACIFICA_2018_HYBRID: [
{68: 8, 168: 8, 257: 5, 258: 8, 264: 8, 268: 8, 270: 8, 274: 2, 280: 8, 284: 8, 288: 7, 290: 6, 291: 8, 292: 8, 294: 8, 300: 8, 308: 8, 320: 8, 324: 8, 331: 8, 332: 8, 344: 8, 368: 8, 376: 3, 384: 8, 388: 4, 448: 6, 456: 4, 464: 8, 469: 8, 480: 8, 500: 8, 501: 8, 512: 8, 514: 8, 520: 8, 528: 8, 532: 8, 544: 8, 557: 8, 559: 8, 560: 4, 564: 8, 571: 3, 579: 8, 584: 8, 608: 8, 624: 8, 625: 8, 632: 8, 639: 8, 653: 8, 654: 8, 655: 8, 658: 6, 660: 8, 669: 3, 671: 8, 672: 8, 680: 8, 701: 8, 704: 8, 705: 8, 706: 8, 709: 8, 710: 8, 719: 8, 720: 6, 736: 8, 737: 8, 746: 5, 760: 8, 764: 8, 766: 8, 770: 8, 773: 8, 779: 8, 782: 8, 784: 8, 792: 8, 799: 8, 800: 8, 804: 8, 808: 8, 816: 8, 817: 8, 820: 8, 825: 2, 826: 8, 832: 8, 838: 2, 848: 8, 853: 8, 856: 4, 860: 6, 863: 8, 878: 8, 882: 8, 897: 8, 908: 8, 924: 8, 926: 3, 929: 8, 937: 8, 938: 8, 939: 8, 940: 8, 941: 8, 942: 8, 943: 8, 947: 8, 948: 8, 958: 8, 959: 8, 969: 4, 974: 5, 979: 8, 980: 8, 981: 8, 982: 8, 983: 8, 984: 8, 992: 8, 993: 7, 995: 8, 996: 8, 1000: 8, 1001: 8, 1002: 8, 1003: 8, 1008: 8, 1009: 8, 1010: 8, 1011: 8, 1012: 8, 1013: 8, 1014: 8, 1015: 8, 1024: 8, 1025: 8, 1026: 8, 1031: 8, 1033: 8, 1050: 8, 1059: 8, 1082: 8, 1083: 8, 1098: 8, 1100: 8},
# based on 9ae7821dc4e92455|2019-07-01--16-42-55
@@ -88,7 +86,3 @@ DBC = {
}
STEER_THRESHOLD = 120
ECU_FINGERPRINT = {
Ecu.fwdCamera: [0x292], # lkas cmd
}

View File

@@ -36,7 +36,6 @@ def get_attr_from_cars(attr, result=dict, combine_brands=True):
FW_VERSIONS = get_attr_from_cars('FW_VERSIONS')
_FINGERPRINTS = get_attr_from_cars('FINGERPRINTS')
IGNORED_FINGERPRINTS = get_attr_from_cars('IGNORED_FINGERPRINTS', list)
_DEBUG_ADDRESS = {1880: 8} # reserved for debug purposes
@@ -59,9 +58,6 @@ def eliminate_incompatible_cars(msg, candidate_cars):
compatible_cars = []
for car_name in candidate_cars:
if car_name in IGNORED_FINGERPRINTS:
continue
car_fingerprints = _FINGERPRINTS[car_name]
for fingerprint in car_fingerprints:
@@ -76,4 +72,9 @@ def eliminate_incompatible_cars(msg, candidate_cars):
def all_known_cars():
"""Returns a list of all known car strings."""
return list({*FW_VERSIONS.keys(), *_FINGERPRINTS.keys()})
def all_legacy_fingerprint_cars():
"""Returns a list of all known car strings, FPv1 only."""
return list(_FINGERPRINTS.keys())

View File

@@ -13,26 +13,25 @@ class CarState(CarStateBase):
def update(self, cp):
ret = car.CarState.new_message()
ret.wheelSpeeds.rr = cp.vl["WheelSpeed_CG1"]['WhlRr_W_Meas'] * WHEEL_RADIUS
ret.wheelSpeeds.rl = cp.vl["WheelSpeed_CG1"]['WhlRl_W_Meas'] * WHEEL_RADIUS
ret.wheelSpeeds.fr = cp.vl["WheelSpeed_CG1"]['WhlFr_W_Meas'] * WHEEL_RADIUS
ret.wheelSpeeds.fl = cp.vl["WheelSpeed_CG1"]['WhlFl_W_Meas'] * WHEEL_RADIUS
ret.wheelSpeeds.rr = cp.vl["WheelSpeed_CG1"]["WhlRr_W_Meas"] * WHEEL_RADIUS
ret.wheelSpeeds.rl = cp.vl["WheelSpeed_CG1"]["WhlRl_W_Meas"] * WHEEL_RADIUS
ret.wheelSpeeds.fr = cp.vl["WheelSpeed_CG1"]["WhlFr_W_Meas"] * WHEEL_RADIUS
ret.wheelSpeeds.fl = cp.vl["WheelSpeed_CG1"]["WhlFl_W_Meas"] * WHEEL_RADIUS
ret.vEgoRaw = mean([ret.wheelSpeeds.rr, ret.wheelSpeeds.rl, ret.wheelSpeeds.fr, ret.wheelSpeeds.fl])
ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw)
ret.standstill = not ret.vEgoRaw > 0.001
ret.steeringAngleDeg = cp.vl["Steering_Wheel_Data_CG1"]['SteWhlRelInit_An_Sns']
ret.steeringPressed = not cp.vl["Lane_Keep_Assist_Status"]['LaHandsOff_B_Actl']
ret.steerError = cp.vl["Lane_Keep_Assist_Status"]['LaActDeny_B_Actl'] == 1
ret.cruiseState.speed = cp.vl["Cruise_Status"]['Set_Speed'] * CV.MPH_TO_MS
ret.cruiseState.enabled = not (cp.vl["Cruise_Status"]['Cruise_State'] in [0, 3])
ret.cruiseState.available = cp.vl["Cruise_Status"]['Cruise_State'] != 0
ret.gas = cp.vl["EngineData_14"]['ApedPosScal_Pc_Actl'] / 100.
ret.steeringAngleDeg = cp.vl["Steering_Wheel_Data_CG1"]["SteWhlRelInit_An_Sns"]
ret.steeringPressed = not cp.vl["Lane_Keep_Assist_Status"]["LaHandsOff_B_Actl"]
ret.steerError = cp.vl["Lane_Keep_Assist_Status"]["LaActDeny_B_Actl"] == 1
ret.cruiseState.speed = cp.vl["Cruise_Status"]["Set_Speed"] * CV.MPH_TO_MS
ret.cruiseState.enabled = not (cp.vl["Cruise_Status"]["Cruise_State"] in [0, 3])
ret.cruiseState.available = cp.vl["Cruise_Status"]["Cruise_State"] != 0
ret.gas = cp.vl["EngineData_14"]["ApedPosScal_Pc_Actl"] / 100.
ret.gasPressed = ret.gas > 1e-6
ret.brakePressed = bool(cp.vl["Cruise_Status"]["Brake_Drv_Appl"])
ret.brakeLights = bool(cp.vl["BCM_to_HS_Body"]["Brake_Lights"])
ret.genericToggle = bool(cp.vl["Steering_Buttons"]["Dist_Incr"])
# TODO: we also need raw driver torque, needed for Assisted Lane Change
self.lkas_state = cp.vl["Lane_Keep_Assist_Status"]['LaActAvail_D_Actl']
self.lkas_state = cp.vl["Lane_Keep_Assist_Status"]["LaActAvail_D_Actl"]
return ret
@@ -53,7 +52,6 @@ class CarState(CarStateBase):
("ApedPosScal_Pc_Actl", "EngineData_14", 0.),
("Dist_Incr", "Steering_Buttons", 0.),
("Brake_Drv_Appl", "Cruise_Status", 0.),
("Brake_Lights", "BCM_to_HS_Body", 0.),
]
checks = []
return CANParser(DBC[CP.carFingerprint]['pt'], signals, checks, 0, enforce_checks=False)
return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 0, enforce_checks=False)

View File

@@ -2,8 +2,8 @@
from cereal import car
from selfdrive.swaglog import cloudlog
from selfdrive.config import Conversions as CV
from selfdrive.car.ford.values import MAX_ANGLE, Ecu, ECU_FINGERPRINT, FINGERPRINTS
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, is_ecu_disconnected
from selfdrive.car.ford.values import MAX_ANGLE
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint
from selfdrive.car.interfaces import CarInterfaceBase
from common.dp_common import common_interface_atl, common_interface_get_params_lqr
@@ -15,8 +15,8 @@ class CarInterface(CarInterfaceBase):
return float(accel) / 3.0
@staticmethod
def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None, has_relay=False):
ret = CarInterfaceBase.get_std_params(candidate, fingerprint, has_relay)
def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None):
ret = CarInterfaceBase.get_std_params(candidate, fingerprint)
ret.carName = "ford"
ret.lateralTuning.init('pid')
ret.safetyModel = car.CarParams.SafetyModel.ford
@@ -45,7 +45,7 @@ class CarInterface(CarInterfaceBase):
ret.steerControlType = car.CarParams.SteerControlType.angle
ret.enableCamera = is_ecu_disconnected(fingerprint[0], FINGERPRINTS, ECU_FINGERPRINT, candidate, Ecu.fwdCamera) or has_relay
ret.enableCamera = True
cloudlog.warning("ECU Camera Simulated: %r", ret.enableCamera)
# dp

View File

@@ -18,7 +18,3 @@ FINGERPRINTS = {
DBC = {
CAR.FUSION: dbc_dict('ford_fusion_2018_pt', 'ford_fusion_2018_adas'),
}
ECU_FINGERPRINT = {
Ecu.fwdCamera: [970, 973, 984]
}

View File

@@ -69,6 +69,11 @@ OBD_VERSION_RESPONSE = b'\x49\x04'
DEFAULT_RX_OFFSET = 0x8
VOLKSWAGEN_RX_OFFSET = 0x6a
MAZDA_VERSION_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \
p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_ECU_SOFTWARE_NUMBER)
MAZDA_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + \
p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_ECU_SOFTWARE_NUMBER)
# brand, request, response, response offset
REQUESTS = [
# Hyundai
@@ -129,6 +134,13 @@ REQUESTS = [
[VOLKSWAGEN_VERSION_RESPONSE],
DEFAULT_RX_OFFSET,
),
# Mazda
(
"mazda",
[MAZDA_VERSION_REQUEST],
[MAZDA_VERSION_RESPONSE],
DEFAULT_RX_OFFSET,
)
]
@@ -209,7 +221,7 @@ def match_fw_to_car_exact(fw_versions_dict):
continue
# On some Toyota models, the engine can show on two different addresses
if ecu_type == Ecu.engine and candidate in [TOYOTA.COROLLA_TSS2, TOYOTA.CHR, TOYOTA.LEXUS_IS, TOYOTA.AVALON] and found_version is None:
if ecu_type == Ecu.engine and candidate in [TOYOTA.CAMRY, TOYOTA.COROLLA_TSS2, TOYOTA.CHR, TOYOTA.LEXUS_IS] and found_version is None:
continue
# Ignore non essential ecus

View File

@@ -11,62 +11,62 @@ from selfdrive.car.gm.values import DBC, CAR, AccState, CanBus, \
class CarState(CarStateBase):
def __init__(self, CP):
super().__init__(CP)
can_define = CANDefine(DBC[CP.carFingerprint]['pt'])
can_define = CANDefine(DBC[CP.carFingerprint]["pt"])
self.shifter_values = can_define.dv["ECMPRDNL"]["PRNDL"]
def update(self, pt_cp):
ret = car.CarState.new_message()
self.prev_cruise_buttons = self.cruise_buttons
self.cruise_buttons = pt_cp.vl["ASCMSteeringButton"]['ACCButtons']
self.cruise_buttons = pt_cp.vl["ASCMSteeringButton"]["ACCButtons"]
ret.wheelSpeeds.fl = pt_cp.vl["EBCMWheelSpdFront"]['FLWheelSpd'] * CV.KPH_TO_MS
ret.wheelSpeeds.fr = pt_cp.vl["EBCMWheelSpdFront"]['FRWheelSpd'] * CV.KPH_TO_MS
ret.wheelSpeeds.rl = pt_cp.vl["EBCMWheelSpdRear"]['RLWheelSpd'] * CV.KPH_TO_MS
ret.wheelSpeeds.rr = pt_cp.vl["EBCMWheelSpdRear"]['RRWheelSpd'] * CV.KPH_TO_MS
ret.wheelSpeeds.fl = pt_cp.vl["EBCMWheelSpdFront"]["FLWheelSpd"] * CV.KPH_TO_MS
ret.wheelSpeeds.fr = pt_cp.vl["EBCMWheelSpdFront"]["FRWheelSpd"] * CV.KPH_TO_MS
ret.wheelSpeeds.rl = pt_cp.vl["EBCMWheelSpdRear"]["RLWheelSpd"] * CV.KPH_TO_MS
ret.wheelSpeeds.rr = pt_cp.vl["EBCMWheelSpdRear"]["RRWheelSpd"] * CV.KPH_TO_MS
ret.vEgoRaw = mean([ret.wheelSpeeds.fl, ret.wheelSpeeds.fr, ret.wheelSpeeds.rl, ret.wheelSpeeds.rr])
ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw)
ret.standstill = ret.vEgoRaw < 0.01
ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(pt_cp.vl["ECMPRDNL"]['PRNDL'], None))
ret.brake = pt_cp.vl["EBCMBrakePedalPosition"]['BrakePedalPosition'] / 0xd0
ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(pt_cp.vl["ECMPRDNL"]["PRNDL"], None))
ret.brake = pt_cp.vl["EBCMBrakePedalPosition"]["BrakePedalPosition"] / 0xd0
# Brake pedal's potentiometer returns near-zero reading even when pedal is not pressed.
if ret.brake < 10/0xd0:
ret.brake = 0.
ret.gas = pt_cp.vl["AcceleratorPedal"]['AcceleratorPedal'] / 254.
ret.gas = pt_cp.vl["AcceleratorPedal"]["AcceleratorPedal"] / 254.
ret.gasPressed = ret.gas > 1e-5
ret.steeringAngleDeg = pt_cp.vl["PSCMSteeringAngle"]['SteeringWheelAngle']
ret.steeringRateDeg = pt_cp.vl["PSCMSteeringAngle"]['SteeringWheelRate']
ret.steeringTorque = pt_cp.vl["PSCMStatus"]['LKADriverAppldTrq']
ret.steeringTorqueEps = pt_cp.vl["PSCMStatus"]['LKATorqueDelivered']
ret.steeringAngleDeg = pt_cp.vl["PSCMSteeringAngle"]["SteeringWheelAngle"]
ret.steeringRateDeg = pt_cp.vl["PSCMSteeringAngle"]["SteeringWheelRate"]
ret.steeringTorque = pt_cp.vl["PSCMStatus"]["LKADriverAppldTrq"]
ret.steeringTorqueEps = pt_cp.vl["PSCMStatus"]["LKATorqueDelivered"]
ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD
# 0 inactive, 1 active, 2 temporarily limited, 3 failed
self.lkas_status = pt_cp.vl["PSCMStatus"]['LKATorqueDeliveredStatus']
self.lkas_status = pt_cp.vl["PSCMStatus"]["LKATorqueDeliveredStatus"]
ret.steerWarning = self.lkas_status not in [0, 1]
# 1 - open, 0 - closed
ret.doorOpen = (pt_cp.vl["BCMDoorBeltStatus"]['FrontLeftDoor'] == 1 or
pt_cp.vl["BCMDoorBeltStatus"]['FrontRightDoor'] == 1 or
pt_cp.vl["BCMDoorBeltStatus"]['RearLeftDoor'] == 1 or
pt_cp.vl["BCMDoorBeltStatus"]['RearRightDoor'] == 1)
ret.doorOpen = (pt_cp.vl["BCMDoorBeltStatus"]["FrontLeftDoor"] == 1 or
pt_cp.vl["BCMDoorBeltStatus"]["FrontRightDoor"] == 1 or
pt_cp.vl["BCMDoorBeltStatus"]["RearLeftDoor"] == 1 or
pt_cp.vl["BCMDoorBeltStatus"]["RearRightDoor"] == 1)
# 1 - latched
ret.seatbeltUnlatched = pt_cp.vl["BCMDoorBeltStatus"]['LeftSeatBelt'] == 0
ret.leftBlinker = pt_cp.vl["BCMTurnSignals"]['TurnSignals'] == 1
ret.rightBlinker = pt_cp.vl["BCMTurnSignals"]['TurnSignals'] == 2
ret.seatbeltUnlatched = pt_cp.vl["BCMDoorBeltStatus"]["LeftSeatBelt"] == 0
ret.leftBlinker = pt_cp.vl["BCMTurnSignals"]["TurnSignals"] == 1
ret.rightBlinker = pt_cp.vl["BCMTurnSignals"]["TurnSignals"] == 2
self.park_brake = pt_cp.vl["EPBStatus"]['EPBClosed']
ret.cruiseState.available = bool(pt_cp.vl["ECMEngineStatus"]['CruiseMainOn'])
ret.espDisabled = pt_cp.vl["ESPStatus"]['TractionControlOn'] != 1
self.pcm_acc_status = pt_cp.vl["AcceleratorPedal2"]['CruiseState']
self.park_brake = pt_cp.vl["EPBStatus"]["EPBClosed"]
ret.cruiseState.available = bool(pt_cp.vl["ECMEngineStatus"]["CruiseMainOn"])
ret.espDisabled = pt_cp.vl["ESPStatus"]["TractionControlOn"] != 1
self.pcm_acc_status = pt_cp.vl["AcceleratorPedal2"]["CruiseState"]
ret.brakePressed = ret.brake > 1e-5
# Regen braking is braking
if self.car_fingerprint == CAR.VOLT:
ret.brakePressed = ret.brakePressed or bool(pt_cp.vl["EBCMRegenPaddle"]['RegenPaddle'])
ret.brakePressed = ret.brakePressed or bool(pt_cp.vl["EBCMRegenPaddle"]["RegenPaddle"])
ret.cruiseState.enabled = self.pcm_acc_status != AccState.OFF
ret.cruiseState.standstill = self.pcm_acc_status == AccState.STANDSTILL
@@ -129,4 +129,4 @@ class CarState(CarStateBase):
("EBCMRegenPaddle", 50),
]
return CANParser(DBC[CP.carFingerprint]['pt'], signals, checks, CanBus.POWERTRAIN)
return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, CanBus.POWERTRAIN)

View File

@@ -2,8 +2,8 @@
from cereal import car
from selfdrive.config import Conversions as CV
from selfdrive.car.gm.values import CAR, CruiseButtons, \
AccState, Ecu, ECU_FINGERPRINT, FINGERPRINTS
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, is_ecu_disconnected
AccState
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint
from selfdrive.car.interfaces import CarInterfaceBase
from common.dp_common import common_interface_atl, common_interface_get_params_lqr
@@ -17,8 +17,8 @@ class CarInterface(CarInterfaceBase):
return float(accel) / 4.0
@staticmethod
def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None, has_relay=False):
ret = CarInterfaceBase.get_std_params(candidate, fingerprint, has_relay)
def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None):
ret = CarInterfaceBase.get_std_params(candidate, fingerprint)
ret.carName = "gm"
# dp
ret.lateralTuning.init('pid')
@@ -32,7 +32,7 @@ class CarInterface(CarInterfaceBase):
# Presence of a camera on the object bus is ok.
# Have to go to read_only if ASCM is online (ACC-enabled cars),
# or camera is on powertrain bus (LKA cars without ACC).
ret.enableCamera = is_ecu_disconnected(fingerprint[0], FINGERPRINTS, ECU_FINGERPRINT, candidate, Ecu.fwdCamera) or has_relay
ret.enableCamera = True
ret.openpilotLongitudinalControl = ret.enableCamera
tire_stiffness_factor = 0.444 # not optimized yet

View File

@@ -97,10 +97,6 @@ FINGERPRINTS = {
STEER_THRESHOLD = 1.0
ECU_FINGERPRINT = {
Ecu.fwdCamera: [384, 715] # 384 = "ASCMLKASteeringCmd", 715 = "ASCMGasRegenCmd"
}
DBC = {
CAR.HOLDEN_ASTRA: dbc_dict('gm_global_a_powertrain', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis'),
CAR.VOLT: dbc_dict('gm_global_a_powertrain', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis'),

View File

@@ -124,6 +124,10 @@ class CarController():
# send pcm acc cancel cmd if drive is disabled but pcm is still on, or if the system can't be activated
pcm_cancel_cmd = True
# Never send cancel command if we never enter cruise state (no cruise if pedal)
# Cancel cmd causes brakes to release at a standstill causing grinding
pcm_cancel_cmd = pcm_cancel_cmd and CS.CP.enableCruise
# *** rate limit after the enable check ***
self.brake_last = rate_limit(brake, self.brake_last, -2., DT_CTRL)
@@ -171,35 +175,34 @@ class CarController():
# Send steering command.
idx = frame % 4
can_sends.append(hondacan.create_steering_control(self.packer, apply_steer,
lkas_active, CS.CP.carFingerprint, idx, CS.CP.openpilotLongitudinalControl, CS.CP.isPandaBlack))
lkas_active, CS.CP.carFingerprint, idx, CS.CP.openpilotLongitudinalControl))
# Send dashboard UI commands.
if not dragonconf.dpAtl and (frame % 10) == 0:
idx = (frame//10) % 4
can_sends.extend(hondacan.create_ui_commands(self.packer, pcm_speed, hud, CS.CP.carFingerprint, CS.is_metric, idx, CS.CP.openpilotLongitudinalControl, CS.stock_hud, CS.CP.isPandaBlack))
can_sends.extend(hondacan.create_ui_commands(self.packer, pcm_speed, hud, CS.CP.carFingerprint, CS.is_metric, idx, CS.CP.openpilotLongitudinalControl, CS.stock_hud))
if not CS.CP.openpilotLongitudinalControl:
if (frame % 2) == 0:
idx = frame // 2
can_sends.append(hondacan.create_bosch_supplemental_1(self.packer, CS.CP.carFingerprint, idx, CS.CP.isPandaBlack))
can_sends.append(hondacan.create_bosch_supplemental_1(self.packer, CS.CP.carFingerprint, idx))
if dragonconf.dpAtl:
pass
# If using stock ACC, spam cancel command to kill gas when OP disengages.
elif not dragonconf.dpAllowGas and pcm_cancel_cmd:
can_sends.append(hondacan.spam_buttons_command(self.packer, CruiseButtons.CANCEL, idx, CS.CP.carFingerprint, CS.CP.isPandaBlack))
can_sends.append(hondacan.spam_buttons_command(self.packer, CruiseButtons.CANCEL, idx, CS.CP.carFingerprint))
elif CS.out.cruiseState.standstill:
if CS.CP.carFingerprint in (CAR.ACCORD, CAR.ACCORD_15, CAR.ACCORDH, CAR.INSIGHT):
if CS.CP.carFingerprint in (CAR.ACCORD, CAR.ACCORDH, CAR.INSIGHT):
rough_lead_speed = self.rough_speed(CS.lead_distance)
if CS.lead_distance > (self.stopped_lead_distance + 15.0) or rough_lead_speed > 0.1:
self.stopped_lead_distance = 0.0
can_sends.append(
hondacan.spam_buttons_command(self.packer, CruiseButtons.RES_ACCEL, idx, CS.CP.carFingerprint, CS.CP.isPandaBlack))
hondacan.spam_buttons_command(self.packer, CruiseButtons.RES_ACCEL, idx, CS.CP.carFingerprint))
elif CS.CP.carFingerprint in (CAR.CIVIC_BOSCH, CAR.CRV_HYBRID):
if CS.hud_lead == 1:
can_sends.append(
hondacan.spam_buttons_command(self.packer, CruiseButtons.RES_ACCEL, idx, CS.CP.carFingerprint, CS.CP.isPandaBlack))
can_sends.append(hondacan.spam_buttons_command(self.packer, CruiseButtons.RES_ACCEL, idx, CS.CP.carFingerprint))
else:
can_sends.append(hondacan.spam_buttons_command(self.packer, CruiseButtons.RES_ACCEL, idx, CS.CP.carFingerprint, CS.CP.isPandaBlack))
can_sends.append(hondacan.spam_buttons_command(self.packer, CruiseButtons.RES_ACCEL, idx, CS.CP.carFingerprint))
else:
self.stopped_lead_distance = CS.lead_distance
self.prev_lead_distance = CS.lead_distance
@@ -209,20 +212,21 @@ class CarController():
if (frame % 2) == 0:
idx = frame // 2
ts = frame * DT_CTRL
if CS.CP.carFingerprint in HONDA_BOSCH:
if dragonconf.dpAtl:
pass
elif CS.CP.carFingerprint in HONDA_BOSCH:
pass # TODO: implement
else:
if not dragonconf.dpAtl:
apply_gas = clip(actuators.gas, 0., 1.)
apply_brake = int(clip(self.brake_last * P.BRAKE_MAX, 0, P.BRAKE_MAX - 1))
pump_on, self.last_pump_ts = brake_pump_hysteresis(apply_brake, self.apply_brake_last, self.last_pump_ts, ts)
can_sends.append(hondacan.create_brake_command(self.packer, apply_brake, pump_on,
pcm_override, pcm_cancel_cmd, hud.fcw, idx, CS.CP.carFingerprint, CS.stock_brake, CS.CP.isPandaBlack))
self.apply_brake_last = apply_brake
apply_gas = clip(actuators.gas, 0., 1.)
apply_brake = int(clip(self.brake_last * P.BRAKE_MAX, 0, P.BRAKE_MAX - 1))
pump_on, self.last_pump_ts = brake_pump_hysteresis(apply_brake, self.apply_brake_last, self.last_pump_ts, ts)
can_sends.append(hondacan.create_brake_command(self.packer, apply_brake, pump_on,
pcm_override, pcm_cancel_cmd, hud.fcw, idx, CS.CP.carFingerprint, CS.stock_brake))
self.apply_brake_last = apply_brake
if CS.CP.enableGasInterceptor:
# send exactly zero if apply_gas is zero. Interceptor will send the max between read value and apply_gas.
# This prevents unexpected pedal range rescaling
can_sends.append(create_gas_command(self.packer, apply_gas, idx))
if CS.CP.enableGasInterceptor:
# send exactly zero if apply_gas is zero. Interceptor will send the max between read value and apply_gas.
# This prevents unexpected pedal range rescaling
can_sends.append(create_gas_command(self.packer, apply_gas, idx))
return can_sends

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