diff --git a/SConstruct b/SConstruct index ce497e2134..55ddc5c499 100644 --- a/SConstruct +++ b/SConstruct @@ -263,7 +263,6 @@ py_include = sysconfig.get_paths()['include'] envCython = env.Clone() envCython["CPPPATH"] += [py_include, np.get_include()] envCython["CCFLAGS"] += ["-Wno-#warnings", "-Wno-shadow", "-Wno-deprecated-declarations"] -envCython["CCFLAGS"].remove("-Werror") envCython["LIBS"] = [] if arch == "Darwin": diff --git a/cereal b/cereal index aed9fd278a..6f7102581f 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit aed9fd278a704816aba11f4473aafefc281ed2bc +Subproject commit 6f7102581f57eb5074b816cc2cfd984218916773 diff --git a/opendbc b/opendbc index 4231b0f12d..3ef35ed229 160000 --- a/opendbc +++ b/opendbc @@ -1 +1 @@ -Subproject commit 4231b0f12d8cf10d0554c4eb513ac984defc1f90 +Subproject commit 3ef35ed2298a3a9d199f9145409547710065884c diff --git a/poetry.lock b/poetry.lock index 388bb64b07..50f58d8a3f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:564e123680dd9b469261adde7d767810a310435c7530f2da593233312dc33dcf -size 763076 +oid sha256:06fc5a5853a507697a4be43250cdda358314e2002f2d7a79c9a1728a1cbc1a6e +size 678096 diff --git a/pyproject.toml b/pyproject.toml index 70f37fbe73..93e28e1a75 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ casadi = "==3.6.3" cffi = "^1.15.1" crcmod = "^1.7" cryptography = "^37.0.4" -Cython = "^3.0.0" +Cython = "^0.29.30" flake8 = "^4.0.1" Flask = "^2.1.2" future-fstrings = "^1.2.0" # for acados @@ -27,14 +27,14 @@ Jinja2 = "^3.1.2" json-rpc = "^1.13.0" libusb1 = "^3.0.0" nose = "^1.3.7" -numpy = "==1.24.2" +numpy = "^1.23.0" onnx = "^1.14.0" onnxruntime-gpu = { version = "^1.15.1", platform = "linux", markers = "platform_machine == 'x86_64'" } pillow = "^9.2.0" poetry = "==1.2.2" protobuf = "==3.20.3" psutil = "^5.9.1" -pycapnp = "^1.3.0" +pycapnp = "==1.1.0" pycryptodome = "^3.15.0" PyJWT = "^2.5.0" pyopencl = "^2022.2.4" diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index be3771d319..ce7d797443 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -89,9 +89,9 @@ def fingerprint(logcan, sendcan, num_pandas): cached_params = params.get("CarParamsCache") if cached_params is not None: - with car.CarParams.from_bytes(cached_params) as cached_params: - if cached_params.carName == "mock": - cached_params = None + cached_params = car.CarParams.from_bytes(cached_params) + if cached_params.carName == "mock": + cached_params = None if cached_params is not None and len(cached_params.carFw) > 0 and \ cached_params.carVin is not VIN_UNKNOWN and not disable_fw_cache: diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index aadd38cca8..38378757e8 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -206,8 +206,8 @@ class Controls: if REPLAY: controls_state = Params().get("ReplayControlsState") if controls_state is not None: - with log.ControlsState.from_bytes(controls_state) as controls_state: - self.v_cruise_helper.v_cruise_kph = controls_state.vCruise + controls_state = log.ControlsState.from_bytes(controls_state) + self.v_cruise_helper.v_cruise_kph = controls_state.vCruise if any(ps.controlsAllowed for ps in self.sm['pandaStates']): self.state = State.enabled diff --git a/selfdrive/controls/plannerd.py b/selfdrive/controls/plannerd.py index 7e61efcf45..2ae629a6c3 100755 --- a/selfdrive/controls/plannerd.py +++ b/selfdrive/controls/plannerd.py @@ -32,8 +32,7 @@ def plannerd_thread(sm=None, pm=None): cloudlog.info("plannerd is waiting for CarParams") params = Params() - with car.CarParams.from_bytes(params.get("CarParams", block=True)) as msg: - CP = msg + CP = car.CarParams.from_bytes(params.get("CarParams", block=True)) cloudlog.info("plannerd got CarParams: %s", CP.carName) debug_mode = bool(int(os.getenv("DEBUG", "0"))) diff --git a/selfdrive/controls/radard.py b/selfdrive/controls/radard.py index 7566e7f6de..521cea816f 100755 --- a/selfdrive/controls/radard.py +++ b/selfdrive/controls/radard.py @@ -185,8 +185,7 @@ def radard_thread(sm=None, pm=None, can_sock=None): # wait for stats about the car to come in from controls cloudlog.info("radard is waiting for CarParams") - with car.CarParams.from_bytes(Params().get("CarParams", block=True)) as msg: - CP = msg + CP = car.CarParams.from_bytes(Params().get("CarParams", block=True)) cloudlog.info("radard got CarParams") # import the radar from the fingerprint diff --git a/selfdrive/debug/dump.py b/selfdrive/debug/dump.py index 722cdc6406..fdb825eead 100755 --- a/selfdrive/debug/dump.py +++ b/selfdrive/debug/dump.py @@ -41,8 +41,7 @@ if __name__ == "__main__": polld = poller.poll(100) for sock in polld: msg = sock.receive() - with log.Event.from_bytes(msg) as log_evt: - evt = log_evt + evt = log.Event.from_bytes(msg) if not args.no_print: if args.pipe: diff --git a/selfdrive/debug/internal/measure_torque_time_to_max.py b/selfdrive/debug/internal/measure_torque_time_to_max.py index ef3152b50c..2cc68df438 100755 --- a/selfdrive/debug/internal/measure_torque_time_to_max.py +++ b/selfdrive/debug/internal/measure_torque_time_to_max.py @@ -34,8 +34,7 @@ if __name__ == "__main__": polld = poller.poll(1000) for sock in polld: msg = sock.receive() - with log.Event.from_bytes(msg) as log_evt: - evt = log_evt + evt = log.Event.from_bytes(msg) for item in evt.can: if item.address == 0xe4 and item.src == 128: diff --git a/selfdrive/locationd/calibrationd.py b/selfdrive/locationd/calibrationd.py index e990a46f12..c9d9340a2d 100755 --- a/selfdrive/locationd/calibrationd.py +++ b/selfdrive/locationd/calibrationd.py @@ -73,11 +73,11 @@ class Calibrator: if param_put and calibration_params: try: - with log.Event.from_bytes(calibration_params) as msg: - rpy_init = np.array(msg.liveCalibration.rpyCalib) - valid_blocks = msg.liveCalibration.validBlocks - wide_from_device_euler = np.array(msg.liveCalibration.wideFromDeviceEuler) - height = np.array(msg.liveCalibration.height) + msg = log.Event.from_bytes(calibration_params) + rpy_init = np.array(msg.liveCalibration.rpyCalib) + valid_blocks = msg.liveCalibration.validBlocks + wide_from_device_euler = np.array(msg.liveCalibration.wideFromDeviceEuler) + height = np.array(msg.liveCalibration.height) except Exception: cloudlog.exception("Error reading cached CalibrationParams") diff --git a/selfdrive/locationd/laikad.py b/selfdrive/locationd/laikad.py index 5d8641a91b..2e98fd7556 100755 --- a/selfdrive/locationd/laikad.py +++ b/selfdrive/locationd/laikad.py @@ -116,9 +116,9 @@ class Laikad: nav_dict = {} try: - with ephemeris_structs.EphemerisCache.from_bytes(cache_bytes) as ephem_cache: - glonass_navs = [GLONASSEphemeris(data_struct, file_name=EPHEMERIS_CACHE) for data_struct in ephem_cache.glonassEphemerides] - gps_navs = [GPSEphemeris(data_struct, file_name=EPHEMERIS_CACHE) for data_struct in ephem_cache.gpsEphemerides] + ephem_cache = ephemeris_structs.EphemerisCache.from_bytes(cache_bytes) + glonass_navs = [GLONASSEphemeris(data_struct, file_name=EPHEMERIS_CACHE) for data_struct in ephem_cache.glonassEphemerides] + gps_navs = [GPSEphemeris(data_struct, file_name=EPHEMERIS_CACHE) for data_struct in ephem_cache.gpsEphemerides] for e in sum([glonass_navs, gps_navs], []): if e.prn not in nav_dict: nav_dict[e.prn] = [] diff --git a/selfdrive/locationd/paramsd.py b/selfdrive/locationd/paramsd.py index 1826ea4563..1fd6fc6cee 100755 --- a/selfdrive/locationd/paramsd.py +++ b/selfdrive/locationd/paramsd.py @@ -129,8 +129,7 @@ def main(sm=None, pm=None): params_reader = Params() # wait for stats about the car to come in from controls cloudlog.info("paramsd is waiting for CarParams") - with car.CarParams.from_bytes(params_reader.get("CarParams", block=True)) as msg: - CP = msg + CP = car.CarParams.from_bytes(params_reader.get("CarParams", block=True)) cloudlog.info("paramsd got CarParams") min_sr, max_sr = 0.5 * CP.steerRatio, 2.0 * CP.steerRatio diff --git a/selfdrive/locationd/test/_test_locationd_lib.py b/selfdrive/locationd/test/_test_locationd_lib.py index 97207908e7..bec086a767 100755 --- a/selfdrive/locationd/test/_test_locationd_lib.py +++ b/selfdrive/locationd/test/_test_locationd_lib.py @@ -40,8 +40,7 @@ void localizer_handle_msg_bytes(Localizer_t localizer, const char *data, size_t def localizer_get_msg(self, t=0, inputsOK=True, sensorsOK=True, gpsOK=True, msgValid=True): self.lib.localizer_get_message_bytes(self.localizer, inputsOK, sensorsOK, gpsOK, msgValid, self.ffi.addressof(self.msg_buff, 0), self.buff_size) - with log.Event.from_bytes(self.ffi.buffer(self.msg_buff), nesting_limit=self.buff_size // 8) as log_evt: - return log_evt + return log.Event.from_bytes(self.ffi.buffer(self.msg_buff), nesting_limit=self.buff_size // 8) def test_liblocalizer(self): msg = messaging.new_message('liveCalibration') diff --git a/selfdrive/locationd/torqued.py b/selfdrive/locationd/torqued.py index 552e41985c..fcc068d34e 100755 --- a/selfdrive/locationd/torqued.py +++ b/selfdrive/locationd/torqued.py @@ -139,10 +139,8 @@ class TorqueEstimator: torque_cache = params.get("LiveTorqueParameters") if params_cache is not None and torque_cache is not None: try: - with log.Event.from_bytes(torque_cache).liveTorqueParameters as log_evt: - cache_ltp = log_evt - with car.CarParams.from_bytes(params_cache) as msg: - cache_CP = msg + cache_ltp = log.Event.from_bytes(torque_cache).liveTorqueParameters + cache_CP = car.CarParams.from_bytes(params_cache) if self.get_restore_key(cache_CP, cache_ltp.version) == self.get_restore_key(CP, VERSION): if cache_ltp.liveValid: initial_params = { @@ -264,8 +262,8 @@ def main(sm=None, pm=None): pm = messaging.PubMaster(['liveTorqueParameters']) params = Params() - with car.CarParams.from_bytes(params.get("CarParams", block=True)) as CP: - estimator = TorqueEstimator(CP) + CP = car.CarParams.from_bytes(params.get("CarParams", block=True)) + estimator = TorqueEstimator(CP) def cache_params(sig, frame): signal.signal(sig, signal.SIG_DFL)