From d6a2a7ba60bb6aaec9da4688f491f995c9d959c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20R=C4=85czy?= Date: Tue, 30 Apr 2024 14:05:37 -0700 Subject: [PATCH 1/6] bodyteleop: include .gitignore in release files (#32328) Add gitignore to release files --- release/files_common | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/release/files_common b/release/files_common index eaf54b0cd561ce..34d8f009732f15 100644 --- a/release/files_common +++ b/release/files_common @@ -45,7 +45,9 @@ release/* tools/__init__.py tools/lib/* -tools/bodyteleop/* +tools/bodyteleop/.gitignore +tools/bodyteleop/web.py +tools/bodyteleop/static/* tools/joystick/* tools/replay/*.cc tools/replay/*.h From 6ef95f7a91b33f7f554c0d41353c7f77fb2eb6b4 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 1 May 2024 11:35:20 -0700 Subject: [PATCH 2/6] adjust gps alert --- cereal | 2 +- selfdrive/controls/controlsd.py | 2 +- selfdrive/controls/lib/events.py | 16 +++++----------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/cereal b/cereal index 861144c136c91f..284206878d6184 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit 861144c136c91f70dcbc652c2ffe99f57440ad47 +Subproject commit 284206878d6184747b1e1af03f91ac9e718ff326 diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 13d7b25b298ed4..35dad3f81acb61 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -386,7 +386,7 @@ def update_events(self, CS): # TODO: fix simulator if not SIMULATION or REPLAY: # Not show in first 1 km to allow for driving out of garage. This event shows after 5 minutes - if not self.sm['liveLocationKalman'].gpsOK and self.sm['liveLocationKalman'].inputsOK and (self.distance_traveled > 1000): + if not self.sm['liveLocationKalman'].gpsOK and self.sm['liveLocationKalman'].inputsOK and (self.distance_traveled > 1500): self.events.add(EventName.noGps) if self.sm['liveLocationKalman'].gpsOK: self.distance_traveled = 0 diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index 2de4d61d882943..40796dd8ff8f9f 100755 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -251,13 +251,6 @@ def calibration_incomplete_alert(CP: car.CarParams, CS: car.CarState, sm: messag Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .2) -def no_gps_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert: - return Alert( - "Poor GPS reception", - "Hardware malfunctioning if sky is visible", - AlertStatus.normal, AlertSize.mid, - Priority.LOWER, VisualAlert.none, AudibleAlert.none, .2, creation_delay=300.) - # *** debug alerts *** def out_of_space_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert: @@ -559,9 +552,6 @@ def joystick_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, }, # Unused - EventName.gpsMalfunction: { - ET.PERMANENT: NormalPermanentAlert("GPS Malfunction", "Likely Hardware Issue"), - }, EventName.locationdTemporaryError: { ET.NO_ENTRY: NoEntryAlert("locationd Temporary Error"), @@ -696,7 +686,11 @@ def joystick_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, }, EventName.noGps: { - ET.PERMANENT: no_gps_alert, + ET.PERMANENT: Alert( + "Poor GPS reception", + "Ensure device has a clear view of the sky", + AlertStatus.normal, AlertSize.mid, + Priority.LOWER, VisualAlert.none, AudibleAlert.none, .2, creation_delay=600.) }, EventName.soundsUnavailable: { From 6a52507e3a7479cdb3e4626de164290d839b926c Mon Sep 17 00:00:00 2001 From: Andrei Radulescu Date: Thu, 2 May 2024 01:00:25 +0300 Subject: [PATCH 3/6] camerad: cast ci->image_sensor to unsigned short (#32317) fixes 24.04 build --- system/camerad/cameras/camera_common.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/camerad/cameras/camera_common.cc b/system/camerad/cameras/camera_common.cc index 6dcb8b4d22bc2b..9d82284d9f97b8 100644 --- a/system/camerad/cameras/camera_common.cc +++ b/system/camerad/cameras/camera_common.cc @@ -29,7 +29,7 @@ class ImgProc { "-DSENSOR_ID=%hu -DHDR_OFFSET=%d -DVIGNETTING=%d ", ci->frame_width, ci->frame_height, ci->hdr_offset > 0 ? ci->frame_stride * 2 : ci->frame_stride, ci->frame_offset, b->rgb_width, b->rgb_height, buf_width, uv_offset, - ci->image_sensor, ci->hdr_offset, s->camera_num == 1); + static_cast(ci->image_sensor), ci->hdr_offset, s->camera_num == 1); const char *cl_file = "cameras/process_raw.cl"; cl_program prg_imgproc = cl_program_from_file(context, device_id, cl_file, args); krnl_ = CL_CHECK_ERR(clCreateKernel(prg_imgproc, "process_raw", &err)); From b98ea81bdb744c73a42bb491a70909490994907b Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 1 May 2024 20:54:32 -0700 Subject: [PATCH 4/6] agnos 10 (#32320) --- launch_env.sh | 2 +- system/hardware/tici/agnos.json | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/launch_env.sh b/launch_env.sh index 6859afb0d41468..bfc2e6ac6a8a41 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="9.7" + export AGNOS_VERSION="10" fi export STAGING_ROOT="/data/safe_staging" diff --git a/system/hardware/tici/agnos.json b/system/hardware/tici/agnos.json index e69842cfec8979..cc3f6bb830b4cc 100644 --- a/system/hardware/tici/agnos.json +++ b/system/hardware/tici/agnos.json @@ -1,9 +1,9 @@ [ { "name": "boot", - "url": "https://commadist.azureedge.net/agnosupdate/boot-f0de74e139b8b99224738d4e72a5b1831758f20b09ff6bb28f3aaaae1c4c1ebe.img.xz", - "hash": "f0de74e139b8b99224738d4e72a5b1831758f20b09ff6bb28f3aaaae1c4c1ebe", - "hash_raw": "f0de74e139b8b99224738d4e72a5b1831758f20b09ff6bb28f3aaaae1c4c1ebe", + "url": "https://commadist.azureedge.net/agnosupdate/boot-543fdc8aadf700f33a6e90740b8a227036bbd190626861d45ba1eb0d9ac422d1.img.xz", + "hash": "543fdc8aadf700f33a6e90740b8a227036bbd190626861d45ba1eb0d9ac422d1", + "hash_raw": "543fdc8aadf700f33a6e90740b8a227036bbd190626861d45ba1eb0d9ac422d1", "size": 15636480, "sparse": false, "full_check": true, @@ -61,17 +61,17 @@ }, { "name": "system", - "url": "https://commadist.azureedge.net/agnosupdate/system-0f69173d5f3058f7197c139442a6556be59e52f15402a263215a329ba5ec41e2.img.xz", - "hash": "4858385ba6284bcaa179ab77ac4263486e4d8670df921e4ac400464dc1dde59c", - "hash_raw": "0f69173d5f3058f7197c139442a6556be59e52f15402a263215a329ba5ec41e2", + "url": "https://commadist.azureedge.net/agnosupdate/system-bd2967074298a2686f81e2094db3867d7cb2605750d63b1a7309a923f6985b2a.img.xz", + "hash": "dc2f960631f02446d912885786922c27be4eb1ec6c202cacce6699d5a74021ba", + "hash_raw": "bd2967074298a2686f81e2094db3867d7cb2605750d63b1a7309a923f6985b2a", "size": 10737418240, "sparse": true, "full_check": false, "has_ab": true, "alt": { - "hash": "42658a6fff660d9b6abb9cb9fbb3481071259c9a9598718af6b1edff2b556009", - "url": "https://commadist.azureedge.net/agnosupdate/system-skip-chunks-0f69173d5f3058f7197c139442a6556be59e52f15402a263215a329ba5ec41e2.img.xz", - "size": 4548292756 + "hash": "283e5e754593c6e1bb5e9d63b54624cda5475b88bc1b130fe6ab13acdbd966e2", + "url": "https://commadist.azureedge.net/agnosupdate/system-skip-chunks-bd2967074298a2686f81e2094db3867d7cb2605750d63b1a7309a923f6985b2a.img.xz", + "size": 4548070712 } } ] \ No newline at end of file From 0362cfa7eea8bd526a45bb231d2fcd9114a9a11d Mon Sep 17 00:00:00 2001 From: Shotaro Watanabe Date: Thu, 2 May 2024 14:22:35 +0900 Subject: [PATCH 5/6] devcontainer: added batman to the video group (#32333) --- .devcontainer/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 36bb6aa8408921..2bd1ccfd62d4bb 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -8,6 +8,8 @@ RUN cd /tmp && \ curl -L -o virtualgl.deb "https://downloads.sourceforge.net/project/virtualgl/3.1/virtualgl_3.1_$ARCH.deb" && \ dpkg -i virtualgl.deb +RUN usermod -aG video batman + USER batman RUN cd $HOME && \ From bf2e00a23382fede8608d75884ead3ff30ddaa9f Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 2 May 2024 12:09:34 -0700 Subject: [PATCH 6/6] CPU budget (#32335) * cpu budget * comment * new line --- selfdrive/test/test_onroad.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/selfdrive/test/test_onroad.py b/selfdrive/test/test_onroad.py index 5de9d20297aed0..cd0846c894aa35 100755 --- a/selfdrive/test/test_onroad.py +++ b/selfdrive/test/test_onroad.py @@ -27,8 +27,15 @@ from openpilot.system.hardware.hw import Paths from openpilot.tools.lib.logreader import LogReader -# Baseline CPU usage by process +""" +CPU usage budget +* each process is entitled to at least 8% +* total CPU usage of openpilot (sum(PROCS.values()) + should not exceed MAX_TOTAL_CPU +""" +MAX_TOTAL_CPU = 250. # total for all 8 cores PROCS = { + # Baseline CPU usage by process "selfdrive.controls.controlsd": 46.0, "./loggerd": 14.0, "./encoderd": 17.0, @@ -274,6 +281,7 @@ def test_cpu_usage(self): result += f"{proc_name.ljust(35)} {cpu_usage:5.2f}% ({exp}%) {err}\n" if len(err) > 0: cpu_ok = False + result += "------------------------------------------------\n" # Ensure there's no missing procs all_procs = {p.name for p in self.service_msgs['managerState'][0].managerState.processes if p.shouldBeRunning} @@ -281,7 +289,14 @@ def test_cpu_usage(self): with self.subTest(proc=p): assert any(p in pp for pp in PROCS.keys()), f"Expected CPU usage missing for {p}" - result += "------------------------------------------------\n" + # total CPU check + procs_tot = sum([(max(x) if isinstance(x, tuple) else x) for x in PROCS.values()]) + with self.subTest(name="total CPU"): + assert procs_tot < MAX_TOTAL_CPU, "Total CPU budget exceeded" + result += "------------------------------------------------\n" + result += f"Total allocated CPU usage is {procs_tot}%, budget is {MAX_TOTAL_CPU}%, {MAX_TOTAL_CPU-procs_tot:.1f}% left\n" + result += "------------------------------------------------\n" + print(result) self.assertTrue(cpu_ok)