From b0c3778aae6a6e75b6acba893fae816b0f1bc2f4 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 20 Jul 2023 21:56:57 -0700 Subject: [PATCH] agnos 8 (#28843) * agnos 8 * update to python 3.11.4 (#27452) * rebase * optional * lower cython * TEMP don't pull cl to use python3.11 * Revert "lower cython" This reverts commit c5132f8a2727c212bdfc01e77aa53e50a17ead9d. * fix cython * remove tensorrt * carla + opencv * macos * update timm and smp * pynvc * https * downgrade numpy * pin scipy --------- Co-authored-by: Maxime Desroches Co-authored-by: Yassine * revert that * fix linter --------- Co-authored-by: Maxime Desroches Co-authored-by: Yassine old-commit-hash: 1945c356c2c127cfe1f2d1930e33f2f3af7a1eb4 --- .python-version | 2 +- Dockerfile.openpilot_base | 2 +- SConstruct | 1 + cereal | 2 +- launch_env.sh | 2 +- mypy.ini | 2 +- opendbc | 2 +- poetry.lock | 4 +- pyproject.toml | 37 ++++++++-------- selfdrive/athena/athenad.py | 4 +- selfdrive/boardd/pandad.py | 2 +- selfdrive/car/car_helpers.py | 6 +-- selfdrive/car/docs_definitions.py | 2 +- selfdrive/controls/controlsd.py | 4 +- selfdrive/controls/plannerd.py | 3 +- selfdrive/controls/radard.py | 5 ++- selfdrive/debug/dump.py | 3 +- .../internal/measure_torque_time_to_max.py | 3 +- selfdrive/debug/run_process_on_route.py | 2 +- selfdrive/locationd/calibrationd.py | 10 ++--- selfdrive/locationd/laikad.py | 6 +-- selfdrive/locationd/paramsd.py | 3 +- .../locationd/test/_test_locationd_lib.py | 3 +- selfdrive/locationd/torqued.py | 9 ++-- selfdrive/test/process_replay/helpers.py | 4 +- system/hardware/tici/agnos.json | 44 +++++++++---------- system/sensord/rawgps/compare.py | 2 +- 27 files changed, 90 insertions(+), 79 deletions(-) diff --git a/.python-version b/.python-version index d20cc2bf02..0c7d5f5f5d 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.8.10 +3.11.4 diff --git a/Dockerfile.openpilot_base b/Dockerfile.openpilot_base index 4cd82259e2..9af628bd4c 100644 --- a/Dockerfile.openpilot_base +++ b/Dockerfile.openpilot_base @@ -13,7 +13,7 @@ ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 ENV POETRY_VIRTUALENVS_CREATE=false -ENV PYENV_VERSION=3.8.10 +ENV PYENV_VERSION=3.11.4 ENV PYENV_ROOT="/root/.pyenv" ENV PATH="$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH" diff --git a/SConstruct b/SConstruct index 55ddc5c499..ce497e2134 100644 --- a/SConstruct +++ b/SConstruct @@ -263,6 +263,7 @@ 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 6f7102581f..aed9fd278a 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit 6f7102581f57eb5074b816cc2cfd984218916773 +Subproject commit aed9fd278a704816aba11f4473aafefc281ed2bc diff --git a/launch_env.sh b/launch_env.sh index c1ecbe3b31..d07fbe33de 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 "$AGNOS_VERSION" ]; then - export AGNOS_VERSION="7.1" + export AGNOS_VERSION="8.2" fi if [ -z "$PASSIVE" ]; then diff --git a/mypy.ini b/mypy.ini index 9b6d00d2c4..74d0ac2175 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,5 +1,5 @@ [mypy] -python_version = 3.8 +python_version = 3.11 plugins = numpy.typing.mypy_plugin files = body, common, docs, scripts, selfdrive, site_scons, system, tools exclude = ^(cereal/)|(opendbc/)|(panda/)|(laika/)|(laika_repo/)|(rednose/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)|(xx/) diff --git a/opendbc b/opendbc index 3ef35ed229..4231b0f12d 160000 --- a/opendbc +++ b/opendbc @@ -1 +1 @@ -Subproject commit 3ef35ed2298a3a9d199f9145409547710065884c +Subproject commit 4231b0f12d8cf10d0554c4eb513ac984defc1f90 diff --git a/poetry.lock b/poetry.lock index 50f58d8a3f..33c6d7d5d4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:06fc5a5853a507697a4be43250cdda358314e2002f2d7a79c9a1728a1cbc1a6e -size 678096 +oid sha256:ed404767f4736f7d868e8f5790e411db0a29b6cd1117052642a7fa7079a0bfd1 +size 767135 diff --git a/pyproject.toml b/pyproject.toml index 93e28e1a75..f757918ec2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,13 +10,13 @@ documentation = "https://docs.comma.ai" [tool.poetry.dependencies] -python = "~3.8" +python = "~3.11" atomicwrites = "^1.4.0" casadi = "==3.6.3" cffi = "^1.15.1" crcmod = "^1.7" cryptography = "^37.0.4" -Cython = "^0.29.30" +Cython = "^3.0.0" 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.23.0" +numpy = "==1.23.0" # locked pending deprecation fixes in xx 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.1.0" +pycapnp = "^1.3.0" pycryptodome = "^3.15.0" PyJWT = "^2.5.0" pyopencl = "^2022.2.4" @@ -43,7 +43,7 @@ python-dateutil = "^2.8.2" PyYAML = "^6.0" pyzmq = "^23.2.0" requests = "^2.28.1" -scons = "^4.3.0" +scons = "^4.5.2" sentry-sdk = "^1.6.0" setproctitle = "^1.2.3" six = "^1.16.0" @@ -51,8 +51,8 @@ smbus2 = "^0.4.2" sounddevice = "^0.4.5" spidev = { version = "^3.6", platform = "linux" } spidev2 = { version = "^0.9.0", platform = "linux" } -sympy = "^1.10.1" -timezonefinder = "^6.0.1" +sympy = "^1.11.1" +timezonefinder = "^6.2.0" tqdm = "^4.64.0" urllib3 = "^1.26.10" utm = "^0.7.0" @@ -62,10 +62,10 @@ sconscontrib = {git = "https://github.com/SCons/scons-contrib.git"} [tool.poetry.group.dev.dependencies] -av = "^9.2.0" +av = "^10.0.0" azure-storage-blob = "~2.1" breathe = "^4.34.0" -carla = { version = "==0.9.13", platform = "linux", markers = "platform_machine == 'x86_64'" } +carla = { url = "https://github.com/commaai/carla/releases/download/3.11.4/carla-0.9.14-cp311-cp311-linux_x86_64.whl", platform = "linux", markers = "platform_machine == 'x86_64'" } control = "^0.9.2" coverage = "^6.4.1" dictdiffer = "^0.9.0" @@ -79,24 +79,23 @@ lxml = "^4.9.1" markdown-it-py = "^2.1.0" matplotlib = "^3.5.2" mpld3 = "^0.5.8" -mypy = "^0.961" +mypy = "^1.4.0" myst-parser = "^0.18.0" natsort = "^8.1.0" -numpy = "^1.23.0" -opencv-python-headless = { url = "https://github.com/commaai/opencv-python-builder/releases/download/4.5.5.64%2Bcu118/opencv_python_headless-4.5.5.64-cp38-cp38-manylinux_2_31_x86_64.whl", platform = "linux" } +opencv-python-headless = { url = "https://github.com/commaai/opencv-python-builder/releases/download/4.5.5.64%2Bcu118-cp311/opencv_python_headless-4.5.5.64-cp311-cp311-manylinux_2_31_x86_64.whl", platform = "linux" } pandas = "^1.4.3" parameterized = "^0.8.1" paramiko = "^2.11.0" pprofile = "^2.1.0" pre-commit = "^2.19.0" pycurl = "^7.45.1" -pygame = "^2.1.2" +pygame = "^2.4.0" pylint = "^2.17.4" pyprof2calltree = "^1.4.5" pytest = "^7.1.2" pytest-xdist = "^2.5.0" reverse_geocoder = "^1.5.1" -scipy = "^1.8.1" +scipy = "==1.9.3" # pinned until xx refs changes can be checked sphinx = "^5.0.2" sphinx-rtd-theme = "^1.0.0" sphinx-sitemap = "^2.2.0" @@ -118,7 +117,6 @@ optional = true aenum = "^3.1.11" aiohttp = "^3.8.1" albumentations = "^1.2.1" -apex = { url = "https://github.com/commaai/apex/releases/download/pytorch2.0.0%2Bcu11.8/apex-0.1-cp38-cp38-linux_x86_64.whl" } azure-cli-core = "^2.38.0" azure-common = "^1.1.28" azure-core = "^1.24.2" @@ -164,20 +162,21 @@ redis = "^4.3.4" s2sphere = "^0.2.5" scikit-image = "^0.19.3" scikit-learn = "^1.1.1" -segmentation-models-pytorch = "==0.3.2" +segmentation-models-pytorch = "==0.3.3" simplejson = "^3.17.6" SQLAlchemy = "^1.4.39" -torch = { url = "https://download.pytorch.org/whl/cu118/torch-2.0.0%2Bcu118-cp38-cp38-linux_x86_64.whl" } +torch = { url = "https://download.pytorch.org/whl/cu118/torch-2.0.1%2Bcu118-cp311-cp311-linux_x86_64.whl" } torchsummary = "^1.5.1" -torchvision = { url = "https://download.pytorch.org/whl/cu118/torchvision-0.15.1%2Bcu118-cp38-cp38-linux_x86_64.whl" } +torchvision = { url = "https://download.pytorch.org/whl/cu118/torchvision-0.15.2%2Bcu118-cp311-cp311-linux_x86_64.whl" } triton = "^2.0.0" Werkzeug = "^2.1.2" zerorpc = { git = "https://github.com/commaai/zerorpc-python.git", branch = "master" } omegaconf = "^2.3.0" osmnx = "==1.2.2" tritonclient = {version = "2.28.0", extras = ["http"]} -tensorrt = "^8.6.0" transformers = "^4.29.2" +timm = "==0.9.2" +PyNvCodec = { git = "https://github.com/NVIDIA/VideoProcessingFramework.git", rev = "3347e55" } [build-system] diff --git a/selfdrive/athena/athenad.py b/selfdrive/athena/athenad.py index 754c87a2d7..a53d5778d4 100755 --- a/selfdrive/athena/athenad.py +++ b/selfdrive/athena/athenad.py @@ -798,7 +798,9 @@ def main(exit_event: Optional[threading.Event] = None): except (ConnectionError, TimeoutError, WebSocketException): conn_retries += 1 params.remove("LastAthenaPingTime") - except socket.timeout: + # TODO: socket.timeout and TimeoutError are now the same exception since python3.10 + # Remove the socket.timeout case once we have fully moved to python3.11 + except socket.timeout: # pylint: disable=duplicate-except params.remove("LastAthenaPingTime") except Exception: cloudlog.exception("athenad.main.exception") diff --git a/selfdrive/boardd/pandad.py b/selfdrive/boardd/pandad.py index 5f308b9ad9..7cbac9b5d9 100755 --- a/selfdrive/boardd/pandad.py +++ b/selfdrive/boardd/pandad.py @@ -169,7 +169,7 @@ def main() -> NoReturn: # sort pandas to have deterministic order pandas.sort(key=cmp_to_key(panda_sort_cmp)) - panda_serials = list(map(lambda p: p.get_usb_serial(), pandas)) # type: ignore + panda_serials = list(map(lambda p: p.get_usb_serial(), pandas)) # log panda fw versions params.put("PandaSignatures", b','.join(p.get_signature() for p in pandas)) diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index ce7d797443..be3771d319 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: - cached_params = car.CarParams.from_bytes(cached_params) - if cached_params.carName == "mock": - cached_params = None + with car.CarParams.from_bytes(cached_params) as 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/car/docs_definitions.py b/selfdrive/car/docs_definitions.py index d3bba6f593..5db720b8f5 100644 --- a/selfdrive/car/docs_definitions.py +++ b/selfdrive/car/docs_definitions.py @@ -149,7 +149,7 @@ class CarParts: return copy.deepcopy(self) @classmethod - def common(cls, add: List[EnumBase] = None, remove: List[EnumBase] = None): + def common(cls, add: Optional[List[EnumBase]] = None, remove: Optional[List[EnumBase]] = None): p = [part for part in (add or []) + DEFAULT_CAR_PARTS if part not in (remove or [])] return cls(p) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 47b41f872e..601d34e948 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: - controls_state = log.ControlsState.from_bytes(controls_state) - self.v_cruise_helper.v_cruise_kph = controls_state.vCruise + with log.ControlsState.from_bytes(controls_state) as 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 2ae629a6c3..7e61efcf45 100755 --- a/selfdrive/controls/plannerd.py +++ b/selfdrive/controls/plannerd.py @@ -32,7 +32,8 @@ def plannerd_thread(sm=None, pm=None): cloudlog.info("plannerd is waiting for CarParams") params = Params() - CP = car.CarParams.from_bytes(params.get("CarParams", block=True)) + with car.CarParams.from_bytes(params.get("CarParams", block=True)) as msg: + CP = msg 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 20ece7f518..bba3ad7cff 100755 --- a/selfdrive/controls/radard.py +++ b/selfdrive/controls/radard.py @@ -282,7 +282,8 @@ def radard_thread(sm: Optional[messaging.SubMaster] = None, pm: Optional[messagi # wait for stats about the car to come in from controls cloudlog.info("radard is waiting for CarParams") - CP = car.CarParams.from_bytes(Params().get("CarParams", block=True)) + with car.CarParams.from_bytes(Params().get("CarParams", block=True)) as msg: + CP = msg cloudlog.info("radard got CarParams") # import the radar from the fingerprint @@ -317,7 +318,7 @@ def radard_thread(sm: Optional[messaging.SubMaster] = None, pm: Optional[messagi rk.monitor_time() -def main(sm: messaging.SubMaster = None, pm: messaging.PubMaster = None, can_sock: messaging.SubSocket = None): +def main(sm: Optional[messaging.SubMaster] = None, pm: Optional[messaging.PubMaster] = None, can_sock: messaging.SubSocket = None): radard_thread(sm, pm, can_sock) diff --git a/selfdrive/debug/dump.py b/selfdrive/debug/dump.py index fdb825eead..722cdc6406 100755 --- a/selfdrive/debug/dump.py +++ b/selfdrive/debug/dump.py @@ -41,7 +41,8 @@ if __name__ == "__main__": polld = poller.poll(100) for sock in polld: msg = sock.receive() - evt = log.Event.from_bytes(msg) + with log.Event.from_bytes(msg) as log_evt: + evt = log_evt 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 2cc68df438..ef3152b50c 100755 --- a/selfdrive/debug/internal/measure_torque_time_to_max.py +++ b/selfdrive/debug/internal/measure_torque_time_to_max.py @@ -34,7 +34,8 @@ if __name__ == "__main__": polld = poller.poll(1000) for sock in polld: msg = sock.receive() - evt = log.Event.from_bytes(msg) + with log.Event.from_bytes(msg) as log_evt: + evt = log_evt for item in evt.can: if item.address == 0xe4 and item.src == 128: diff --git a/selfdrive/debug/run_process_on_route.py b/selfdrive/debug/run_process_on_route.py index 0ea76d260f..c7a1434975 100755 --- a/selfdrive/debug/run_process_on_route.py +++ b/selfdrive/debug/run_process_on_route.py @@ -25,7 +25,7 @@ if __name__ == "__main__": # Remove message generated by the process under test and merge in the new messages produces = {o.which() for o in outputs} inputs = [i for i in inputs if i.which() not in produces] - outputs = sorted(inputs + outputs, key=lambda x: x.logMonoTime) # type: ignore + outputs = sorted(inputs + outputs, key=lambda x: x.logMonoTime) fn = f"{args.route}_{args.process}.bz2" save_log(fn, outputs) diff --git a/selfdrive/locationd/calibrationd.py b/selfdrive/locationd/calibrationd.py index c9d9340a2d..e990a46f12 100755 --- a/selfdrive/locationd/calibrationd.py +++ b/selfdrive/locationd/calibrationd.py @@ -73,11 +73,11 @@ class Calibrator: if param_put and calibration_params: try: - 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) + 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) except Exception: cloudlog.exception("Error reading cached CalibrationParams") diff --git a/selfdrive/locationd/laikad.py b/selfdrive/locationd/laikad.py index 2e98fd7556..5d8641a91b 100755 --- a/selfdrive/locationd/laikad.py +++ b/selfdrive/locationd/laikad.py @@ -116,9 +116,9 @@ class Laikad: nav_dict = {} try: - 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] + 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] 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 1fd6fc6cee..1826ea4563 100755 --- a/selfdrive/locationd/paramsd.py +++ b/selfdrive/locationd/paramsd.py @@ -129,7 +129,8 @@ 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") - CP = car.CarParams.from_bytes(params_reader.get("CarParams", block=True)) + with car.CarParams.from_bytes(params_reader.get("CarParams", block=True)) as msg: + CP = msg 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 bec086a767..97207908e7 100755 --- a/selfdrive/locationd/test/_test_locationd_lib.py +++ b/selfdrive/locationd/test/_test_locationd_lib.py @@ -40,7 +40,8 @@ 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) - return log.Event.from_bytes(self.ffi.buffer(self.msg_buff), nesting_limit=self.buff_size // 8) + with log.Event.from_bytes(self.ffi.buffer(self.msg_buff), nesting_limit=self.buff_size // 8) as log_evt: + return log_evt def test_liblocalizer(self): msg = messaging.new_message('liveCalibration') diff --git a/selfdrive/locationd/torqued.py b/selfdrive/locationd/torqued.py index fcc068d34e..fce9987a80 100755 --- a/selfdrive/locationd/torqued.py +++ b/selfdrive/locationd/torqued.py @@ -139,8 +139,10 @@ class TorqueEstimator: torque_cache = params.get("LiveTorqueParameters") if params_cache is not None and torque_cache is not None: try: - cache_ltp = log.Event.from_bytes(torque_cache).liveTorqueParameters - cache_CP = car.CarParams.from_bytes(params_cache) + 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 if self.get_restore_key(cache_CP, cache_ltp.version) == self.get_restore_key(CP, VERSION): if cache_ltp.liveValid: initial_params = { @@ -262,7 +264,8 @@ def main(sm=None, pm=None): pm = messaging.PubMaster(['liveTorqueParameters']) params = Params() - CP = car.CarParams.from_bytes(params.get("CarParams", block=True)) + with car.CarParams.from_bytes(params.get("CarParams", block=True)) as CP: + estimator = TorqueEstimator(CP) estimator = TorqueEstimator(CP) def cache_params(sig, frame): diff --git a/selfdrive/test/process_replay/helpers.py b/selfdrive/test/process_replay/helpers.py index 1b30eca103..42c3aeb02a 100644 --- a/selfdrive/test/process_replay/helpers.py +++ b/selfdrive/test/process_replay/helpers.py @@ -7,7 +7,7 @@ from typing import List, Optional from common.params import Params class OpenpilotPrefix(object): - def __init__(self, prefix: str = None, clean_dirs_on_exit: bool = True): + def __init__(self, prefix: Optional[str] = None, clean_dirs_on_exit: bool = True): self.prefix = prefix if prefix else str(uuid.uuid4()) self.msgq_path = os.path.join('/dev/shm', self.prefix) self.clean_dirs_on_exit = clean_dirs_on_exit @@ -24,7 +24,7 @@ class OpenpilotPrefix(object): self.clean_dirs() del os.environ['OPENPILOT_PREFIX'] return False - + def clean_dirs(self): symlink_path = Params().get_param_path() if os.path.exists(symlink_path): diff --git a/system/hardware/tici/agnos.json b/system/hardware/tici/agnos.json index 6730f82706..90933e8fef 100644 --- a/system/hardware/tici/agnos.json +++ b/system/hardware/tici/agnos.json @@ -1,19 +1,19 @@ [ { "name": "boot", - "url": "https://commadist.azureedge.net/agnosupdate/boot-7d953f5e1bc606984e4d49c6f957421a4172f72b4ebd359baa689ef43b7e911c.img.xz", - "hash": "7d953f5e1bc606984e4d49c6f957421a4172f72b4ebd359baa689ef43b7e911c", - "hash_raw": "7d953f5e1bc606984e4d49c6f957421a4172f72b4ebd359baa689ef43b7e911c", - "size": 15153152, + "url": "https://commadist.azureedge.net/agnosupdate/boot-8d8d8620de8b2687f3a8fffdb81b2abd1fe2ead5bc831361a1a212e5589ac279.img.xz", + "hash": "8d8d8620de8b2687f3a8fffdb81b2abd1fe2ead5bc831361a1a212e5589ac279", + "hash_raw": "8d8d8620de8b2687f3a8fffdb81b2abd1fe2ead5bc831361a1a212e5589ac279", + "size": 15636480, "sparse": false, "full_check": true, "has_ab": true }, { "name": "abl", - "url": "https://commadist.azureedge.net/agnosupdate/abl-50329ac734ff7a6c20c3f552dce9b13f84b3eb2e73faa64b9810049d9b406602.img.xz", - "hash": "50329ac734ff7a6c20c3f552dce9b13f84b3eb2e73faa64b9810049d9b406602", - "hash_raw": "50329ac734ff7a6c20c3f552dce9b13f84b3eb2e73faa64b9810049d9b406602", + "url": "https://commadist.azureedge.net/agnosupdate/abl-0084fcf79fea067632a1c2d9519b6445ad484aa8b09f49f22e6b45b4dccacd2d.img.xz", + "hash": "0084fcf79fea067632a1c2d9519b6445ad484aa8b09f49f22e6b45b4dccacd2d", + "hash_raw": "0084fcf79fea067632a1c2d9519b6445ad484aa8b09f49f22e6b45b4dccacd2d", "size": 274432, "sparse": false, "full_check": true, @@ -21,9 +21,9 @@ }, { "name": "xbl", - "url": "https://commadist.azureedge.net/agnosupdate/xbl-dc297986b38f50c47584bd8549b188b37b1d6a0c77b3255859dd675c177b5c15.img.xz", - "hash": "dc297986b38f50c47584bd8549b188b37b1d6a0c77b3255859dd675c177b5c15", - "hash_raw": "dc297986b38f50c47584bd8549b188b37b1d6a0c77b3255859dd675c177b5c15", + "url": "https://commadist.azureedge.net/agnosupdate/xbl-942b9b2914d89c2a70fdf27380b59e04b549ac2fd53ecb29d6549d1a9c8daeaa.img.xz", + "hash": "942b9b2914d89c2a70fdf27380b59e04b549ac2fd53ecb29d6549d1a9c8daeaa", + "hash_raw": "942b9b2914d89c2a70fdf27380b59e04b549ac2fd53ecb29d6549d1a9c8daeaa", "size": 3282672, "sparse": false, "full_check": true, @@ -31,9 +31,9 @@ }, { "name": "xbl_config", - "url": "https://commadist.azureedge.net/agnosupdate/xbl_config-b73fbbb42934aabc6d4f16ce84ac6c8c0205bc70e0a85412a771f3cc1d62cc40.img.xz", - "hash": "b73fbbb42934aabc6d4f16ce84ac6c8c0205bc70e0a85412a771f3cc1d62cc40", - "hash_raw": "b73fbbb42934aabc6d4f16ce84ac6c8c0205bc70e0a85412a771f3cc1d62cc40", + "url": "https://commadist.azureedge.net/agnosupdate/xbl_config-6881d94599f65d94c13bcc0bd860184dfba2dfe96ec776d08fb35ac5b5f85bbf.img.xz", + "hash": "6881d94599f65d94c13bcc0bd860184dfba2dfe96ec776d08fb35ac5b5f85bbf", + "hash_raw": "6881d94599f65d94c13bcc0bd860184dfba2dfe96ec776d08fb35ac5b5f85bbf", "size": 98124, "sparse": false, "full_check": true, @@ -41,9 +41,9 @@ }, { "name": "devcfg", - "url": "https://commadist.azureedge.net/agnosupdate/devcfg-2d3063d106813006ac9ceeaf8818a31d4b33996873e81178ac5129f5e1b82bca.img.xz", - "hash": "2d3063d106813006ac9ceeaf8818a31d4b33996873e81178ac5129f5e1b82bca", - "hash_raw": "2d3063d106813006ac9ceeaf8818a31d4b33996873e81178ac5129f5e1b82bca", + "url": "https://commadist.azureedge.net/agnosupdate/devcfg-9bbf168baff6101f4890c5c95c118e30813c2610cfb35b8e19e363f04a32a262.img.xz", + "hash": "9bbf168baff6101f4890c5c95c118e30813c2610cfb35b8e19e363f04a32a262", + "hash_raw": "9bbf168baff6101f4890c5c95c118e30813c2610cfb35b8e19e363f04a32a262", "size": 40336, "sparse": false, "full_check": true, @@ -51,9 +51,9 @@ }, { "name": "aop", - "url": "https://commadist.azureedge.net/agnosupdate/aop-d69450d5438b3e5e2ba5b77db1ae49e1cf9cab17836f563aa57192b5b3a4ac3e.img.xz", - "hash": "d69450d5438b3e5e2ba5b77db1ae49e1cf9cab17836f563aa57192b5b3a4ac3e", - "hash_raw": "d69450d5438b3e5e2ba5b77db1ae49e1cf9cab17836f563aa57192b5b3a4ac3e", + "url": "https://commadist.azureedge.net/agnosupdate/aop-c1d9d712980f6b2a4b12196597f4d1bf3fe4fec6c59edf29ae63ef21f11b8222.img.xz", + "hash": "c1d9d712980f6b2a4b12196597f4d1bf3fe4fec6c59edf29ae63ef21f11b8222", + "hash_raw": "c1d9d712980f6b2a4b12196597f4d1bf3fe4fec6c59edf29ae63ef21f11b8222", "size": 184364, "sparse": false, "full_check": true, @@ -61,9 +61,9 @@ }, { "name": "system", - "url": "https://commadist.azureedge.net/agnosupdate/system-4a8311dd591006e0c2a6f60060d6ef579ceec9b3d688e8438a9aef4e230ae028.img.xz", - "hash": "23c9f111f81fc3ee83f85016cb320e03a46aad6721a85e1b4a3f04b6a764e934", - "hash_raw": "4a8311dd591006e0c2a6f60060d6ef579ceec9b3d688e8438a9aef4e230ae028", + "url": "https://commadist.azureedge.net/agnosupdate/system-e1fa3018bce9bad01c6967e5e21f1141cf5c8f02d2edfaed51c738f74a32a432.img.xz", + "hash": "611011f3e3f147bc24f371105a9dd3760ec11ba424c56d4a442a66b098c784c0", + "hash_raw": "e1fa3018bce9bad01c6967e5e21f1141cf5c8f02d2edfaed51c738f74a32a432", "size": 10737418240, "sparse": true, "full_check": false, diff --git a/system/sensord/rawgps/compare.py b/system/sensord/rawgps/compare.py index 0ec15b81fb..b2f4259e64 100755 --- a/system/sensord/rawgps/compare.py +++ b/system/sensord/rawgps/compare.py @@ -56,7 +56,7 @@ if __name__ == "__main__": pr_err /= len(car) speed_err /= len(car) print("avg psuedorange err %f avg speed err %f" % (pr_err, speed_err)) - for c in sorted(car, key=lambda x: abs(x[1] - x[3] - pr_err)): # type: ignore + for c in sorted(car, key=lambda x: abs(x[1] - x[3] - pr_err)): svid, ublox_psuedorange, ublox_speed, qcom_psuedorange, qcom_speed, cno = c print("svid: %3d pseudorange: %10.2f m speed: %8.2f m/s meas: %12.2f speed: %10.2f meas_err: %10.3f speed_err: %8.3f cno: %d" % (svid, ublox_psuedorange, ublox_speed, qcom_psuedorange, qcom_speed,