diff --git a/Jenkinsfile b/Jenkinsfile
index df52f59e1..6bd42d13c 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -34,6 +34,9 @@ pipeline {
COMMA_JWT = credentials('athena-test-jwt')
TEST_DIR = "/data/openpilot"
}
+ options {
+ timeout(time: 1, unit: 'HOURS')
+ }
stages {
@@ -58,7 +61,7 @@ pipeline {
when {
not {
anyOf {
- branch 'master-ci'; branch 'devel'; branch 'devel-staging'; branch 'release2'; branch 'release2-staging'; branch 'dashcam'; branch 'dashcam-staging'
+ branch 'master-ci'; branch 'devel'; branch 'devel-staging'; branch 'release2'; branch 'release2-staging'; branch 'dashcam'; branch 'dashcam-staging'; branch 'testing-closet*'
}
}
}
@@ -133,6 +136,7 @@ pipeline {
["test sounds", "nosetests -s selfdrive/test/test_sounds.py"],
["test boardd loopback", "nosetests -s selfdrive/boardd/tests/test_boardd_loopback.py"],
["test loggerd", "CI=1 python selfdrive/loggerd/tests/test_loggerd.py"],
+ //["test camerad", "CI=1 python selfdrive/camerad/test/test_camerad.py"], // wait for shelf refactor
//["test updater", "python installer/updater/test_updater.py"],
])
}
diff --git a/README.md b/README.md
index 17a095252..772272183 100644
--- a/README.md
+++ b/README.md
@@ -66,6 +66,7 @@ Supported Cars
| ----------| ------------------------------| ------------------| -----------------| -------------------| ------------------|
| Acura | ILX 2016-18 | AcuraWatch Plus | openpilot | 25mph1 | 25mph |
| Acura | RDX 2016-18 | AcuraWatch Plus | openpilot | 25mph1 | 12mph |
+| Acura | RDX 2020 | AcuraWatch | Stock | 0mph | 3mph |
| Honda | Accord 2018-20 | All | Stock | 0mph | 3mph |
| Honda | Accord Hybrid 2018-20 | All | Stock | 0mph | 3mph |
| Honda | Civic Hatchback 2017-19 | Honda Sensing | Stock | 0mph | 12mph |
@@ -109,7 +110,7 @@ Supported Cars
| Toyota | Prius 2016-20 | TSS-P | Stock3| 0mph | 0mph |
| Toyota | Prius Prime 2017-20 | All | Stock3| 0mph | 0mph |
| Toyota | Rav4 2016-18 | TSS-P | Stock3| 20mph1 | 0mph |
-| Toyota | Rav4 2019-20 | All | openpilot | 0mph | 0mph |
+| Toyota | Rav4 2019-21 | All | openpilot | 0mph | 0mph |
| Toyota | Rav4 Hybrid 2016-18 | TSS-P | Stock3| 0mph | 0mph |
| Toyota | Rav4 Hybrid 2019-20 | All | openpilot | 0mph | 0mph |
| Toyota | Sienna 2018-20 | All | Stock3| 0mph | 0mph |
@@ -143,7 +144,7 @@ Community Maintained Cars and Features
| Hyundai | Kona 2020 | SCC + LKAS | Stock | 0mph | 0mph |
| Hyundai | Kona EV 2019 | SCC + LKAS | Stock | 0mph | 0mph |
| Hyundai | Santa Fe 2019 | All | Stock | 0mph | 0mph |
-| Hyundai | Sonata 2019 | All | Stock | 0mph | 0mph |
+| Hyundai | Sonata 2019 | SCC + LKAS | Stock | 0mph | 0mph |
| Hyundai | Veloster 2019 | SCC + LKAS | Stock | 5mph | 0mph |
| Jeep | Grand Cherokee 2016-18 | Adaptive Cruise | Stock | 0mph | 9mph |
| Jeep | Grand Cherokee 2019-20 | Adaptive Cruise | Stock | 0mph | 39mph |
@@ -152,8 +153,8 @@ Community Maintained Cars and Features
| Kia | Optima 2019 | SCC + LKAS | Stock | 0mph | 0mph |
| Kia | Sorento 2018 | SCC + LKAS | Stock | 0mph | 0mph |
| Kia | Stinger 2018 | SCC + LKAS | Stock | 0mph | 0mph |
-| Nissan | Leaf 2018-19 | ProPILOT | Stock | 0mph | 0mph |
-| Nissan | Rogue 2019 | ProPILOT | Stock | 0mph | 0mph |
+| Nissan | Leaf 2018-20 | ProPILOT | Stock | 0mph | 0mph |
+| Nissan | Rogue 2018-19 | ProPILOT | Stock | 0mph | 0mph |
| Nissan | X-Trail 2017 | ProPILOT | Stock | 0mph | 0mph |
| Subaru | Ascent 2019 | EyeSight | Stock | 0mph | 0mph |
| Subaru | Crosstrek 2018-19 | EyeSight | Stock | 0mph | 0mph |
@@ -268,7 +269,7 @@ Safety and Testing
Testing on PC
------
-For simplified development and experimentation, openpilot runs in the CARLA driving simulator, which allows you to develop openpilot without a car.
+For simplified development and experimentation, openpilot can be run in the CARLA driving simulator, which allows you to develop openpilot without a car. The whole setup should only take a few minutes.
Steps:
1) Start the CARLA server on first terminal
@@ -309,7 +310,7 @@ Directory Structure
├── phonelibs # Libraries used on NEOS devices
├── pyextra # Libraries used on NEOS devices
└── selfdrive # Code needed to drive the car
- ├── assets # Fonts, images, and sounds for UI
+ ├── assets # Fonts, images and sounds for UI
├── athena # Allows communication with the app
├── boardd # Daemon to talk to the board
├── camerad # Driver to capture images from the camera sensors
diff --git a/RELEASES.md b/RELEASES.md
index e8a157567..8149ce4da 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -1,3 +1,12 @@
+Version 0.7.10 (2020-10-26)
+========================
+ * NEOS update: update to Python 3.8.2 and lower CPU frequency
+ * Improved thermals due to reduced CPU frequency
+ * Update SNPE to 1.41.0
+ * Reduced offroad power consumption
+ * Various system stability improvements
+ * Acura RDX 2020 support thanks to csouers!
+
Version 0.7.9 (2020-10-09)
========================
* Improved car battery power management
@@ -29,24 +38,24 @@ Version 0.7.7 (2020-07-20)
Version 0.7.6.1 (2020-06-16)
========================
-* Hotfix: update kernel on some comma twos (orders #8570-#8680)
+ * Hotfix: update kernel on some comma twos (orders #8570-#8680)
Version 0.7.6 (2020-06-05)
========================
-* White panda is deprecated, upgrade to comma two or black panda
-* 2017 Nissan X-Trail, 2018-19 Leaf and 2019 Rogue support thanks to avolmensky!
-* 2017 Mazda CX-5 support in dashcam mode thanks to Jafaral!
-* Huge CPU savings in modeld by using thneed!
-* Lots of code cleanup and refactors
+ * White panda is deprecated, upgrade to comma two or black panda
+ * 2017 Nissan X-Trail, 2018-19 Leaf and 2019 Rogue support thanks to avolmensky!
+ * 2017 Mazda CX-5 support in dashcam mode thanks to Jafaral!
+ * Huge CPU savings in modeld by using thneed!
+ * Lots of code cleanup and refactors
Version 0.7.5 (2020-05-13)
========================
-* Right-Hand Drive support for both driving and driver monitoring!
-* New driving model: improved at sharp turns and lead speed estimation
-* New driver monitoring model: overall improvement on comma two
-* Driver camera preview in settings to improve mounting position
-* Added support for many Hyundai, Kia, Genesis models thanks to xx979xx!
-* Improved lateral tuning for 2020 Toyota Rav 4 (hybrid)
+ * Right-Hand Drive support for both driving and driver monitoring!
+ * New driving model: improved at sharp turns and lead speed estimation
+ * New driver monitoring model: overall improvement on comma two
+ * Driver camera preview in settings to improve mounting position
+ * Added support for many Hyundai, Kia, Genesis models thanks to xx979xx!
+ * Improved lateral tuning for 2020 Toyota Rav 4 (hybrid)
Version 0.7.4 (2020-03-20)
========================
@@ -482,96 +491,96 @@ Version 0.3.4 (2017-07-28)
Version 0.3.3 (2017-06-28)
===========================
- * Improved model trained on more data
- * Alpha CR-V support thanks to energee and johnnwvs!
- * Using the opendbc project for DBC files
- * Minor performance improvements
- * UI update thanks to pjlao307
- * Power off button
- * 6% more torque on the Civic
+ * Improved model trained on more data
+ * Alpha CR-V support thanks to energee and johnnwvs!
+ * Using the opendbc project for DBC files
+ * Minor performance improvements
+ * UI update thanks to pjlao307
+ * Power off button
+ * 6% more torque on the Civic
Version 0.3.2 (2017-05-22)
===========================
- * Minor stability bugfixes
- * Added metrics and rear view mirror disable to settings
- * Update model with more crowdsourced data
+ * Minor stability bugfixes
+ * Added metrics and rear view mirror disable to settings
+ * Update model with more crowdsourced data
Version 0.3.1 (2017-05-17)
===========================
- * visiond stability bugfix
- * Add logging for angle and flashing
+ * visiond stability bugfix
+ * Add logging for angle and flashing
Version 0.3.0 (2017-05-12)
===========================
- * Add CarParams struct to improve the abstraction layer
- * Refactor visiond IPC to support multiple clients
- * Add raw GPS and beginning support for navigation
- * Improve model in visiond using crowdsourced data
- * Add improved system logging to diagnose instability
- * Rewrite baseui in React Native
- * Moved calibration to the cloud
+ * Add CarParams struct to improve the abstraction layer
+ * Refactor visiond IPC to support multiple clients
+ * Add raw GPS and beginning support for navigation
+ * Improve model in visiond using crowdsourced data
+ * Add improved system logging to diagnose instability
+ * Rewrite baseui in React Native
+ * Moved calibration to the cloud
Version 0.2.9 (2017-03-01)
===========================
- * Retain compatibility with NEOS v1
+ * Retain compatibility with NEOS v1
Version 0.2.8 (2017-02-27)
===========================
- * Fix bug where frames were being dropped in minute 71
+ * Fix bug where frames were being dropped in minute 71
Version 0.2.7 (2017-02-08)
===========================
- * Better performance and pictures at night
- * Fix ptr alignment issue in boardd
- * Fix brake error light, fix crash if too cold
+ * Better performance and pictures at night
+ * Fix ptr alignment issue in boardd
+ * Fix brake error light, fix crash if too cold
Version 0.2.6 (2017-01-31)
===========================
- * Fix bug in visiond model execution
+ * Fix bug in visiond model execution
Version 0.2.5 (2017-01-30)
===========================
- * Fix race condition in manager
+ * Fix race condition in manager
Version 0.2.4 (2017-01-27)
===========================
- * OnePlus 3T support
- * Enable installation as NEOS app
- * Various minor bugfixes
+ * OnePlus 3T support
+ * Enable installation as NEOS app
+ * Various minor bugfixes
Version 0.2.3 (2017-01-11)
===========================
- * Reduce space usage by 80%
- * Add better logging
- * Add Travis CI
+ * Reduce space usage by 80%
+ * Add better logging
+ * Add Travis CI
Version 0.2.2 (2017-01-10)
===========================
- * Board triggers started signal on CAN messages
- * Improved autoexposure
- * Handle out of space, improve upload status
+ * Board triggers started signal on CAN messages
+ * Improved autoexposure
+ * Handle out of space, improve upload status
Version 0.2.1 (2016-12-14)
===========================
- * Performance improvements, removal of more numpy
- * Fix boardd process priority
- * Make counter timer reset on use of steering wheel
+ * Performance improvements, removal of more numpy
+ * Fix boardd process priority
+ * Make counter timer reset on use of steering wheel
Version 0.2 (2016-12-12)
=========================
- * Car/Radar abstraction layers have shipped, see cereal/car.capnp
- * controlsd has been refactored
- * Shipped plant model and testing maneuvers
- * visiond exits more gracefully now
- * Hardware encoder in visiond should always init
- * ui now turns off the screen after 30 seconds
- * Switch to openpilot release branch for future releases
- * Added preliminary Docker container to run tests on PC
+ * Car/Radar abstraction layers have shipped, see cereal/car.capnp
+ * controlsd has been refactored
+ * Shipped plant model and testing maneuvers
+ * visiond exits more gracefully now
+ * Hardware encoder in visiond should always init
+ * ui now turns off the screen after 30 seconds
+ * Switch to openpilot release branch for future releases
+ * Added preliminary Docker container to run tests on PC
Version 0.1 (2016-11-29)
=========================
- * Initial release of openpilot
- * Adaptive cruise control is working
- * Lane keep assist is working
- * Support for Acura ILX 2016 with AcuraWatch Plus
- * Support for Honda Civic 2016 Touring Edition
+ * Initial release of openpilot
+ * Adaptive cruise control is working
+ * Lane keep assist is working
+ * Support for Acura ILX 2016 with AcuraWatch Plus
+ * Support for Honda Civic 2016 Touring Edition
diff --git a/SConstruct b/SConstruct
index fc119262b..1b863beba 100644
--- a/SConstruct
+++ b/SConstruct
@@ -7,6 +7,7 @@ import sys
import platform
TICI = os.path.isfile('/TICI')
+Decider('MD5-timestamp')
AddOption('--test',
action='store_true',
@@ -27,7 +28,7 @@ if platform.system() == "Darwin":
if arch == "aarch64" and TICI:
arch = "larch64"
-webcam = bool(ARGUMENTS.get("use_webcam", 0))
+USE_WEBCAM = os.getenv("USE_WEBCAM") is not None
QCOM_REPLAY = arch == "aarch64" and os.getenv("QCOM_REPLAY") is not None
if arch == "aarch64" or arch == "larch64":
@@ -108,6 +109,7 @@ else:
]
rpath = [
+ "phonelibs/snpe/x86_64-linux-clang",
"external/tensorflow/lib",
"cereal",
"selfdrive/common"
@@ -136,6 +138,7 @@ env = Environment(
"-Werror",
"-Wno-unknown-warning-option",
"-Wno-deprecated-register",
+ "-Wno-register",
"-Wno-inconsistent-missing-override",
"-Wno-c99-designator",
"-Wno-reorder-init-list",
@@ -175,7 +178,7 @@ env = Environment(
RPATH=rpath,
CFLAGS=["-std=gnu11"] + cflags,
- CXXFLAGS=["-std=c++14"] + cxxflags,
+ CXXFLAGS=["-std=c++1z"] + cxxflags,
LIBPATH=libpath + [
"#cereal",
"#selfdrive/common",
@@ -200,6 +203,7 @@ if arch in ["x86_64", "Darwin", "larch64"]:
]
qt_env["LINKFLAGS"] += ["-F" + QT_BASE + "lib"]
else:
+ qt_env['QTDIR'] = "/usr"
qt_dirs = [
f"/usr/include/{real_arch}-linux-gnu/qt5",
f"/usr/include/{real_arch}-linux-gnu/qt5/QtWidgets",
@@ -259,7 +263,7 @@ def abspath(x):
# still needed for apks
zmq = 'zmq'
-Export('env', 'qt_env', 'arch', 'zmq', 'SHARED', 'webcam', 'QCOM_REPLAY')
+Export('env', 'qt_env', 'arch', 'zmq', 'SHARED', 'USE_WEBCAM', 'QCOM_REPLAY')
# cereal and messaging are shared with the system
SConscript(['cereal/SConscript'])
diff --git a/apk/ai.comma.plus.offroad.apk b/apk/ai.comma.plus.offroad.apk
index 237b0b367..f6d37b3e4 100644
Binary files a/apk/ai.comma.plus.offroad.apk and b/apk/ai.comma.plus.offroad.apk differ
diff --git a/cereal/car.capnp b/cereal/car.capnp
index 17bc461b3..558107a44 100644
--- a/cereal/car.capnp
+++ b/cereal/car.capnp
@@ -25,7 +25,6 @@ struct CarEvent @0x9b1657f34caf3ad3 {
canError @0;
steerUnavailable @1;
brakeUnavailable @2;
- gasUnavailable @3;
wrongGear @4;
doorOpen @5;
seatbeltNotLatched @6;
@@ -98,12 +97,12 @@ struct CarEvent @0x9b1657f34caf3ad3 {
whitePandaUnsupported @81;
belowEngageSpeed @84;
noGps @85;
- focusRecoverActive @86;
wrongCruiseMode @87;
- neosUpdateRequired @88;
modeldLagging @89;
deviceFalling @90;
+ fanMalfunction @91;
+ gasUnavailableDEPRECATED @3;
dataNeededDEPRECATED @16;
modelCommIssueDEPRECATED @27;
ipasOverrideDEPRECATED @33;
@@ -114,6 +113,8 @@ struct CarEvent @0x9b1657f34caf3ad3 {
invalidGiraffeHondaDEPRECATED @49;
canErrorPersistentDEPRECATED @83;
startupWhitePandaDEPRECATED @82;
+ focusRecoverActiveDEPRECATED @86;
+ neosUpdateRequiredDEPRECATED @88;
}
}
diff --git a/cereal/log.capnp b/cereal/log.capnp
index c8419500a..ac86bb025 100644
--- a/cereal/log.capnp
+++ b/cereal/log.capnp
@@ -571,7 +571,7 @@ struct ControlsState @0x97ff69c53601abf1 {
enum AlertStatus {
normal @0; # low priority alert for user's convenience
- userPrompt @1; # mid piority alert that might require user intervention
+ userPrompt @1; # mid priority alert that might require user intervention
critical @2; # high priority alert that needs immediate user intervention
}
@@ -1983,6 +1983,7 @@ struct Boot {
wallTimeNanos @0 :UInt64;
lastKmsg @1 :Data;
lastPmsg @2 :Data;
+ launchLog @3 :Text;
}
struct LiveParametersData {
diff --git a/cereal/messaging/messaging_pyx.pyx b/cereal/messaging/messaging_pyx.pyx
index 1bb407315..8b3e84743 100644
--- a/cereal/messaging/messaging_pyx.pyx
+++ b/cereal/messaging/messaging_pyx.pyx
@@ -140,9 +140,9 @@ cdef class PubSocket:
else:
raise MessagingError
- def send(self, string data):
+ def send(self, bytes data):
length = len(data)
- r = self.socket.send(data.c_str(), length)
+ r = self.socket.send(data, length)
if r != length:
if errno.errno == errno.EADDRINUSE:
diff --git a/cereal/messaging/messaging_pyx_setup.py b/cereal/messaging/messaging_pyx_setup.py
index 8e67a104c..43dc9c987 100644
--- a/cereal/messaging/messaging_pyx_setup.py
+++ b/cereal/messaging/messaging_pyx_setup.py
@@ -31,7 +31,7 @@ class BuildExtWithoutPlatformSuffix(build_ext):
sourcefiles = ['messaging_pyx.pyx']
-extra_compile_args = ["-std=c++14", "-Wno-nullability-completeness"]
+extra_compile_args = ["-std=c++1z", "-Wno-nullability-completeness"]
libraries = ['zmq']
ARCH = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip() # pylint: disable=unexpected-keyword-arg
diff --git a/cereal/messaging/msgq.cc b/cereal/messaging/msgq.cc
index 53bdb9af0..30b0225cd 100644
--- a/cereal/messaging/msgq.cc
+++ b/cereal/messaging/msgq.cc
@@ -114,6 +114,7 @@ int msgq_new_queue(msgq_queue_t * q, const char * path, size_t size){
int rc = ftruncate(fd, size + sizeof(msgq_header_t));
if (rc < 0){
+ close(fd);
return -1;
}
char * mem = (char*)mmap(NULL, size + sizeof(msgq_header_t), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
diff --git a/common/SConscript b/common/SConscript
index 35abeb9ee..d17b35fed 100644
--- a/common/SConscript
+++ b/common/SConscript
@@ -4,3 +4,11 @@ Import('env', 'cython_dependencies')
env.Command(['common_pyx.so', 'clock.cpp'],
cython_dependencies + ['common_pyx_setup.py', 'clock.pyx'],
"cd common && python3 common_pyx_setup.py build_ext --inplace")
+
+# Build cython params module
+env.Command(['params_pyx.so', 'params_pyx.cpp'],
+ cython_dependencies + [
+ 'params_pyx_setup.py', 'params_pyx.pyx', 'params_pxd.pxd',
+ '#selfdrive/common/params.cc', '#selfdrive/common/params.h',
+ '#selfdrive/common/util.c', '#selfdrive/common/util.h'],
+ "cd common && python3 params_pyx_setup.py build_ext --inplace")
diff --git a/common/apk.py b/common/apk.py
index c04c19aa5..275cdefed 100644
--- a/common/apk.py
+++ b/common/apk.py
@@ -31,9 +31,17 @@ def start_offroad():
system("am start -n ai.comma.plus.offroad/.MainActivity")
def set_package_permissions():
- pm_grant("ai.comma.plus.offroad", "android.permission.ACCESS_FINE_LOCATION")
- pm_grant("ai.comma.plus.offroad", "android.permission.READ_PHONE_STATE")
- pm_grant("ai.comma.plus.offroad", "android.permission.READ_EXTERNAL_STORAGE")
+ try:
+ output = subprocess.check_output(['dumpsys', 'package', 'ai.comma.plus.offroad'], encoding="utf-8")
+ given_permissions = output.split("runtime permissions")[1]
+ except Exception:
+ given_permissions = ""
+
+ wanted_permissions = ["ACCESS_FINE_LOCATION", "READ_PHONE_STATE", "READ_EXTERNAL_STORAGE"]
+ for permission in wanted_permissions:
+ if permission not in given_permissions:
+ pm_grant("ai.comma.plus.offroad", "android.permission."+permission)
+
appops_set("ai.comma.plus.offroad", "SU", "allow")
appops_set("ai.comma.plus.offroad", "WIFI_SCAN", "allow")
diff --git a/common/basedir.py b/common/basedir.py
index d98509ed6..a131f0d1a 100644
--- a/common/basedir.py
+++ b/common/basedir.py
@@ -4,7 +4,5 @@ BASEDIR = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__
from common.hardware import PC
if PC:
PERSIST = os.path.join(BASEDIR, "persist")
- PARAMS = os.path.join(BASEDIR, "persist", "params")
else:
PERSIST = "/persist"
- PARAMS = "/data/params"
diff --git a/common/clock.pyx b/common/clock.pyx
index 654d53f8f..9702e488c 100644
--- a/common/clock.pyx
+++ b/common/clock.pyx
@@ -1,3 +1,4 @@
+# cython: language_level = 3
from posix.time cimport clock_gettime, timespec, CLOCK_MONOTONIC_RAW, clockid_t
IF UNAME_SYSNAME == "Darwin":
diff --git a/common/common_pyx_setup.py b/common/common_pyx_setup.py
index 9d0f0fec8..d8f653e67 100644
--- a/common/common_pyx_setup.py
+++ b/common/common_pyx_setup.py
@@ -4,9 +4,9 @@ from Cython.Build import cythonize
from common.cython_hacks import BuildExtWithoutPlatformSuffix
sourcefiles = ['clock.pyx']
-extra_compile_args = ["-std=c++11"]
+extra_compile_args = ["-std=c++1z"]
-setup(name='Common',
+setup(name='common',
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
ext_modules=cythonize(
Extension(
@@ -14,7 +14,7 @@ setup(name='Common',
language="c++",
sources=sourcefiles,
extra_compile_args=extra_compile_args,
- )
+ ),
+ nthreads=4,
),
- nthreads=4,
)
diff --git a/common/ffi_wrapper.py b/common/ffi_wrapper.py
index 0fbe16296..e6ee2c23f 100644
--- a/common/ffi_wrapper.py
+++ b/common/ffi_wrapper.py
@@ -44,7 +44,7 @@ def compile_code(name, c_code, c_header, directory, cflags="", libraries=None):
ffibuilder = FFI()
ffibuilder.set_source(name, c_code, source_extension='.cpp', libraries=libraries)
ffibuilder.cdef(c_header)
- os.environ['OPT'] = "-fwrapv -O2 -DNDEBUG -std=c++11"
+ os.environ['OPT'] = "-fwrapv -O2 -DNDEBUG -std=c++1z"
os.environ['CFLAGS'] = cflags
ffibuilder.compile(verbose=True, debug=False, tmpdir=directory)
diff --git a/common/hardware_tici.py b/common/hardware_tici.py
index 223bfc1cc..2212edd48 100644
--- a/common/hardware_tici.py
+++ b/common/hardware_tici.py
@@ -2,6 +2,7 @@ import serial
from common.hardware_base import HardwareBase
from cereal import log
+import subprocess
NetworkType = log.ThermalData.NetworkType
@@ -40,7 +41,7 @@ class Tici(HardwareBase):
return ""
def reboot(self, reason=None):
- print("REBOOT!")
+ subprocess.check_output(["sudo", "reboot"])
def get_network_type(self):
return NetworkType.wifi
diff --git a/common/kalman/simple_kalman_impl.pxd b/common/kalman/simple_kalman_impl.pxd
index c81f95927..cb39a45bc 100644
--- a/common/kalman/simple_kalman_impl.pxd
+++ b/common/kalman/simple_kalman_impl.pxd
@@ -1,3 +1,5 @@
+# cython: language_level = 3
+
cdef class KF1D:
cdef public:
double x0_0
@@ -13,4 +15,4 @@ cdef class KF1D:
double A_K_0
double A_K_1
double A_K_2
- double A_K_3
\ No newline at end of file
+ double A_K_3
diff --git a/common/kalman/simple_kalman_setup.py b/common/kalman/simple_kalman_setup.py
index fb4886a0f..d0781c9ff 100644
--- a/common/kalman/simple_kalman_setup.py
+++ b/common/kalman/simple_kalman_setup.py
@@ -6,4 +6,5 @@ from common.cython_hacks import BuildExtWithoutPlatformSuffix
setup(name='Simple Kalman Implementation',
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
- ext_modules=cythonize(Extension("simple_kalman_impl", ["simple_kalman_impl.pyx"])))
+ ext_modules=cythonize(Extension("simple_kalman_impl",
+ ["simple_kalman_impl.pyx"])))
diff --git a/common/params.py b/common/params.py
old mode 100755
new mode 100644
index d30f2d0df..5a7a0d410
--- a/common/params.py
+++ b/common/params.py
@@ -1,409 +1,4 @@
-#!/usr/bin/env python3
-"""ROS has a parameter server, we have files.
-
-The parameter store is a persistent key value store, implemented as a directory with a writer lock.
-On Android, we store params under params_dir = /data/params. The writer lock is a file
-"/.lock" taken using flock(), and data is stored in a directory symlinked to by
-"/d".
-
-Each key, value pair is stored as a file with named with contents , located in
- /d/
-
-Readers of a single key can just open("/d/") and read the file contents.
-Readers who want a consistent snapshot of multiple keys should take the lock.
-
-Writers should take the lock before modifying anything. Writers should also leave the DB in a
-consistent state after a crash. The implementation below does this by copying all params to a temp
-directory /, then atomically symlinking / to /
-before deleting the old / directory.
-
-Writers that only modify a single key can simply take the lock, then swap the corresponding value
-file in place without messing with /d.
-"""
-import time
-import os
-import errno
-import shutil
-import fcntl
-import tempfile
-import threading
-from enum import Enum
-from common.basedir import PARAMS
-
-
-def mkdirs_exists_ok(path):
- try:
- os.makedirs(path)
- except OSError:
- if not os.path.isdir(path):
- raise
-
-
-class TxType(Enum):
- PERSISTENT = 1
- CLEAR_ON_MANAGER_START = 2
- CLEAR_ON_PANDA_DISCONNECT = 3
-
-
-class UnknownKeyName(Exception):
- pass
-
-
-keys = {
- "AccessToken": [TxType.CLEAR_ON_MANAGER_START],
- "AthenadPid": [TxType.PERSISTENT],
- "CalibrationParams": [TxType.PERSISTENT],
- "CarBatteryCapacity": [TxType.PERSISTENT],
- "CarParams": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
- "CarParamsCache": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
- "CarVin": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
- "CommunityFeaturesToggle": [TxType.PERSISTENT],
- "CompletedTrainingVersion": [TxType.PERSISTENT],
- "DisablePowerDown": [TxType.PERSISTENT],
- "DisableUpdates": [TxType.PERSISTENT],
- "DoUninstall": [TxType.CLEAR_ON_MANAGER_START],
- "DongleId": [TxType.PERSISTENT],
- "GitBranch": [TxType.PERSISTENT],
- "GitCommit": [TxType.PERSISTENT],
- "GitRemote": [TxType.PERSISTENT],
- "GithubSshKeys": [TxType.PERSISTENT],
- "HasAcceptedTerms": [TxType.PERSISTENT],
- "HasCompletedSetup": [TxType.PERSISTENT],
- "IsDriverViewEnabled": [TxType.CLEAR_ON_MANAGER_START],
- "IsLdwEnabled": [TxType.PERSISTENT],
- "IsMetric": [TxType.PERSISTENT],
- "IsOffroad": [TxType.CLEAR_ON_MANAGER_START],
- "IsRHD": [TxType.PERSISTENT],
- "IsTakingSnapshot": [TxType.CLEAR_ON_MANAGER_START],
- "IsUpdateAvailable": [TxType.CLEAR_ON_MANAGER_START],
- "IsUploadRawEnabled": [TxType.PERSISTENT],
- "LastAthenaPingTime": [TxType.PERSISTENT],
- "LastUpdateTime": [TxType.PERSISTENT],
- "LastUpdateException": [TxType.PERSISTENT],
- "LiveParameters": [TxType.PERSISTENT],
- "OpenpilotEnabledToggle": [TxType.PERSISTENT],
- "LaneChangeEnabled": [TxType.PERSISTENT],
- "PandaFirmware": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
- "PandaFirmwareHex": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
- "PandaDongleId": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
- "Passive": [TxType.PERSISTENT],
- "RecordFront": [TxType.PERSISTENT],
- "ReleaseNotes": [TxType.PERSISTENT],
- "ShouldDoUpdate": [TxType.CLEAR_ON_MANAGER_START],
- "SubscriberInfo": [TxType.PERSISTENT],
- "TermsVersion": [TxType.PERSISTENT],
- "TrainingVersion": [TxType.PERSISTENT],
- "UpdateAvailable": [TxType.CLEAR_ON_MANAGER_START],
- "UpdateFailedCount": [TxType.CLEAR_ON_MANAGER_START],
- "Version": [TxType.PERSISTENT],
- "Offroad_ChargeDisabled": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
- "Offroad_ConnectivityNeeded": [TxType.CLEAR_ON_MANAGER_START],
- "Offroad_ConnectivityNeededPrompt": [TxType.CLEAR_ON_MANAGER_START],
- "Offroad_TemperatureTooHigh": [TxType.CLEAR_ON_MANAGER_START],
- "Offroad_PandaFirmwareMismatch": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
- "Offroad_InvalidTime": [TxType.CLEAR_ON_MANAGER_START],
- "Offroad_IsTakingSnapshot": [TxType.CLEAR_ON_MANAGER_START],
- "Offroad_NeosUpdate": [TxType.CLEAR_ON_MANAGER_START],
- "Offroad_UpdateFailed": [TxType.CLEAR_ON_MANAGER_START],
-}
-
-
-def fsync_dir(path):
- fd = os.open(path, os.O_RDONLY)
- try:
- os.fsync(fd)
- finally:
- os.close(fd)
-
-
-class FileLock():
- def __init__(self, path, create, lock_ex):
- self._path = path
- self._create = create
- self._fd = None
- self._lock_ex = lock_ex
-
- def acquire(self):
- self._fd = os.open(self._path, os.O_CREAT if self._create else 0)
- fcntl.flock(self._fd, fcntl.LOCK_EX if self._lock_ex else fcntl.LOCK_SH)
-
- def release(self):
- if self._fd is not None:
- os.close(self._fd)
- self._fd = None
-
-
-class DBAccessor():
- def __init__(self, path):
- self._path = path
- self._vals = None
-
- def keys(self):
- self._check_entered()
- return self._vals.keys()
-
- def get(self, key):
- self._check_entered()
-
- if self._vals is None:
- return None
-
- try:
- return self._vals[key]
- except KeyError:
- return None
-
- def _get_lock(self, create, lock_ex):
- lock = FileLock(os.path.join(self._path, ".lock"), create, lock_ex)
- lock.acquire()
- return lock
-
- def _read_values_locked(self):
- """Callers should hold a lock while calling this method."""
- vals = {}
- try:
- data_path = self._data_path()
- keys = os.listdir(data_path)
- for key in keys:
- with open(os.path.join(data_path, key), "rb") as f:
- vals[key] = f.read()
- except (OSError, IOError) as e:
- # Either the DB hasn't been created yet, or somebody wrote a bug and left the DB in an
- # inconsistent state. Either way, return empty.
- if e.errno == errno.ENOENT:
- return {}
-
- return vals
-
- def _data_path(self):
- return os.path.join(self._path, "d")
-
- def _check_entered(self):
- if self._vals is None:
- raise Exception("Must call __enter__ before using DB")
-
-
-class DBReader(DBAccessor):
- def __enter__(self):
- try:
- lock = self._get_lock(False, False)
- except OSError as e:
- # Do not create lock if it does not exist.
- if e.errno == errno.ENOENT:
- self._vals = {}
- return self
-
- try:
- # Read everything.
- self._vals = self._read_values_locked()
- return self
- finally:
- lock.release()
-
- def __exit__(self, exc_type, exc_value, traceback):
- pass
-
-
-class DBWriter(DBAccessor):
- def __init__(self, path):
- super(DBWriter, self).__init__(path)
- self._lock = None
- self._prev_umask = None
-
- def put(self, key, value):
- self._vals[key] = value
-
- def delete(self, key):
- self._vals.pop(key, None)
-
- def __enter__(self):
- mkdirs_exists_ok(self._path)
-
- # Make sure we can write and that permissions are correct.
- self._prev_umask = os.umask(0)
-
- try:
- os.chmod(self._path, 0o777)
- self._lock = self._get_lock(True, True)
- self._vals = self._read_values_locked()
- except Exception:
- os.umask(self._prev_umask)
- self._prev_umask = None
- raise
-
- return self
-
- def __exit__(self, exc_type, exc_value, traceback):
- self._check_entered()
-
- try:
- # data_path refers to the externally used path to the params. It is a symlink.
- # old_data_path is the path currently pointed to by data_path.
- # tempdir_path is a path where the new params will go, which the new data path will point to.
- # new_data_path is a temporary symlink that will atomically overwrite data_path.
- #
- # The current situation is:
- # data_path -> old_data_path
- # We're going to write params data to tempdir_path
- # tempdir_path -> params data
- # Then point new_data_path to tempdir_path
- # new_data_path -> tempdir_path
- # Then atomically overwrite data_path with new_data_path
- # data_path -> tempdir_path
- old_data_path = None
- new_data_path = None
- tempdir_path = tempfile.mkdtemp(prefix=".tmp", dir=self._path)
-
- try:
- # Write back all keys.
- os.chmod(tempdir_path, 0o777)
- for k, v in self._vals.items():
- with open(os.path.join(tempdir_path, k), "wb") as f:
- f.write(v)
- f.flush()
- os.fsync(f.fileno())
- fsync_dir(tempdir_path)
-
- data_path = self._data_path()
- try:
- old_data_path = os.path.join(self._path, os.readlink(data_path))
- except (OSError, IOError):
- # NOTE(mgraczyk): If other DB implementations have bugs, this could cause
- # copies to be left behind, but we still want to overwrite.
- pass
-
- new_data_path = "{}.link".format(tempdir_path)
- os.symlink(os.path.basename(tempdir_path), new_data_path)
- os.rename(new_data_path, data_path)
- fsync_dir(self._path)
- finally:
- # If the rename worked, we can delete the old data. Otherwise delete the new one.
- success = new_data_path is not None and os.path.exists(data_path) and (
- os.readlink(data_path) == os.path.basename(tempdir_path))
-
- if success:
- if old_data_path is not None:
- shutil.rmtree(old_data_path)
- else:
- shutil.rmtree(tempdir_path)
-
- # Regardless of what happened above, there should be no link at new_data_path.
- if new_data_path is not None and os.path.islink(new_data_path):
- os.remove(new_data_path)
- finally:
- os.umask(self._prev_umask)
- self._prev_umask = None
-
- # Always release the lock.
- self._lock.release()
- self._lock = None
-
-
-def read_db(params_path, key):
- path = "%s/d/%s" % (params_path, key)
- try:
- with open(path, "rb") as f:
- return f.read()
- except IOError:
- return None
-
-
-def write_db(params_path, key, value):
- if isinstance(value, str):
- value = value.encode('utf8')
-
- prev_umask = os.umask(0)
- lock = FileLock(params_path + "/.lock", True, True)
- lock.acquire()
-
- try:
- tmp_path = tempfile.NamedTemporaryFile(mode="wb", prefix=".tmp", dir=params_path, delete=False)
- with tmp_path as f:
- f.write(value)
- f.flush()
- os.fsync(f.fileno())
- os.chmod(tmp_path.name, 0o666)
-
- path = "%s/d/%s" % (params_path, key)
- os.rename(tmp_path.name, path)
- fsync_dir(os.path.dirname(path))
- finally:
- os.umask(prev_umask)
- lock.release()
-
-
-class Params():
- def __init__(self, db=PARAMS):
- self.db = db
-
- # create the database if it doesn't exist...
- if not os.path.exists(self.db + "/d"):
- with self.transaction(write=True):
- pass
-
- def clear_all(self):
- shutil.rmtree(self.db, ignore_errors=True)
- with self.transaction(write=True):
- pass
-
- def transaction(self, write=False):
- if write:
- return DBWriter(self.db)
- else:
- return DBReader(self.db)
-
- def _clear_keys_with_type(self, tx_type):
- with self.transaction(write=True) as txn:
- for key in keys:
- if tx_type in keys[key]:
- txn.delete(key)
-
- def manager_start(self):
- self._clear_keys_with_type(TxType.CLEAR_ON_MANAGER_START)
-
- def panda_disconnect(self):
- self._clear_keys_with_type(TxType.CLEAR_ON_PANDA_DISCONNECT)
-
- def delete(self, key):
- with self.transaction(write=True) as txn:
- txn.delete(key)
-
- def get(self, key, block=False, encoding=None):
- if key not in keys:
- raise UnknownKeyName(key)
-
- while 1:
- ret = read_db(self.db, key)
- if not block or ret is not None:
- break
- # is polling really the best we can do?
- time.sleep(0.05)
-
- if ret is not None and encoding is not None:
- ret = ret.decode(encoding)
-
- return ret
-
- def put(self, key, dat):
- """
- Warning: This function blocks until the param is written to disk!
- In very rare cases this can take over a second, and your code will hang.
-
- Use the put_nonblocking helper function in time sensitive code, but
- in general try to avoid writing params as much as possible.
- """
-
- if key not in keys:
- raise UnknownKeyName(key)
-
- write_db(self.db, key, dat)
-
-
-def put_nonblocking(key, val):
- def f(key, val):
- params = Params()
- params.put(key, val)
-
- t = threading.Thread(target=f, args=(key, val))
- t.start()
- return t
+from common.params_pyx import Params, UnknownKeyName, put_nonblocking # pylint: disable=no-name-in-module, import-error
+assert Params
+assert UnknownKeyName
+assert put_nonblocking
diff --git a/common/params_pxd.pxd b/common/params_pxd.pxd
new file mode 100644
index 000000000..e437a09b0
--- /dev/null
+++ b/common/params_pxd.pxd
@@ -0,0 +1,16 @@
+from libcpp.string cimport string
+from libcpp cimport bool
+
+cdef extern from "selfdrive/common/params.cc":
+ pass
+
+cdef extern from "selfdrive/common/util.c":
+ pass
+
+cdef extern from "selfdrive/common/params.h":
+ cdef cppclass Params:
+ Params(bool)
+ Params(string)
+ string get(string, bool) nogil
+ int delete_db_value(string)
+ int write_db_value(string, string)
diff --git a/common/params_pyx.pyx b/common/params_pyx.pyx
new file mode 100755
index 000000000..75ebacb3f
--- /dev/null
+++ b/common/params_pyx.pyx
@@ -0,0 +1,160 @@
+# distutils: language = c++
+# cython: language_level = 3
+from libcpp cimport bool
+from libcpp.string cimport string
+from params_pxd cimport Params as c_Params
+
+import os
+import threading
+from common.basedir import BASEDIR
+
+cdef enum TxType:
+ PERSISTENT = 1
+ CLEAR_ON_MANAGER_START = 2
+ CLEAR_ON_PANDA_DISCONNECT = 3
+
+keys = {
+ b"AccessToken": [TxType.CLEAR_ON_MANAGER_START],
+ b"AthenadPid": [TxType.PERSISTENT],
+ b"CalibrationParams": [TxType.PERSISTENT],
+ b"CarBatteryCapacity": [TxType.PERSISTENT],
+ b"CarParams": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
+ b"CarParamsCache": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
+ b"CarVin": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
+ b"CommunityFeaturesToggle": [TxType.PERSISTENT],
+ b"CompletedTrainingVersion": [TxType.PERSISTENT],
+ b"DisablePowerDown": [TxType.PERSISTENT],
+ b"DisableUpdates": [TxType.PERSISTENT],
+ b"DoUninstall": [TxType.CLEAR_ON_MANAGER_START],
+ b"DongleId": [TxType.PERSISTENT],
+ b"GitBranch": [TxType.PERSISTENT],
+ b"GitCommit": [TxType.PERSISTENT],
+ b"GitRemote": [TxType.PERSISTENT],
+ b"GithubSshKeys": [TxType.PERSISTENT],
+ b"HasAcceptedTerms": [TxType.PERSISTENT],
+ b"HasCompletedSetup": [TxType.PERSISTENT],
+ b"IsDriverViewEnabled": [TxType.CLEAR_ON_MANAGER_START],
+ b"IsLdwEnabled": [TxType.PERSISTENT],
+ b"IsMetric": [TxType.PERSISTENT],
+ b"IsOffroad": [TxType.CLEAR_ON_MANAGER_START],
+ b"IsRHD": [TxType.PERSISTENT],
+ b"IsTakingSnapshot": [TxType.CLEAR_ON_MANAGER_START],
+ b"IsUpdateAvailable": [TxType.CLEAR_ON_MANAGER_START],
+ b"IsUploadRawEnabled": [TxType.PERSISTENT],
+ b"LastAthenaPingTime": [TxType.PERSISTENT],
+ b"LastUpdateTime": [TxType.PERSISTENT],
+ b"LastUpdateException": [TxType.PERSISTENT],
+ b"LiveParameters": [TxType.PERSISTENT],
+ b"OpenpilotEnabledToggle": [TxType.PERSISTENT],
+ b"LaneChangeEnabled": [TxType.PERSISTENT],
+ b"PandaFirmware": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
+ b"PandaFirmwareHex": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
+ b"PandaDongleId": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
+ b"Passive": [TxType.PERSISTENT],
+ b"RecordFront": [TxType.PERSISTENT],
+ b"ReleaseNotes": [TxType.PERSISTENT],
+ b"ShouldDoUpdate": [TxType.CLEAR_ON_MANAGER_START],
+ b"SubscriberInfo": [TxType.PERSISTENT],
+ b"TermsVersion": [TxType.PERSISTENT],
+ b"TrainingVersion": [TxType.PERSISTENT],
+ b"UpdateAvailable": [TxType.CLEAR_ON_MANAGER_START],
+ b"UpdateFailedCount": [TxType.CLEAR_ON_MANAGER_START],
+ b"Version": [TxType.PERSISTENT],
+ b"Offroad_ChargeDisabled": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
+ b"Offroad_ConnectivityNeeded": [TxType.CLEAR_ON_MANAGER_START],
+ b"Offroad_ConnectivityNeededPrompt": [TxType.CLEAR_ON_MANAGER_START],
+ b"Offroad_TemperatureTooHigh": [TxType.CLEAR_ON_MANAGER_START],
+ b"Offroad_PandaFirmwareMismatch": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
+ b"Offroad_InvalidTime": [TxType.CLEAR_ON_MANAGER_START],
+ b"Offroad_IsTakingSnapshot": [TxType.CLEAR_ON_MANAGER_START],
+ b"Offroad_NeosUpdate": [TxType.CLEAR_ON_MANAGER_START],
+ b"Offroad_UpdateFailed": [TxType.CLEAR_ON_MANAGER_START],
+}
+
+def ensure_bytes(v):
+ if isinstance(v, str):
+ return v.encode()
+ else:
+ return v
+
+
+class UnknownKeyName(Exception):
+ pass
+
+cdef class Params:
+ cdef c_Params* p
+
+ def __cinit__(self, d=None, bool persistent_params=False):
+ if d is None:
+ self.p = new c_Params(persistent_params)
+ else:
+ self.p = new c_Params(d.encode())
+
+ def __dealloc__(self):
+ del self.p
+
+ def clear_all(self, tx_type=None):
+ for key in keys:
+ if tx_type is None or tx_type in keys[key]:
+ self.delete(key)
+
+ def manager_start(self):
+ self.clear_all(TxType.CLEAR_ON_MANAGER_START)
+
+ def panda_disconnect(self):
+ self.clear_all(TxType.CLEAR_ON_PANDA_DISCONNECT)
+
+ def get(self, key, block=False, encoding=None):
+ key = ensure_bytes(key)
+
+ if key not in keys:
+ raise UnknownKeyName(key)
+
+ cdef string k = key
+ cdef bool b = block
+
+ cdef string val
+ with nogil:
+ val = self.p.get(k, b)
+
+ if val == b"":
+ if block:
+ # If we got no value while running in blocked mode
+ # it means we got an interrupt while waiting
+ raise KeyboardInterrupt
+ else:
+ return None
+
+ if encoding is not None:
+ return val.decode(encoding)
+ else:
+ return val
+
+ def put(self, key, dat):
+ """
+ Warning: This function blocks until the param is written to disk!
+ In very rare cases this can take over a second, and your code will hang.
+ Use the put_nonblocking helper function in time sensitive code, but
+ in general try to avoid writing params as much as possible.
+ """
+ key = ensure_bytes(key)
+ dat = ensure_bytes(dat)
+
+ if key not in keys:
+ raise UnknownKeyName(key)
+
+ self.p.write_db_value(key, dat)
+
+ def delete(self, key):
+ key = ensure_bytes(key)
+ self.p.delete_db_value(key)
+
+
+def put_nonblocking(key, val, d=None):
+ def f(key, val):
+ params = Params(d)
+ params.put(key, val)
+
+ t = threading.Thread(target=f, args=(key, val))
+ t.start()
+ return t
diff --git a/common/params_pyx_setup.py b/common/params_pyx_setup.py
new file mode 100644
index 000000000..28dd9ee50
--- /dev/null
+++ b/common/params_pyx_setup.py
@@ -0,0 +1,33 @@
+import os
+import subprocess
+from distutils.core import Extension, setup
+from Cython.Build import cythonize
+
+from common.cython_hacks import BuildExtWithoutPlatformSuffix
+from common.basedir import BASEDIR
+from common.hardware import TICI
+
+ARCH = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip() # pylint: disable=unexpected-keyword-arg
+
+sourcefiles = ['params_pyx.pyx']
+extra_compile_args = ["-std=c++11"]
+
+if ARCH == "aarch64":
+ if TICI:
+ extra_compile_args += ["-DQCOM2"]
+ else:
+ extra_compile_args += ["-DQCOM"]
+
+
+setup(name='common',
+ cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
+ ext_modules=cythonize(
+ Extension(
+ "params_pyx",
+ language="c++",
+ sources=sourcefiles,
+ include_dirs=[BASEDIR, os.path.join(BASEDIR, 'selfdrive')],
+ extra_compile_args=extra_compile_args
+ )
+ )
+)
diff --git a/common/profiler.py b/common/profiler.py
index ac28bdac4..e4d208aca 100644
--- a/common/profiler.py
+++ b/common/profiler.py
@@ -36,10 +36,10 @@ class Profiler():
if not self.enabled:
return
self.iter += 1
- print("******* Profiling *******")
+ print("******* Profiling %d *******" % self.iter)
for n, ms in sorted(self.cp.items(), key=lambda x: -x[1]):
if n in self.cp_ignored:
- print("%30s: %9.2f percent: %3.0f IGNORED" % (n, ms*1000.0, ms/self.tot*100))
+ print("%30s: %9.2f avg: %7.2f percent: %3.0f IGNORED" % (n, ms*1000.0, ms*1000.0/self.iter, ms/self.tot*100))
else:
- print("%30s: %9.2f percent: %3.0f" % (n, ms*1000.0, ms/self.tot*100))
+ print("%30s: %9.2f avg: %7.2f percent: %3.0f" % (n, ms*1000.0, ms*1000.0/self.iter, ms/self.tot*100))
print("Iter clock: %2.6f TOTAL: %2.2f" % (self.tot/self.iter, self.tot))
diff --git a/common/realtime.py b/common/realtime.py
index 7f4ad5c0d..c883ec053 100644
--- a/common/realtime.py
+++ b/common/realtime.py
@@ -31,7 +31,7 @@ def set_core_affinity(core):
os.sched_setaffinity(0, [core,])
-def config_rt_process(core, priority):
+def config_realtime_process(core, priority):
gc.disable()
set_realtime_priority(priority)
set_core_affinity(core)
diff --git a/common/transformations/setup.py b/common/transformations/setup.py
index c239a9745..32546192d 100644
--- a/common/transformations/setup.py
+++ b/common/transformations/setup.py
@@ -1,42 +1,20 @@
-import os
import numpy
-import sysconfig
from Cython.Build import cythonize
-from Cython.Distutils import build_ext
from distutils.core import Extension, setup # pylint: disable=import-error,no-name-in-module
-
-def get_ext_filename_without_platform_suffix(filename):
- name, ext = os.path.splitext(filename)
- ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
-
- if ext_suffix == ext:
- return filename
-
- ext_suffix = ext_suffix.replace(ext, '')
- idx = name.find(ext_suffix)
-
- if idx == -1:
- return filename
- else:
- return name[:idx] + ext
-
-
-class BuildExtWithoutPlatformSuffix(build_ext):
- def get_ext_filename(self, ext_name):
- filename = super().get_ext_filename(ext_name)
- return get_ext_filename_without_platform_suffix(filename)
-
+from common.cython_hacks import BuildExtWithoutPlatformSuffix
setup(
name='Cython transformations wrapper',
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
ext_modules=cythonize(
- Extension(
- "transformations",
- sources=["transformations.pyx"],
- language="c++",
- extra_compile_args=["-std=c++14"],
- include_dirs=[numpy.get_include()],
+ Extension(
+ "transformations",
+ sources=["transformations.pyx"],
+ language="c++",
+ extra_compile_args=["-std=c++1z", "-Wno-cpp"],
+ include_dirs=[numpy.get_include()],
+ ),
+ nthreads=4,
)
-))
+)
diff --git a/common/transformations/transformations.pxd b/common/transformations/transformations.pxd
index cb3ee53b1..7af009870 100644
--- a/common/transformations/transformations.pxd
+++ b/common/transformations/transformations.pxd
@@ -1,3 +1,4 @@
+#cython: language_level=3
from libcpp cimport bool
cdef extern from "orientation.cc":
diff --git a/common/transformations/transformations.pyx b/common/transformations/transformations.pyx
index 194257e03..12d6e2ab5 100644
--- a/common/transformations/transformations.pyx
+++ b/common/transformations/transformations.pyx
@@ -26,7 +26,7 @@ cdef np.ndarray[double, ndim=2] matrix2numpy(Matrix3 m):
[m(2, 0), m(2, 1), m(2, 2)],
])
-cdef Matrix3 numpy2matrix (np.ndarray[double, ndim=2, mode="fortran"] m):
+cdef Matrix3 numpy2matrix(np.ndarray[double, ndim=2, mode="fortran"] m):
assert m.shape[0] == 3
assert m.shape[1] == 3
return Matrix3(m.data)
diff --git a/installer/updater/Makefile b/installer/updater/Makefile
index d252fc2aa..54bd7c9df 100644
--- a/installer/updater/Makefile
+++ b/installer/updater/Makefile
@@ -10,7 +10,7 @@ WARN_FLAGS = -Werror=implicit-function-declaration \
-Werror=format-extra-args
CFLAGS = -std=gnu11 -g -fPIC -O2 $(WARN_FLAGS)
-CXXFLAGS = -std=c++11 -g -fPIC -O2 $(WARN_FLAGS)
+CXXFLAGS = -std=c++1z -g -fPIC -O2 $(WARN_FLAGS)
CURL_FLAGS = -I$(PHONELIBS)/curl/include
CURL_LIBS = $(PHONELIBS)/curl/lib/libcurl.a \
@@ -34,6 +34,7 @@ all: updater
OBJS = opensans_regular.ttf.o \
opensans_semibold.ttf.o \
opensans_bold.ttf.o \
+ ../../selfdrive/common/util.o \
../../selfdrive/common/touch.o \
../../selfdrive/common/framebuffer.o \
$(PHONELIBS)/json11/json11.o \
diff --git a/installer/updater/update.json b/installer/updater/update.json
index 6e2692bfa..046793a87 100644
--- a/installer/updater/update.json
+++ b/installer/updater/update.json
@@ -1,7 +1,7 @@
{
- "ota_url": "https://commadist.azureedge.net/neosupdate/ota-signed-efdf7de63b1aef63d68301e6175930991bf9a5927d16ec6fcc69287e2ee7ca4a.zip",
- "ota_hash": "efdf7de63b1aef63d68301e6175930991bf9a5927d16ec6fcc69287e2ee7ca4a",
- "recovery_url": "https://commadist.azureedge.net/neosupdate/recovery-97c27e6ed04ed6bb0608b845a2d4100912093f9380c3f2ba6b56bccd608e5f6e.img",
- "recovery_len": 15861036,
- "recovery_hash": "97c27e6ed04ed6bb0608b845a2d4100912093f9380c3f2ba6b56bccd608e5f6e"
+ "ota_url": "https://commadist.azureedge.net/neosupdate/ota-signed-ba3ecb158edc760beda0d32e0eea4311031e460afa97fc180dc83f76cf512694.zip",
+ "ota_hash": "ba3ecb158edc760beda0d32e0eea4311031e460afa97fc180dc83f76cf512694",
+ "recovery_url": "https://commadist.azureedge.net/neosupdate/recovery-e35dc1939dab4c6c2cbae3f225b07515f1a5c02afb232dc22e93f17c9840499f.img",
+ "recovery_len": 15926572,
+ "recovery_hash": "e35dc1939dab4c6c2cbae3f225b07515f1a5c02afb232dc22e93f17c9840499f"
}
diff --git a/installer/updater/update_kernel.json b/installer/updater/update_kernel.json
deleted file mode 100644
index 41dc595b0..000000000
--- a/installer/updater/update_kernel.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "ota_url": "https://commadist.azureedge.net/neosupdate/ota-signed-3bd2b3bdd6a501569e00b8f12786d65e0fd2788c0dd238f8c986e3e2e504683a-kernel.zip",
- "ota_hash": "3bd2b3bdd6a501569e00b8f12786d65e0fd2788c0dd238f8c986e3e2e504683a",
- "recovery_url": "https://commadist.azureedge.net/neosupdate/recovery-97c27e6ed04ed6bb0608b845a2d4100912093f9380c3f2ba6b56bccd608e5f6e.img",
- "recovery_len": 15861036,
- "recovery_hash": "97c27e6ed04ed6bb0608b845a2d4100912093f9380c3f2ba6b56bccd608e5f6e"
-}
diff --git a/installer/updater/updater b/installer/updater/updater
index 66047420c..729de8434 100755
Binary files a/installer/updater/updater and b/installer/updater/updater differ
diff --git a/installer/updater/updater.cc b/installer/updater/updater.cc
index ca0b9270b..d737ea248 100644
--- a/installer/updater/updater.cc
+++ b/installer/updater/updater.cc
@@ -231,6 +231,8 @@ struct Updater {
&fb_w, &fb_h);
assert(fb);
+ framebuffer_set_power(fb, HWC_POWER_MODE_NORMAL);
+
vg = nvgCreateGLES3(NVG_ANTIALIAS | NVG_STENCIL_STROKES | NVG_DEBUG);
assert(vg);
diff --git a/launch_chffrplus.sh b/launch_chffrplus.sh
index 7124ef3c4..9686c436e 100755
--- a/launch_chffrplus.sh
+++ b/launch_chffrplus.sh
@@ -12,8 +12,8 @@ function two_init {
# Restrict Android and other system processes to the first two cores
echo 0-1 > /dev/cpuset/background/cpus
echo 0-1 > /dev/cpuset/system-background/cpus
- echo 0-1 > /dev/cpuset/foreground/boost/cpus
echo 0-1 > /dev/cpuset/foreground/cpus
+ echo 0-1 > /dev/cpuset/foreground/boost/cpus
echo 0-1 > /dev/cpuset/android/cpus
# openpilot gets all the cores
@@ -27,6 +27,8 @@ function two_init {
[ -d "/proc/irq/733" ] && echo 3 > /proc/irq/733/smp_affinity_list # USB for LeEco
[ -d "/proc/irq/736" ] && echo 3 > /proc/irq/736/smp_affinity_list # USB for OP3T
+ # restrict unbound kworkers to first two cores
+ #find /sys/devices/virtual/workqueue -name cpumask -exec sh -c 'echo 3 > {}' ';'
# Check for NEOS update
if [ $(< /VERSION) != "$REQUIRED_NEOS_VERSION" ]; then
@@ -43,10 +45,6 @@ function two_init {
fi
"$DIR/installer/updater/updater" "file://$DIR/installer/updater/update.json"
- else
- if [[ $(uname -v) == "#1 SMP PREEMPT Wed Jun 10 12:40:53 PDT 2020" ]]; then
- "$DIR/installer/updater/updater" "file://$DIR/installer/updater/update_kernel.json"
- fi
fi
# One-time fix for a subset of OP3T with gyro orientation offsets.
@@ -117,6 +115,9 @@ function launch {
ln -sfn $(pwd) /data/pythonpath
export PYTHONPATH="$PWD"
+ # write tmux scrollback to a file
+ tmux capture-pane -pq -S-1000 > /tmp/launch_log
+
# start manager
cd selfdrive
./manager.py
diff --git a/launch_env.sh b/launch_env.sh
index 9a86d315c..ac578facf 100755
--- a/launch_env.sh
+++ b/launch_env.sh
@@ -7,7 +7,7 @@ export OPENBLAS_NUM_THREADS=1
export VECLIB_MAXIMUM_THREADS=1
if [ -z "$REQUIRED_NEOS_VERSION" ]; then
- export REQUIRED_NEOS_VERSION="14"
+ export REQUIRED_NEOS_VERSION="15"
fi
if [ -z "$PASSIVE" ]; then
diff --git a/opendbc/acura_rdx_2020_can_generated.dbc b/opendbc/acura_rdx_2020_can_generated.dbc
new file mode 100644
index 000000000..b4adc6625
--- /dev/null
+++ b/opendbc/acura_rdx_2020_can_generated.dbc
@@ -0,0 +1,433 @@
+CM_ "AUTOGENERATED FILE, DO NOT EDIT"
+
+
+CM_ "Imported file _bosch_2020.dbc starts here"
+VERSION ""
+
+
+NS_ :
+ NS_DESC_
+ CM_
+ BA_DEF_
+ BA_
+ VAL_
+ CAT_DEF_
+ CAT_
+ FILTER
+ BA_DEF_DEF_
+ EV_DATA_
+ ENVVAR_DATA_
+ SGTYPE_
+ SGTYPE_VAL_
+ BA_DEF_SGTYPE_
+ BA_SGTYPE_
+ SIG_TYPE_REF_
+ VAL_TABLE_
+ SIG_GROUP_
+ SIG_VALTYPE_
+ SIGTYPE_VALTYPE_
+ BO_TX_BU_
+ BA_DEF_REL_
+ BA_REL_
+ BA_DEF_DEF_REL_
+ BU_SG_REL_
+ BU_EV_REL_
+ BU_BO_REL_
+ SG_MUL_VAL_
+
+BU_: EBCM EON CAM RADAR PCM EPS VSA SCM BDY XXX EPB
+
+BO_ 148 KINEMATICS: 8 XXX
+ SG_ LAT_ACCEL : 7|10@0+ (-0.035,17.92) [-20|20] "m/s2" EON
+ SG_ LONG_ACCEL : 25|10@0+ (-0.035,17.92) [-20|20] "m/s2" EON
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
+
+BO_ 228 STEERING_CONTROL: 5 EON
+ SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS
+ SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS
+ SG_ SET_ME_X00_2 : 31|8@0+ (1,0) [0|0] "" EPS
+ SG_ STEER_TORQUE : 7|16@0- (1,0) [-4096|4096] "" EPS
+ SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" EPS
+ SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" EPS
+
+BO_ 229 BOSCH_SUPPLEMENTAL_1: 8 XXX
+ SG_ SET_ME_X04 : 0|8@1+ (1,0) [0|255] "" XXX
+ SG_ SET_ME_X00 : 8|8@1+ (1,0) [0|255] "" XXX
+ SG_ SET_ME_X80 : 16|8@1+ (1,0) [0|255] "" XXX
+ SG_ SET_ME_X10 : 24|8@1+ (1,0) [0|255] "" XXX
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
+
+BO_ 232 BRAKE_HOLD: 7 XXX
+ SG_ XMISSION_SPEED : 7|14@0- (1,0) [1|0] "" XXX
+ SG_ COMPUTER_BRAKE : 39|16@0+ (1,0) [0|0] "" XXX
+ SG_ COMPUTER_BRAKE_REQUEST : 29|1@0+ (1,0) [0|0] "" XXX
+ SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" XXX
+ SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" XXX
+
+BO_ 342 STEERING_SENSORS: 6 EPS
+ SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON
+ SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" EON
+ SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON
+ SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" EON
+
+BO_ 344 ENGINE_DATA: 8 PCM
+ SG_ XMISSION_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" EON
+ SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON
+ SG_ XMISSION_SPEED2 : 39|16@0+ (0.01,0) [0|250] "kph" EON
+ SG_ ODOMETER : 55|8@0+ (10,0) [0|2550] "m" XXX
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
+
+BO_ 380 POWERTRAIN_DATA: 8 PCM
+ SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON
+ SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON
+ SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" EON
+ SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "" EON
+ SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "" EON
+ SG_ BRAKE_SWITCH : 32|1@0+ (1,0) [0|1] "" EON
+ SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "" EON
+ SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON
+ SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "" EON
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
+
+BO_ 399 STEER_STATUS: 7 EPS
+ SG_ STEER_TORQUE_SENSOR : 7|16@0- (-1,0) [-31000|31000] "tbd" EON
+ SG_ STEER_ANGLE_RATE : 23|16@0- (-0.1,0) [-31000|31000] "deg/s" EON
+ SG_ STEER_STATUS : 39|4@0+ (1,0) [0|15] "" EON
+ SG_ STEER_CONTROL_ACTIVE : 35|1@0+ (1,0) [0|1] "" EON
+ SG_ STEER_CONFIG_INDEX : 43|4@0+ (1,0) [0|15] "" EON
+ SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
+ SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON
+
+BO_ 420 VSA_STATUS: 8 VSA
+ SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" EON
+ SG_ USER_BRAKE : 7|16@0+ (0.015625,-1.609375) [0|1000] "" EON
+ SG_ BRAKE_HOLD_ACTIVE : 46|1@0+ (1,0) [0|1] "" EON
+ SG_ BRAKE_HOLD_ENABLED : 45|1@0+ (1,0) [0|1] "" EON
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
+
+BO_ 427 STEER_MOTOR_TORQUE: 3 EPS
+ SG_ CONFIG_VALID : 7|1@0+ (1,0) [0|1] "" EON
+ SG_ MOTOR_TORQUE : 1|10@0+ (1,0) [0|256] "" EON
+ SG_ OUTPUT_DISABLED : 22|1@0+ (1,0) [0|1] "" EON
+ SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" EON
+ SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" EON
+
+BO_ 450 EPB_STATUS: 8 EPB
+ SG_ EPB_ACTIVE : 3|1@0+ (1,0) [0|1] "" EON
+ SG_ EPB_STATE : 29|2@0+ (1,0) [0|3] "" EON
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
+
+BO_ 464 WHEEL_SPEEDS: 8 VSA
+ SG_ WHEEL_SPEED_FL : 7|15@0+ (0.01,0) [0|250] "kph" EON
+ SG_ WHEEL_SPEED_FR : 8|15@0+ (0.01,0) [0|250] "kph" EON
+ SG_ WHEEL_SPEED_RL : 25|15@0+ (0.01,0) [0|250] "kph" EON
+ SG_ WHEEL_SPEED_RR : 42|15@0+ (0.01,0) [0|250] "kph" EON
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
+
+BO_ 479 ACC_CONTROL: 8 EON
+ SG_ SET_TO_0 : 20|5@0+ (1,0) [0|1] "" XXX
+ SG_ CONTROL_ON : 23|3@0+ (1,0) [0|5] "" XXX
+ SG_ GAS_COMMAND : 7|16@0- (1,0) [0|0] "" XXX
+ SG_ ACCEL_COMMAND : 31|11@0- (0.01,0) [0|0] "m/s2" XXX
+ SG_ BRAKE_LIGHTS : 62|1@0+ (1,0) [0|1] "" XXX
+ SG_ BRAKE_REQUEST : 34|1@0+ (1,0) [0|1] "" XXX
+ SG_ STANDSTILL : 35|1@0+ (1,0) [0|1] "" XXX
+ SG_ STANDSTILL_RELEASE : 36|1@0+ (1,0) [0|1] "" XXX
+ SG_ AEB_STATUS : 33|1@0+ (1,0) [0|1] "" XXX
+ SG_ AEB_BRAKING : 47|1@0+ (1,0) [0|1] "" XXX
+ SG_ AEB_PREPARE : 43|1@0+ (1,0) [0|1] "" XXX
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
+
+BO_ 490 VEHICLE_DYNAMICS: 8 VSA
+ SG_ LAT_ACCEL : 7|16@0- (0.0015,0) [-20|20] "m/s2" EON
+ SG_ LONG_ACCEL : 23|16@0- (0.0015,0) [-20|20] "m/s2" EON
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
+
+BO_ 495 ACC_CONTROL_ON: 8 XXX
+ SG_ SET_TO_75 : 31|8@0+ (1,0) [0|255] "" XXX
+ SG_ SET_TO_30 : 39|8@0+ (1,0) [0|255] "" XXX
+ SG_ ZEROS_BOH : 23|8@0+ (1,0) [0|255] "" XXX
+ SG_ ZEROS_BOH2 : 47|16@0+ (1,0) [0|255] "" XXX
+ SG_ SET_TO_FF : 15|8@0+ (1,0) [0|255] "" XXX
+ SG_ SET_TO_3 : 6|7@0+ (1,0) [0|4095] "" XXX
+ SG_ CONTROL_ON : 7|1@0+ (1,0) [0|1] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
+
+BO_ 545 XXX_16: 6 SCM
+ SG_ ECON_ON : 23|1@0+ (1,0) [0|1] "" XXX
+ SG_ DRIVE_MODE : 37|2@0+ (1,0) [0|3] "" XXX
+ SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" BDY
+ SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" BDY
+
+BO_ 576 LEFT_LANE_LINE_1: 8 CAM
+ SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX
+ SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX
+ SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX
+ SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX
+ SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX
+ SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX
+
+BO_ 577 LEFT_LANE_LINE_2: 8 CAM
+ SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX
+ SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX
+ SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX
+ SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX
+ SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX
+ SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX
+ SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX
+
+BO_ 579 RIGHT_LANE_LINE_1: 8 CAM
+ SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX
+ SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX
+ SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX
+ SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX
+ SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX
+ SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX
+
+BO_ 580 RIGHT_LANE_LINE_2: 8 CAM
+ SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX
+ SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX
+ SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX
+ SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX
+ SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX
+ SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX
+ SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX
+
+BO_ 582 ADJACENT_LEFT_LANE_LINE_1: 8 CAM
+ SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX
+ SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX
+ SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX
+ SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX
+ SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX
+ SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX
+
+BO_ 583 ADJACENT_LEFT_LANE_LINE_2: 8 CAM
+ SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX
+ SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX
+ SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX
+ SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX
+ SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX
+ SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX
+ SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX
+
+BO_ 585 ADJACENT_RIGHT_LANE_LINE_1: 8 CAM
+ SG_ LINE_DISTANCE_VISIBLE : 39|9@0+ (1,0) [0|1] "" XXX
+ SG_ LINE_PROBABILITY : 46|6@0+ (0.015625,0) [0|1] "" XXX
+ SG_ LINE_OFFSET : 23|12@0+ (0.004,-8.192) [0|1] "Meters" XXX
+ SG_ LINE_ANGLE : 7|12@0+ (0.0005,-1.024) [0|1] "" XXX
+ SG_ FRAME_INDEX : 8|4@1+ (1,0) [0|15] "" XXX
+ SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX
+
+BO_ 586 ADJACENT_RIGHT_LANE_LINE_2: 8 CAM
+ SG_ LINE_FAR_EDGE_POSITION : 55|8@0+ (1,-128) [0|1] "" XXX
+ SG_ LINE_SOLID : 13|1@0+ (1,0) [0|1] "" XXX
+ SG_ LINE_DASHED : 14|1@0+ (1,0) [0|1] "" XXX
+ SG_ LINE_CURVATURE : 23|12@0+ (0.00001,-0.02048) [0|1] "" XXX
+ SG_ LINE_PARAMETER : 39|12@0+ (1,0) [0|1] "" XXX
+ SG_ FRAME_INDEX : 7|4@0+ (1,0) [0|15] "" XXX
+ SG_ COUNTER : 61|2@0+ (1,0) [0|1] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|1] "" XXX
+
+BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA
+ SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" EON
+ SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" EON
+ SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" EON
+ SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" EON
+ SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" XXX
+ SG_ SET_TO_X55_2 : 47|8@0+ (1,0) [0|255] "" EON
+ SG_ LONG_COUNTER : 55|8@0+ (1,0) [0|255] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
+
+ BO_ 662 SCM_BUTTONS: 4 SCM
+ SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON
+ SG_ CRUISE_SETTING : 3|2@0+ (1,0) [0|3] "" EON
+ SG_ COUNTER : 29|2@0+ (1,0) [0|3] "" EON
+ SG_ CHECKSUM : 27|4@0+ (1,0) [0|15] "" EON
+
+BO_ 773 SEATBELT_STATUS: 7 BDY
+ SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" EON
+ SG_ SEATBELT_PASS_UNLATCHED : 10|1@0+ (1,0) [0|1] "" EON
+ SG_ SEATBELT_PASS_LATCHED : 11|1@0+ (1,0) [0|1] "" EON
+ SG_ SEATBELT_DRIVER_UNLATCHED : 12|1@0+ (1,0) [0|1] "" EON
+ SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" EON
+ SG_ PASS_AIRBAG_OFF : 14|1@0+ (1,0) [0|1] "" EON
+ SG_ PASS_AIRBAG_ON : 15|1@0+ (1,0) [0|1] "" EON
+ SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
+ SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON
+
+BO_ 777 CAR_SPEED: 8 PCM
+ SG_ ROUGH_CAR_SPEED : 23|8@0+ (1,0) [0|255] "mph" XXX
+ SG_ CAR_SPEED : 7|16@0+ (0.01,0) [0|65535] "kph" XXX
+ SG_ ROUGH_CAR_SPEED_3 : 39|16@0+ (0.01,0) [0|65535] "kph" XXX
+ SG_ ROUGH_CAR_SPEED_2 : 31|8@0+ (1,0) [0|255] "mph" XXX
+ SG_ LOCK_STATUS : 55|2@0+ (1,0) [0|255] "" XXX
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
+
+BO_ 780 ACC_HUD: 8 ADAS
+ SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "kph" BDY
+ SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY
+ SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY
+ SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY
+ SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY
+ SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY
+ SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY
+ SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY
+ SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY
+ SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY
+ SG_ ZEROS_BOH : 7|24@0+ (0.002759506,0) [0|100] "m/s" BDY
+ SG_ FCM_OFF : 35|1@0+ (1,0) [0|1] "" BDY
+ SG_ SET_TO_1 : 36|1@0+ (1,0) [0|1] "" XXX
+ SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY
+ SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY
+ SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY
+ SG_ ACC_ON : 52|1@0+ (1,0) [0|1] "" XXX
+ SG_ BOH_6 : 51|4@0+ (1,0) [0|15] "" XXX
+ SG_ SET_TO_X1 : 55|1@0+ (1,0) [0|1] "" XXX
+ SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" XXX
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
+
+BO_ 804 CRUISE: 8 PCM
+ SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" EON
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
+
+BO_ 806 SCM_FEEDBACK: 8 SCM
+ SG_ DRIVERS_DOOR_OPEN : 17|1@0+ (1,0) [0|1] "" XXX
+ SG_ MAIN_ON : 28|1@0+ (1,0) [0|1] "" EON
+ SG_ RIGHT_BLINKER : 27|1@0+ (1,0) [0|1] "" EON
+ SG_ LEFT_BLINKER : 26|1@0+ (1,0) [0|1] "" EON
+ SG_ CMBS_STATES : 22|2@0+ (1,0) [0|3] "" EON
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
+
+BO_ 829 LKAS_HUD: 5 ADAS
+ SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
+ SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY
+ SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
+ SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
+ SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
+ SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
+ SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
+ SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
+ SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
+ SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
+ SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
+ SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
+ SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
+ SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
+ SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
+ SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
+ SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY
+ SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY
+ SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY
+
+BO_ 862 CAMERA_MESSAGES: 8 CAM
+ SG_ ZEROS_BOH : 7|50@0+ (1,0) [0|127] "" BDY
+ SG_ AUTO_HIGHBEAMS_ACTIVE : 53|1@0+ (1,0) [0|1] "" XXX
+ SG_ HIGHBEAMS_ON : 52|1@0+ (1,0) [0|1] "" XXX
+ SG_ ZEROS_BOH_2 : 51|4@0+ (1,0) [0|15] "" XXX
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
+
+BO_ 884 STALK_STATUS: 8 XXX
+ SG_ AUTO_HEADLIGHTS : 46|1@0+ (1,0) [0|1] "" EON
+ SG_ HIGH_BEAM_HOLD : 47|1@0+ (1,0) [0|1] "" EON
+ SG_ HIGH_BEAM_FLASH : 45|1@0+ (1,0) [0|1] "" EON
+ SG_ HEADLIGHTS_ON : 54|1@0+ (1,0) [0|1] "" EON
+ SG_ WIPER_SWITCH : 53|2@0+ (1,0) [0|3] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
+
+BO_ 891 STALK_STATUS_2: 8 XXX
+ SG_ WIPERS : 17|2@0+ (1,0) [0|3] "" EON
+ SG_ LOW_BEAMS : 35|1@0+ (1,0) [0|1] "" XXX
+ SG_ HIGH_BEAMS : 34|1@0+ (1,0) [0|1] "" XXX
+ SG_ PARK_LIGHTS : 36|1@0+ (1,0) [0|1] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
+
+CM_ SG_ 479 AEB_STATUS "set for the duration of AEB event";
+CM_ SG_ 479 AEB_BRAKING "set when braking is commanded during AEB event";
+CM_ SG_ 479 AEB_PREPARE "set 1s before AEB";
+CM_ SG_ 576 LINE_DISTANCE_VISIBLE "Length of line visible, undecoded";
+CM_ SG_ 577 LINE_FAR_EDGE_POSITION "Appears to be a measure of line thickness, indicates location of the portion of the line furthest from the car, undecoded";
+CM_ SG_ 577 LINE_PARAMETER "Unclear if this is low quality line curvature rate or if this is something else, but it is correlated with line curvature, undecoded";
+CM_ SG_ 577 LINE_DASHED "1 = line is dashed";
+CM_ SG_ 577 LINE_SOLID "1 = line is solid";
+VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
+
+CM_ "acura_rdx_2020_can.dbc starts here"
+
+
+BO_ 304 GAS_PEDAL_2: 8 PCM
+ SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" EON
+ SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" EON
+ SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
+
+BO_ 419 GEARBOX: 8 PCM
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
+ SG_ GEAR_SHIFTER : 29|6@0+ (1,0) [0|63] "" EON
+ SG_ GEAR : 7|8@0+ (1,0) [0|255] "" EON
+
+BO_ 432 STANDSTILL: 7 VSA
+ SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON
+ SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON
+ SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
+ SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON
+
+BO_ 446 BRAKE_MODULE: 3 VSA
+ SG_ BRAKE_PRESSED : 4|1@0+ (1,0) [0|1] "" XXX
+ SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" XXX
+ SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" XXX
+
+BO_ 927 RADAR_HUD: 8 RADAR
+ SG_ ZEROS_BOH : 7|10@0+ (1,0) [0|127] "" BDY
+ SG_ CMBS_OFF : 12|1@0+ (1,0) [0|1] "" BDY
+ SG_ RESUME_INSTRUCTION : 21|1@0+ (1,0) [0|1] "" XXX
+ SG_ SET_TO_1 : 13|1@0+ (1,0) [0|1] "" BDY
+ SG_ ZEROS_BOH2 : 11|4@0+ (1,0) [0|1] "" XXX
+ SG_ APPLY_BRAKES_FOR_CANC : 23|1@0+ (1,0) [0|1] "" XXX
+ SG_ ACC_ALERTS : 20|5@0+ (1,0) [0|1] "" BDY
+ SG_ SET_TO_0 : 22|1@0+ (1,0) [0|1] "" XXX
+ SG_ LEAD_DISTANCE : 39|8@0+ (1,0) [0|255] "" XXX
+ SG_ BOH : 40|1@0+ (1,0) [0|1] "" XXX
+ SG_ BOH_2 : 30|1@0+ (1,0) [0|1] "" XXX
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
+
+BO_ 1302 ODOMETER: 8 XXX
+ SG_ ODOMETER : 7|24@0+ (1,0) [0|16777215] "km" EON
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
+
+VAL_ 419 GEAR_SHIFTER 32 "D" 8 "R" 4 "P" ;
+VAL_ 545 ECON_ON_2 0 "off" 3 "on" ;
+VAL_ 662 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;
+VAL_ 662 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ;
+VAL_ 806 CMBS_BUTTON 3 "pressed" 0 "released" ;
+VAL_ 891 WIPERS 4 "High" 2 "Low" 0 "Off" ;
+VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
+
+CM_ "CHFFR_METRIC 330 STEER_ANGLE STEER_ANGLE 0.36 180; CHFFR_METRIC 380 ENGINE_RPM ENGINE_RPM 1 0; CHFFR_METRIC 804 ENGINE_TEMPERATURE ENGINE_TEMPERATURE 1 0";
diff --git a/opendbc/can/common_pyx_setup.py b/opendbc/can/common_pyx_setup.py
index 04f95359a..a72998425 100644
--- a/opendbc/can/common_pyx_setup.py
+++ b/opendbc/can/common_pyx_setup.py
@@ -34,7 +34,7 @@ class BuildExtWithoutPlatformSuffix(build_ext):
return get_ext_filename_without_platform_suffix(filename)
-extra_compile_args = ["-std=c++14", "-Wno-nullability-completeness"]
+extra_compile_args = ["-std=c++1z", "-Wno-nullability-completeness"]
ARCH = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip() # pylint: disable=unexpected-keyword-arg
if ARCH == "aarch64":
extra_compile_args += ["-Wno-deprecated-register"]
diff --git a/opendbc/honda_civic_hatchback_ex_2017_can_generated.dbc b/opendbc/honda_civic_hatchback_ex_2017_can_generated.dbc
index dcdaec6c8..d9c69c6b8 100644
--- a/opendbc/honda_civic_hatchback_ex_2017_can_generated.dbc
+++ b/opendbc/honda_civic_hatchback_ex_2017_can_generated.dbc
@@ -388,7 +388,7 @@ BO_ 304 GAS_PEDAL_2: 8 PCM
SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
-
+
BO_ 401 GEARBOX: 8 PCM
SG_ GEAR_SHIFTER : 5|6@0+ (1,0) [0|63] "" EON
SG_ BOH : 45|6@0+ (1,0) [0|63] "" XXX
@@ -405,6 +405,11 @@ BO_ 432 STANDSTILL: 7 VSA
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON
+BO_ 506 LEGACY_BRAKE_COMMAND: 8 ADAS
+ SG_ CHIME : 40|8@1+ (1,0) [0|255] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
+
BO_ 892 CRUISE_PARAMS: 8 PCM
SG_ CRUISE_SPEED_OFFSET : 31|8@0- (0.1,0) [-128|127] "kph" EON
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
diff --git a/opendbc/honda_civic_sedan_16_diesel_2019_can_generated.dbc b/opendbc/honda_civic_sedan_16_diesel_2019_can_generated.dbc
index a96ad676c..885de7131 100644
--- a/opendbc/honda_civic_sedan_16_diesel_2019_can_generated.dbc
+++ b/opendbc/honda_civic_sedan_16_diesel_2019_can_generated.dbc
@@ -400,6 +400,11 @@ BO_ 432 STANDSTILL: 7 VSA
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON
+BO_ 506 LEGACY_BRAKE_COMMAND: 8 ADAS
+ SG_ CHIME : 40|8@1+ (1,0) [0|255] "" XXX
+ SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
+ SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
+
BO_ 892 CRUISE_PARAMS: 8 PCM
SG_ CRUISE_SPEED_OFFSET : 31|8@0- (0.1,0) [-128|127] "kph" EON
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
diff --git a/opendbc/toyota_nodsu_pt_generated.dbc b/opendbc/toyota_nodsu_pt_generated.dbc
index ce38bf50a..e09310e4b 100644
--- a/opendbc/toyota_nodsu_pt_generated.dbc
+++ b/opendbc/toyota_nodsu_pt_generated.dbc
@@ -424,6 +424,14 @@ BO_ 956 GEAR_PACKET: 8 XXX
SG_ GEAR : 13|6@0+ (1,0) [0|63] "" XXX
SG_ ECON_ON : 40|1@0+ (1,0) [0|1] "" XXX
+BO_ 1653 Date_Time: 8 XXX
+ SG_ Year : 23|8@0+ (1,0) [0|255] "" XXX
+ SG_ Month : 31|8@0+ (1,0) [0|255] "" XXX
+ SG_ Day : 39|8@0+ (1,0) [0|255] "" XXX
+ SG_ Hour : 47|8@0+ (1,0) [0|255] "" XXX
+ SG_ Minute : 55|8@0+ (1,0) [0|255] "" XXX
+ SG_ Second : 63|8@0+ (1,0) [0|255] "" XXX
+
CM_ SG_ 548 BRAKE_PRESSURE "seems prop to pedal force";
CM_ SG_ 548 BRAKE_POSITION "seems proportional to pedal displacement, unclear the max value of 0x1c8";
CM_ SG_ 610 TYPE "seems 1 on Corolla, 0 on all others";
diff --git a/phonelibs/snpe/aarch64-android-clang6.0/libPlatformValidatorShared.so b/phonelibs/snpe/aarch64-android-clang6.0/libPlatformValidatorShared.so
new file mode 100644
index 000000000..5df5b07b1
Binary files /dev/null and b/phonelibs/snpe/aarch64-android-clang6.0/libPlatformValidatorShared.so differ
diff --git a/phonelibs/snpe/aarch64-android-clang6.0/libSNPE.so b/phonelibs/snpe/aarch64-android-clang6.0/libSNPE.so
index f8338a6e3..6ef777e15 100644
Binary files a/phonelibs/snpe/aarch64-android-clang6.0/libSNPE.so and b/phonelibs/snpe/aarch64-android-clang6.0/libSNPE.so differ
diff --git a/phonelibs/snpe/aarch64-android-clang6.0/libSNPE_G.so b/phonelibs/snpe/aarch64-android-clang6.0/libSNPE_G.so
new file mode 100644
index 000000000..565c80bb6
Binary files /dev/null and b/phonelibs/snpe/aarch64-android-clang6.0/libSNPE_G.so differ
diff --git a/phonelibs/snpe/aarch64-android-clang6.0/libcalculator.so b/phonelibs/snpe/aarch64-android-clang6.0/libcalculator.so
new file mode 100644
index 000000000..3aa1ec3ac
Binary files /dev/null and b/phonelibs/snpe/aarch64-android-clang6.0/libcalculator.so differ
diff --git a/phonelibs/snpe/aarch64-android-clang6.0/libcalculator_domains.so b/phonelibs/snpe/aarch64-android-clang6.0/libcalculator_domains.so
new file mode 100644
index 000000000..bef3fc201
Binary files /dev/null and b/phonelibs/snpe/aarch64-android-clang6.0/libcalculator_domains.so differ
diff --git a/phonelibs/snpe/aarch64-android-clang6.0/libhta.so b/phonelibs/snpe/aarch64-android-clang6.0/libhta.so
new file mode 100644
index 000000000..bfd3554cf
Binary files /dev/null and b/phonelibs/snpe/aarch64-android-clang6.0/libhta.so differ
diff --git a/phonelibs/snpe/aarch64-android-clang6.0/libsnpe_adsp.so b/phonelibs/snpe/aarch64-android-clang6.0/libsnpe_adsp.so
index 98b8c2d8a..8a6b4e3fc 100644
Binary files a/phonelibs/snpe/aarch64-android-clang6.0/libsnpe_adsp.so and b/phonelibs/snpe/aarch64-android-clang6.0/libsnpe_adsp.so differ
diff --git a/phonelibs/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains.so b/phonelibs/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains.so
new file mode 100644
index 000000000..0663d25e3
Binary files /dev/null and b/phonelibs/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains.so differ
diff --git a/phonelibs/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains_system.so b/phonelibs/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains_system.so
new file mode 100644
index 000000000..33d354ff7
Binary files /dev/null and b/phonelibs/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains_system.so differ
diff --git a/phonelibs/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains_v2.so b/phonelibs/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains_v2.so
new file mode 100644
index 000000000..5a6334459
Binary files /dev/null and b/phonelibs/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains_v2.so differ
diff --git a/phonelibs/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains_v2_system.so b/phonelibs/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains_v2_system.so
new file mode 100644
index 000000000..2d74ae0f0
Binary files /dev/null and b/phonelibs/snpe/aarch64-android-clang6.0/libsnpe_dsp_domains_v2_system.so differ
diff --git a/phonelibs/snpe/aarch64-android-clang6.0/libsnpe_dsp_skel.so b/phonelibs/snpe/aarch64-android-clang6.0/libsnpe_dsp_skel.so
deleted file mode 100644
index eecf45749..000000000
Binary files a/phonelibs/snpe/aarch64-android-clang6.0/libsnpe_dsp_skel.so and /dev/null differ
diff --git a/phonelibs/snpe/aarch64-android-clang6.0/libsymphony-cpu.so b/phonelibs/snpe/aarch64-android-clang6.0/libsymphony-cpu.so
old mode 100755
new mode 100644
diff --git a/phonelibs/snpe/aarch64-linux-gcc4.9/libPlatformValidatorShared.so b/phonelibs/snpe/aarch64-linux-gcc4.9/libPlatformValidatorShared.so
new file mode 100644
index 000000000..32f8e2f60
Binary files /dev/null and b/phonelibs/snpe/aarch64-linux-gcc4.9/libPlatformValidatorShared.so differ
diff --git a/phonelibs/snpe/aarch64-linux-gcc4.9/libSNPE.so b/phonelibs/snpe/aarch64-linux-gcc4.9/libSNPE.so
index 45cf75d44..6f497cfa0 100644
Binary files a/phonelibs/snpe/aarch64-linux-gcc4.9/libSNPE.so and b/phonelibs/snpe/aarch64-linux-gcc4.9/libSNPE.so differ
diff --git a/phonelibs/snpe/aarch64-linux-gcc4.9/libcalculator.so b/phonelibs/snpe/aarch64-linux-gcc4.9/libcalculator.so
index 9452b0e4a..dd3bfe5af 100644
Binary files a/phonelibs/snpe/aarch64-linux-gcc4.9/libcalculator.so and b/phonelibs/snpe/aarch64-linux-gcc4.9/libcalculator.so differ
diff --git a/phonelibs/snpe/aarch64-linux-gcc4.9/libcalculator_domains.so b/phonelibs/snpe/aarch64-linux-gcc4.9/libcalculator_domains.so
index eb3d336ea..05cf724b7 100644
Binary files a/phonelibs/snpe/aarch64-linux-gcc4.9/libcalculator_domains.so and b/phonelibs/snpe/aarch64-linux-gcc4.9/libcalculator_domains.so differ
diff --git a/phonelibs/snpe/aarch64-linux-gcc4.9/libsnpe_adsp.so b/phonelibs/snpe/aarch64-linux-gcc4.9/libsnpe_adsp.so
index 61a910ff5..11db2cdf6 100644
Binary files a/phonelibs/snpe/aarch64-linux-gcc4.9/libsnpe_adsp.so and b/phonelibs/snpe/aarch64-linux-gcc4.9/libsnpe_adsp.so differ
diff --git a/phonelibs/snpe/aarch64-linux-gcc4.9/libsnpe_dsp_domains_v2.so b/phonelibs/snpe/aarch64-linux-gcc4.9/libsnpe_dsp_domains_v2.so
index c12328c7d..cc8a8dc2a 100644
Binary files a/phonelibs/snpe/aarch64-linux-gcc4.9/libsnpe_dsp_domains_v2.so and b/phonelibs/snpe/aarch64-linux-gcc4.9/libsnpe_dsp_domains_v2.so differ
diff --git a/phonelibs/snpe/aarch64-linux-gcc4.9/libsymphony-cpu.so b/phonelibs/snpe/aarch64-linux-gcc4.9/libsymphony-cpu.so
old mode 100755
new mode 100644
diff --git a/phonelibs/snpe/dsp/libcalculator_domains_skel.so b/phonelibs/snpe/dsp/libcalculator_domains_skel.so
new file mode 100644
index 000000000..cb8897f23
Binary files /dev/null and b/phonelibs/snpe/dsp/libcalculator_domains_skel.so differ
diff --git a/phonelibs/snpe/dsp/libcalculator_skel.so b/phonelibs/snpe/dsp/libcalculator_skel.so
new file mode 100644
index 000000000..45515ea4f
Binary files /dev/null and b/phonelibs/snpe/dsp/libcalculator_skel.so differ
diff --git a/phonelibs/snpe/dsp/libsnpe_dsp_domains_skel.so b/phonelibs/snpe/dsp/libsnpe_dsp_domains_skel.so
new file mode 100644
index 000000000..d4e341262
Binary files /dev/null and b/phonelibs/snpe/dsp/libsnpe_dsp_domains_skel.so differ
diff --git a/phonelibs/snpe/dsp/libsnpe_dsp_skel.so b/phonelibs/snpe/dsp/libsnpe_dsp_skel.so
new file mode 100644
index 000000000..cb37356a9
Binary files /dev/null and b/phonelibs/snpe/dsp/libsnpe_dsp_skel.so differ
diff --git a/phonelibs/snpe/dsp/libsnpe_dsp_v65_domains_v2_skel.so b/phonelibs/snpe/dsp/libsnpe_dsp_v65_domains_v2_skel.so
new file mode 100644
index 000000000..97a1499a0
Binary files /dev/null and b/phonelibs/snpe/dsp/libsnpe_dsp_v65_domains_v2_skel.so differ
diff --git a/phonelibs/snpe/dsp/libsnpe_dsp_v66_domains_v2_skel.so b/phonelibs/snpe/dsp/libsnpe_dsp_v66_domains_v2_skel.so
new file mode 100644
index 000000000..008e9e978
Binary files /dev/null and b/phonelibs/snpe/dsp/libsnpe_dsp_v66_domains_v2_skel.so differ
diff --git a/phonelibs/snpe/include/DiagLog/IDiagLog.hpp b/phonelibs/snpe/include/DiagLog/IDiagLog.hpp
index af1ef8917..018b56725 100644
--- a/phonelibs/snpe/include/DiagLog/IDiagLog.hpp
+++ b/phonelibs/snpe/include/DiagLog/IDiagLog.hpp
@@ -1,6 +1,6 @@
//=============================================================================
//
-// Copyright (c) 2015 Qualcomm Technologies, Inc.
+// Copyright (c) 2015, 2020 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
@@ -8,14 +8,11 @@
#ifndef __IDIAGLOG_HPP_
#define __IDIAGLOG_HPP_
-#ifndef ZDL_LOGGING_EXPORT
-#define ZDL_LOGGING_EXPORT __attribute__((visibility("default")))
-#endif
-
#include
#include "DiagLog/Options.hpp"
#include "DlSystem/String.hpp"
+#include "DlSystem/ZdlExportDefine.hpp"
namespace zdl
{
@@ -26,10 +23,10 @@ namespace DiagLog
@{ */
/// @brief .
-///
+///
/// Interface for controlling logging for zdl components.
-class ZDL_LOGGING_EXPORT IDiagLog
+class ZDL_EXPORT IDiagLog
{
public:
@@ -48,7 +45,7 @@ public:
///
/// @return Diag log options object.
virtual Options getOptions() = 0;
-
+
/// @brief .
///
/// Allows for setting the log mask once diag logging has started
diff --git a/phonelibs/snpe/include/DiagLog/Options.hpp b/phonelibs/snpe/include/DiagLog/Options.hpp
index ea247e953..798fa3f12 100644
--- a/phonelibs/snpe/include/DiagLog/Options.hpp
+++ b/phonelibs/snpe/include/DiagLog/Options.hpp
@@ -1,6 +1,6 @@
//=============================================================================
//
-// Copyright (c) 2015 Qualcomm Technologies, Inc.
+// Copyright (c) 2015, 2020 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
@@ -8,12 +8,8 @@
#ifndef __DIAGLOG_OPTIONS_HPP_
#define __DIAGLOG_OPTIONS_HPP_
-#ifndef ZDL_LOGGING_EXPORT
-#define ZDL_LOGGING_EXPORT __attribute__((visibility("default")))
-#endif
-
#include
-#include
+#include "DlSystem/ZdlExportDefine.hpp"
namespace zdl
{
@@ -25,7 +21,7 @@ namespace DiagLog
/// @brief .
///
/// Options for setting up diagnostic logging for zdl components.
-class ZDL_LOGGING_EXPORT Options
+class ZDL_EXPORT Options
{
public:
Options() :
@@ -40,12 +36,12 @@ public:
}
/// @brief .
- ///
+ ///
/// Enables diag logging only on the specified area mask (DNN_RUNTIME=ON | OFF)
std::string DiagLogMask;
/// @brief .
- ///
+ ///
/// The path to the directory where log files will be written.
/// The path may be relative or absolute. Relative paths are interpreted
/// from the current working directory.
@@ -53,15 +49,15 @@ public:
std::string LogFileDirectory;
/// @brief .
- ///
+ ///
//// The name used for log files. If this value is empty then BaseName will be
/// used as the default file name.
/// Default value is "DiagLog"
std::string LogFileName;
/// @brief .
- ///
- /// The maximum number of log files to create. If set to 0 no log rotation
+ ///
+ /// The maximum number of log files to create. If set to 0 no log rotation
/// will be used and the log file name specified will be used each time, overwriting
/// any existing log file that may exist.
/// Default value is 20
diff --git a/phonelibs/snpe/include/DlContainer/IDlContainer.hpp b/phonelibs/snpe/include/DlContainer/IDlContainer.hpp
index f2022ca9f..4e29b39bb 100644
--- a/phonelibs/snpe/include/DlContainer/IDlContainer.hpp
+++ b/phonelibs/snpe/include/DlContainer/IDlContainer.hpp
@@ -1,6 +1,6 @@
//=============================================================================
//
-// Copyright (c) 2015,2019 Qualcomm Technologies, Inc.
+// Copyright (c) 2015-2020 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
@@ -14,7 +14,6 @@
#include
#include
#include
-#include
#include "DlSystem/ZdlExportDefine.hpp"
#include "DlSystem/String.hpp"
@@ -76,7 +75,7 @@ public:
*
* @return A pointer to the initialized container
*/
- ZDL_EXPORT static std::unique_ptr
+ static std::unique_ptr
open(const std::string &filename) noexcept;
/**
@@ -86,7 +85,7 @@ public:
*
* @return A pointer to the initialized container
*/
- ZDL_EXPORT static std::unique_ptr
+ static std::unique_ptr
open(const zdl::DlSystem::String &filename) noexcept;
/**
@@ -97,7 +96,7 @@ public:
*
* @return A pointer to the initialized container
*/
- ZDL_EXPORT static std::unique_ptr
+ static std::unique_ptr
open(const std::vector &buffer) noexcept;
/**
@@ -110,7 +109,7 @@ public:
*
* @return A pointer to the initialized container
*/
- ZDL_EXPORT static std::unique_ptr
+ static std::unique_ptr
open(const uint8_t* buffer, const size_t size) noexcept;
diff --git a/phonelibs/snpe/include/DlSystem/DlEnums.hpp b/phonelibs/snpe/include/DlSystem/DlEnums.hpp
index 5b8b6b35f..144706355 100644
--- a/phonelibs/snpe/include/DlSystem/DlEnums.hpp
+++ b/phonelibs/snpe/include/DlSystem/DlEnums.hpp
@@ -1,6 +1,6 @@
//==============================================================================
//
-// Copyright (c) 2014-2019 Qualcomm Technologies, Inc.
+// Copyright (c) 2014-2020 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
@@ -128,9 +128,13 @@ enum class ProfilingLevel_t
BASIC = 1,
/// Detailed profiling
- /// Collects more runtime stats in the DiagLog
+ /// Collects more runtime stats in the DiagLog, including per-layer statistics
/// Performance may be impacted
- DETAILED = 2
+ DETAILED = 2,
+
+ /// Moderate profiling
+ /// Collects more runtime stats in the DiagLog, no per-layer statistics
+ MODERATE = 3
};
/**
diff --git a/phonelibs/snpe/include/DlSystem/DlError.hpp b/phonelibs/snpe/include/DlSystem/DlError.hpp
index a8b0b4ea7..f0a66e8e4 100644
--- a/phonelibs/snpe/include/DlSystem/DlError.hpp
+++ b/phonelibs/snpe/include/DlSystem/DlError.hpp
@@ -1,6 +1,6 @@
//==============================================================================
//
-// Copyright (c) 2016-2019 Qualcomm Technologies, Inc.
+// Copyright (c) 2016-2020 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
@@ -79,6 +79,7 @@ enum class ZDL_EXPORT ErrorCode : uint32_t {
SNPE_DLCONTAINER_BAD_DNN_FORMAT_VERSION = 312,
SNPE_DLCONTAINER_UNKNOWN_AXIS_ANNOTATION = 313,
SNPE_DLCONTAINER_UNKNOWN_SHUFFLE_TYPE = 314,
+ SNPE_DLCONTAINER_TEMP_FILE_FAILURE = 315,
// Network errors
SNPE_NETWORK_EMPTY_NETWORK = 400,
@@ -191,7 +192,11 @@ enum class ZDL_EXPORT ErrorCode : uint32_t {
// DlCaching errors
SNPE_DLCACHING_INVALID_METADATA = 1500,
- SNPE_DLCACHING_INVALID_INITBLOB = 1501
+ SNPE_DLCACHING_INVALID_INITBLOB = 1501,
+
+ // Infrastructure Errors
+ SNPE_INFRA_CLUSTERMGR_INSTANCE_INVALID = 1600,
+ SNPE_INFRA_CLUSTERMGR_EXECUTE_SYNC_FAILED = 1601
};
diff --git a/phonelibs/snpe/include/DlSystem/DlOptional.hpp b/phonelibs/snpe/include/DlSystem/DlOptional.hpp
index 35416b426..4f83e6b4e 100644
--- a/phonelibs/snpe/include/DlSystem/DlOptional.hpp
+++ b/phonelibs/snpe/include/DlSystem/DlOptional.hpp
@@ -1,6 +1,6 @@
//==============================================================================
//
-// Copyright (c) 2016 Qualcomm Technologies, Inc.
+// Copyright (c) 2016, 2020 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
@@ -11,6 +11,7 @@
#include
#include
+#include
#include "DlSystem/ZdlExportDefine.hpp"
@@ -173,25 +174,25 @@ private:
template
typename std::enable_if::value, const Q&>::type GetReference() const noexcept {
- if (!isReference()) throw std::bad_exception();
+ if (!isReference()) std::terminate();
return *static_cast(m_StoragePtr);
}
template
typename std::enable_if::value, const Q&>::type GetReference() const noexcept {
- if (!isPointer()) throw std::bad_exception();
+ if (!isPointer()) std::terminate();
return static_cast(m_StoragePtr);
}
template
typename std::enable_if::value, Q&>::type GetReference() noexcept {
- if (!isReference()) throw std::bad_exception();
+ if (!isReference()) std::terminate();
return *m_StoragePtr;
}
template
typename std::enable_if::value, Q&>::type GetReference() noexcept {
- if (!isPointer()) throw std::bad_exception();
+ if (!isPointer()) std::terminate();
return m_StoragePtr;
}
diff --git a/phonelibs/snpe/include/DlSystem/ITensor.hpp b/phonelibs/snpe/include/DlSystem/ITensor.hpp
index ed6d5f107..2f006c857 100644
--- a/phonelibs/snpe/include/DlSystem/ITensor.hpp
+++ b/phonelibs/snpe/include/DlSystem/ITensor.hpp
@@ -1,6 +1,6 @@
//=============================================================================
//
-// Copyright (c) 2015-2018 Qualcomm Technologies, Inc.
+// Copyright (c) 2015-2020 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
@@ -14,7 +14,6 @@
#include "TensorShape.hpp"
#include "ZdlExportDefine.hpp"
#include
-#include
#include
#include
diff --git a/phonelibs/snpe/include/DlSystem/ITensorItrImpl.hpp b/phonelibs/snpe/include/DlSystem/ITensorItrImpl.hpp
index 7923c160b..069e7a1d6 100644
--- a/phonelibs/snpe/include/DlSystem/ITensorItrImpl.hpp
+++ b/phonelibs/snpe/include/DlSystem/ITensorItrImpl.hpp
@@ -1,6 +1,6 @@
//=============================================================================
//
-// Copyright (c) 2015 Qualcomm Technologies, Inc.
+// Copyright (c) 2015-2020 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
@@ -13,7 +13,6 @@
#include
#include
-#include
namespace DlSystem
{
diff --git a/phonelibs/snpe/include/DlSystem/IUserBuffer.hpp b/phonelibs/snpe/include/DlSystem/IUserBuffer.hpp
index aefa0eda9..5e5731dd8 100644
--- a/phonelibs/snpe/include/DlSystem/IUserBuffer.hpp
+++ b/phonelibs/snpe/include/DlSystem/IUserBuffer.hpp
@@ -1,6 +1,6 @@
//==============================================================================
//
-// Copyright (c) 2017-2019 Qualcomm Technologies, Inc.
+// Copyright (c) 2017-2020 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
@@ -160,6 +160,14 @@ public:
m_StepExactly0(stepFor0),
m_QuantizedStepSize(stepSize) {};
+ UserBufferEncodingTf8(const zdl::DlSystem::UserBufferEncoding &ubEncoding) : UserBufferEncodingUnsigned8Bit(ubEncoding.getElementType()){
+ const zdl::DlSystem::UserBufferEncodingTf8* ubEncodingTf8
+ = dynamic_cast (&ubEncoding);
+ if (ubEncodingTf8) {
+ m_StepExactly0 = ubEncodingTf8->getStepExactly0();
+ m_QuantizedStepSize = ubEncodingTf8->getQuantizedStepSize();
+ }
+ }
/**
* @brief Sets the step value that represents 0
@@ -246,6 +254,17 @@ public:
bitWidth(bWidth),
m_StepExactly0(stepFor0),
m_QuantizedStepSize(stepSize){};
+
+ UserBufferEncodingTfN(const zdl::DlSystem::UserBufferEncoding &ubEncoding) : UserBufferEncoding(ubEncoding.getElementType()){
+ const zdl::DlSystem::UserBufferEncodingTfN* ubEncodingTfN
+ = dynamic_cast (&ubEncoding);
+ if (ubEncodingTfN) {
+ m_StepExactly0 = ubEncodingTfN->getStepExactly0();
+ m_QuantizedStepSize = ubEncodingTfN->getQuantizedStepSize();
+ bitWidth = ubEncodingTfN->bitWidth;
+ }
+ }
+
size_t getElementSize() const noexcept override;
/**
* @brief Sets the step value that represents 0
@@ -283,7 +302,7 @@ public:
* @return Minimum representable floating point value
*/
float getMin() const {
- return m_QuantizedStepSize * (0 - (double)m_StepExactly0);
+ return static_cast(m_QuantizedStepSize * (0 - (double)m_StepExactly0));
}
/**
@@ -293,7 +312,7 @@ public:
* @return Maximum representable floating point value
*/
float getMax() const{
- return m_QuantizedStepSize * (pow(2,bitWidth)-1 - (double)m_StepExactly0);
+ return static_cast(m_QuantizedStepSize * (pow(2,bitWidth)-1 - (double)m_StepExactly0));
};
/**
diff --git a/phonelibs/snpe/include/DlSystem/String.hpp b/phonelibs/snpe/include/DlSystem/String.hpp
index 97b07726c..c1eba3bad 100644
--- a/phonelibs/snpe/include/DlSystem/String.hpp
+++ b/phonelibs/snpe/include/DlSystem/String.hpp
@@ -1,6 +1,6 @@
//=============================================================================
//
-// Copyright (c) 2017 Qualcomm Technologies, Inc.
+// Copyright (c) 2017, 2020 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
@@ -12,10 +12,7 @@
#include
#include
#include
-
-#ifndef ZDL_EXPORT
-#define ZDL_EXPORT __attribute__((visibility("default")))
-#endif
+#include "DlSystem/ZdlExportDefine.hpp"
namespace zdl
{
@@ -105,4 +102,3 @@ ZDL_EXPORT std::ostream& operator<<(std::ostream& os, const String& str) noexcep
/** @} */ /* end_addtogroup c_plus_plus_apis C++ */
#endif // PLATFORM_STANDARD_STRING_HPP
-
diff --git a/phonelibs/snpe/include/DlSystem/TensorShapeMap.hpp b/phonelibs/snpe/include/DlSystem/TensorShapeMap.hpp
index 00dc41a11..cef946e2e 100644
--- a/phonelibs/snpe/include/DlSystem/TensorShapeMap.hpp
+++ b/phonelibs/snpe/include/DlSystem/TensorShapeMap.hpp
@@ -1,6 +1,6 @@
//=============================================================================
//
-// Copyright (c) 2017 Qualcomm Technologies, Inc.
+// Copyright (c) 2017-2020 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
@@ -8,7 +8,6 @@
#include
#include
#include
-#include
#include "ZdlExportDefine.hpp"
#include "DlSystem/TensorShape.hpp"
#include "DlSystem/StringList.hpp"
diff --git a/phonelibs/snpe/include/DlSystem/ZdlExportDefine.hpp b/phonelibs/snpe/include/DlSystem/ZdlExportDefine.hpp
index dd0704dd8..92eb786d3 100644
--- a/phonelibs/snpe/include/DlSystem/ZdlExportDefine.hpp
+++ b/phonelibs/snpe/include/DlSystem/ZdlExportDefine.hpp
@@ -1,16 +1,13 @@
//=============================================================================
//
-// Copyright (c) 2015 Qualcomm Technologies, Inc.
+// Copyright (c) 2015, 2020 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
//=============================================================================
-#ifndef _ZDL_EXPORT_DEFINE_HPP_
-#define _ZDL_EXPORT_DEFINE_HPP_
+#pragma once
#ifndef ZDL_EXPORT
-#define ZDL_EXPORT __attribute__((visibility("default")))
-#endif
-
+#define ZDL_EXPORT
#endif
diff --git a/phonelibs/snpe/include/PlatformValidator/PlatformValidator.hpp b/phonelibs/snpe/include/PlatformValidator/PlatformValidator.hpp
new file mode 100644
index 000000000..e74278ead
--- /dev/null
+++ b/phonelibs/snpe/include/PlatformValidator/PlatformValidator.hpp
@@ -0,0 +1,93 @@
+// =============================================================================
+//
+// Copyright (c) 2018-2019 Qualcomm Technologies, Inc.
+// All Rights Reserved.
+// Confidential and Proprietary - Qualcomm Technologies, Inc.
+//
+// =============================================================================
+
+#ifndef SNPE_PLATFORMVALIDATOR_HPP
+#define SNPE_PLATFORMVALIDATOR_HPP
+
+#include "DlSystem/DlEnums.hpp"
+#include "DlSystem/DlMacros.hpp"
+SNPE_DISABLE_WARNINGS("-Wdelete-non-virtual-dtor","-Wdelete-non-virtual-dtor")
+#include
+#include
+SNPE_ENABLE_WARNINGS
+
+namespace zdl
+{
+ namespace SNPE
+ {
+ class PlatformValidator;
+
+ class IPlatformValidatorRuntime;
+ }
+}
+
+/** @addtogroup c_plus_plus_apis C++
+@{ */
+
+/**
+* The class for checking SNPE compatibility/capability of a device.
+*
+*/
+
+class zdl::SNPE::PlatformValidator
+{
+public:
+ /**
+ * @brief Default Constructor of the PlatformValidator Class
+ *
+ * @return A new instance of a PlatformValidator object
+ * that can be used to check the SNPE compatibility
+ * of a device
+ */
+ PlatformValidator();
+
+ ~PlatformValidator();
+
+ /**
+ * @brief Sets the runtime processor for compatibility check
+ *
+ * @return Void
+ */
+ void setRuntime(zdl::DlSystem::Runtime_t runtime);
+
+ /**
+ * @brief Checks if the Runtime prerequisites for SNPE are available.
+ *
+ * @return True if the Runtime prerequisites are available, else false.
+ */
+ bool isRuntimeAvailable();
+
+ /**
+ * @brief Returns the core version for the Runtime selected.
+ *
+ * @return String which contains the actual core version value
+ */
+ std::string getCoreVersion();
+
+ /**
+ * @brief Returns the library version for the Runtime selected.
+ *
+ * @return String which contains the actual lib version value
+ */
+ std::string getLibVersion();
+
+ /**
+ * @brief Runs a small program on the runtime and Checks if SNPE is supported for Runtime.
+ *
+ * @return If True, the device is ready for SNPE execution, else not.
+ */
+
+ bool runtimeCheck();
+
+private:
+ zdl::DlSystem::Runtime_t m_runtimeType;
+ std::unique_ptr m_platformValidatorRuntime;
+};
+/** @} */ /* end_addtogroup c_plus_plus_apis C++ */
+
+#endif //SNPE_PLATFORMVALIDATOR_HPP
diff --git a/phonelibs/snpe/include/SNPE/PSNPE.hpp b/phonelibs/snpe/include/SNPE/PSNPE.hpp
index 732b7aa4d..c0a6fb55d 100644
--- a/phonelibs/snpe/include/SNPE/PSNPE.hpp
+++ b/phonelibs/snpe/include/SNPE/PSNPE.hpp
@@ -1,6 +1,6 @@
// =============================================================================
//
-// Copyright (c) 2019 Qualcomm Technologies, Inc.
+// Copyright (c) 2019-2020 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
@@ -10,7 +10,6 @@
#define PSNPE_HPP
#include
-#include
#include
#include "SNPE/SNPE.hpp"
#include "DlSystem/UserBufferMap.hpp"
@@ -73,22 +72,40 @@ struct ZDL_EXPORT InputOutputAsyncCallbackParam
};
};
+/**
+ * @brief This callback is called when the output data is ready, only use for Output Async mode
+ */
using OutputAsyncCallbackFunc = std::function;
+/**
+ * @brief This callback is called when the output data is ready, only use for Output-Input Async mode
+ */
using InputOutputAsyncCallbackFunc = std::function;
+/**
+ * @brief This callback is called when the input data is ready,only use for Output-Input Async mode
+ */
+using InputOutputAsyncInputCallback = std::function(const std::vector &,
+ const zdl::DlSystem::StringList &)>;
/**
* @brief .
*
- * A structure BulkSNPE configuration
+ * A structure PSNPE configuration
+ *
*/
struct ZDL_EXPORT BuildConfig final
{
- BuildMode buildMode = BuildMode::SERIAL;
- zdl::DlContainer::IDlContainer* container;
- zdl::DlSystem::StringList outputBufferNames;
- RuntimeConfigList runtimeConfigList;
- OutputAsyncCallbackFunc outputCallback;
- InputOutputAsyncCallbackFunc inputOutputCallback;
- InputOutputTransmissionMode inputOutputTransmissionMode = InputOutputTransmissionMode::sync;
+ BuildMode buildMode = BuildMode::SERIAL; ///< Specify build in serial mode or parallel mode
+ zdl::DlContainer::IDlContainer* container;///< The opened container ptr
+ zdl::DlSystem::StringList outputBufferNames;///< Specify the output layer name
+ RuntimeConfigList runtimeConfigList;///< The runtime config list for PSNPE, @see RuntimeConfig
+ size_t inputThreadNumbers = 1;///< Specify the number of threads used in the execution phase to process input data, only used in inputOutputAsync mode
+ size_t outputThreadNumbers = 1;///< Specify the number of threads used in the execution phase to process output data, only used in inputOutputAsync and outputAsync mode
+ OutputAsyncCallbackFunc outputCallback;///< The callback to deal with output data ,only used in outputAsync mode
+ InputOutputAsyncCallbackFunc inputOutputCallback;///< The callback to deal with output data ,only used in inputOutputAsync mode
+ InputOutputAsyncInputCallback inputOutputInputCallback;///< The callback to deal with input data ,only used in inputOutputAsync mode
+ InputOutputTransmissionMode inputOutputTransmissionMode = InputOutputTransmissionMode::sync;///< Specify execution mode
+ zdl::DlSystem::ProfilingLevel_t profilingLevel = zdl::DlSystem::ProfilingLevel_t::OFF;///< Specify profiling level for Diaglog
+ uint64_t encode[2] = {0, 0};
+ bool enableInitCache = false;
};
/**
* @brief .
@@ -130,7 +147,8 @@ class ZDL_EXPORT PSNPE final
*
* @return True if executed successfully; flase, otherwise.
*/
- bool executeInputOutputAsync(const ApplicationBufferMap& inputMap, size_t dataIndex, bool isTF8buff) noexcept;
+ bool executeInputOutputAsync(const std::vector& inputMap, size_t dataIndex, bool isTF8buff) noexcept;
+ bool executeInputOutputAsync(const std::vector& inputMap, size_t dataIndex, bool isTF8buff,bool isTF8Outputbuff) noexcept;
/**
* @brief Returns the input layer names of the network.
*
@@ -161,6 +179,8 @@ class ZDL_EXPORT PSNPE final
*/
const zdl::DlSystem::TensorShape getBufferAttributesDims(const char *name) const noexcept;
+ zdl::DlSystem::Optional getInputOutputBufferAttributes(const char *name) const noexcept;
+
private:
PSNPE(const PSNPE&) = delete;
PSNPE& operator=(const PSNPE&) = delete;
diff --git a/phonelibs/snpe/include/SNPE/RuntimeConfigList.hpp b/phonelibs/snpe/include/SNPE/RuntimeConfigList.hpp
index ecd438b91..837dba092 100644
--- a/phonelibs/snpe/include/SNPE/RuntimeConfigList.hpp
+++ b/phonelibs/snpe/include/SNPE/RuntimeConfigList.hpp
@@ -1,6 +1,6 @@
//==============================================================================
//
-// Copyright (c) 2019 Qualcomm Technologies, Inc.
+// Copyright (c) 2019-2020 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
@@ -9,80 +9,77 @@
#define PSNPE_RUNTIMECONFIGLIST_HPP
#include
-#include "DlSystem/DlEnums.hpp"
#include "DlContainer/IDlContainer.hpp"
-#include "DlSystem/ZdlExportDefine.hpp"
+#include "DlSystem/DlEnums.hpp"
#include "DlSystem/RuntimeList.hpp"
-
+#include "DlSystem/TensorShapeMap.hpp"
+#include "DlSystem/ZdlExportDefine.hpp"
namespace zdl {
-namespace PSNPE
-{
+namespace PSNPE {
/** @addtogroup c_plus_plus_apis C++
@{ */
/**
- * @brief .
- *
- * The structure for configuring a BulkSNPE runtime
- *
- */
+ * @brief .
+ *
+ * The structure for configuring a BulkSNPE runtime
+ *
+ */
struct ZDL_EXPORT RuntimeConfig final {
- zdl::DlSystem::Runtime_t runtime;
- zdl::DlSystem::RuntimeList runtimeList;
- zdl::DlSystem::PerformanceProfile_t perfProfile;
- bool enableCPUFallback;
- RuntimeConfig(): runtime{zdl::DlSystem::Runtime_t::CPU_FLOAT32},
- perfProfile{zdl::DlSystem::PerformanceProfile_t::HIGH_PERFORMANCE},
- enableCPUFallback{false}
- {}
- RuntimeConfig(const RuntimeConfig& other)
- {
- runtime = other.runtime;
- runtimeList = other.runtimeList;
- perfProfile = other.perfProfile;
- enableCPUFallback = other.enableCPUFallback;
- }
+ zdl::DlSystem::Runtime_t runtime;
+ zdl::DlSystem::RuntimeList runtimeList;
+ zdl::DlSystem::PerformanceProfile_t perfProfile;
+ zdl::DlSystem::TensorShapeMap inputDimensionsMap;
+ bool enableCPUFallback;
+ RuntimeConfig()
+ : runtime{zdl::DlSystem::Runtime_t::CPU_FLOAT32},
+ perfProfile{zdl::DlSystem::PerformanceProfile_t::HIGH_PERFORMANCE},
+ enableCPUFallback{false} {}
+ RuntimeConfig(const RuntimeConfig& other) {
+ runtime = other.runtime;
+ runtimeList = other.runtimeList;
+ perfProfile = other.perfProfile;
+ enableCPUFallback = other.enableCPUFallback;
+ inputDimensionsMap = other.inputDimensionsMap;
+ }
- RuntimeConfig& operator=(const RuntimeConfig &other)
- {
- this->runtimeList = other.runtimeList;
- this->runtime = other.runtime;
- this->perfProfile = other.perfProfile;
- this->enableCPUFallback = other.enableCPUFallback;
- return *this;
- }
-
- ~RuntimeConfig() {}
+ RuntimeConfig& operator=(const RuntimeConfig& other) {
+ this->runtimeList = other.runtimeList;
+ this->runtime = other.runtime;
+ this->perfProfile = other.perfProfile;
+ this->enableCPUFallback = other.enableCPUFallback;
+ this->inputDimensionsMap = other.inputDimensionsMap;
+ return *this;
+ }
+ ~RuntimeConfig() {}
};
/**
-* @brief .
-*
-* The class for creating a RuntimeConfig container.
-*
-*/
-class ZDL_EXPORT RuntimeConfigList final
-{
-public:
- RuntimeConfigList();
- RuntimeConfigList(const size_t size);
- void push_back(const RuntimeConfig &runtimeConfig);
- RuntimeConfig& operator[](const size_t index);
- RuntimeConfigList& operator =(const RuntimeConfigList &other);
- size_t size() const noexcept;
- size_t capacity() const noexcept;
- void clear() noexcept;
- ~RuntimeConfigList() = default;
-
-private:
- void swap(const RuntimeConfigList &other);
- std::vector m_runtimeConfigs;
+ * @brief .
+ *
+ * The class for creating a RuntimeConfig container.
+ *
+ */
+class ZDL_EXPORT RuntimeConfigList final {
+ public:
+ RuntimeConfigList();
+ RuntimeConfigList(const size_t size);
+ void push_back(const RuntimeConfig& runtimeConfig);
+ RuntimeConfig& operator[](const size_t index);
+ RuntimeConfigList& operator=(const RuntimeConfigList& other);
+ size_t size() const noexcept;
+ size_t capacity() const noexcept;
+ void clear() noexcept;
+ ~RuntimeConfigList() = default;
+ private:
+ void swap(const RuntimeConfigList& other);
+ std::vector m_runtimeConfigs;
};
/** @} */ /* end_addtogroup c_plus_plus_apis C++ */
-} // namespace PSNPE
-} // namespace zdl
-#endif //PSNPE_RUNTIMECONFIGLIST_HPP
+} // namespace PSNPE
+} // namespace zdl
+#endif // PSNPE_RUNTIMECONFIGLIST_HPP
diff --git a/phonelibs/snpe/include/SNPE/SNPE.hpp b/phonelibs/snpe/include/SNPE/SNPE.hpp
index e0821b90b..239690ab2 100644
--- a/phonelibs/snpe/include/SNPE/SNPE.hpp
+++ b/phonelibs/snpe/include/SNPE/SNPE.hpp
@@ -1,6 +1,6 @@
//==============================================================================
//
-// Copyright (c) 2015-2017 Qualcomm Technologies, Inc.
+// Copyright (c) 2015-2020 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
@@ -9,9 +9,6 @@
#ifndef _SNPE_SNPE_HPP_
#define _SNPE_SNPE_HPP_
-#include