From addca46f68790820c5c831de13cc810b69a8ec7a Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 24 Jun 2026 19:21:19 -0700 Subject: [PATCH] move some tools back to root (#38235) --- .github/workflows/docs.yaml | 2 +- .github/workflows/release.yaml | 4 +-- .github/workflows/repo-maintenance.yaml | 2 +- .github/workflows/tests.yaml | 20 +++++------ Jenkinsfile | 12 ++++--- .../scripts => selfdrive/test}/mem_usage.py | 29 --------------- openpilot/selfdrive/test/test_onroad.py | 2 +- scripts/post-commit | 2 +- {openpilot/tools => tools}/CTF.md | 0 {openpilot/tools => tools}/README.md | 4 +-- .../tools => tools}/car_porting/README.md | 20 +++++------ .../car_porting/auto_fingerprint.py | 0 .../examples/find_segments_with_message.ipynb | 0 .../examples/ford_vin_fingerprint.ipynb | 0 .../examples/hkg_canfd_gear_message.ipynb | 0 .../examples/subaru_fuzzy_fingerprint.ipynb | 0 .../examples/subaru_long_accel.ipynb | 0 .../examples/subaru_steer_temp_fault.ipynb | 0 .../car_porting/measure_steering_accuracy.py | 0 .../car_porting/test_car_model.py | 0 {openpilot/tools => tools}/op.sh | 6 ++-- {release => tools/release}/README.md | 2 +- {release => tools/release}/build_release.sh | 4 +-- {release => tools/release}/build_stripped.sh | 2 +- {release => tools/release}/check-dirty.sh | 0 .../release}/check-submodules.sh | 0 {release => tools/release}/identity.sh | 0 {release => tools/release}/pack.py | 0 {release => tools/release}/release_files.py | 2 +- .../tools => tools}/scripts/__init__.py | 0 {openpilot/tools => tools}/scripts/adb_ssh.sh | 0 .../scripts/car/can_print_changes.py | 2 +- .../scripts/car/can_printer.py | 0 .../tools => tools}/scripts/car/can_table.py | 0 .../tools => tools}/scripts/car/clear_dtc.py | 0 .../scripts/car/disable_ecu.py | 0 .../tools => tools}/scripts/car/ecu_addrs.py | 0 .../scripts/car/fw_versions.py | 0 .../car/hyundai_enable_radar_points.py | 0 .../scripts/car/max_lat_accel.py | 0 .../scripts/car/measure_torque_time_to_max.py | 0 .../scripts/car/read_dtc_status.py | 0 .../scripts/car/toyota_eps_factor.py | 0 {openpilot/tools => tools}/scripts/car/vin.py | 0 .../scripts/car/vw_mqb_config.py | 0 .../tools => tools}/scripts/count_events.py | 0 .../tools => tools}/scripts/cpu_usage_stat.py | 0 .../tools => tools}/scripts/cycle_alerts.py | 0 .../debug_fw_fingerprinting_offline.py | 0 {openpilot/tools => tools}/scripts/devsync.py | 0 {openpilot/tools => tools}/scripts/dump.py | 0 .../tools => tools}/scripts/extract_audio.py | 0 .../scripts/filter_log_message.py | 0 .../scripts/fingerprint_from_route.py | 0 .../scripts/fuzz_fw_fingerprint.py | 0 .../scripts/get_fingerprint.py | 0 .../scripts/live_cpu_and_temp.py | 0 tools/scripts/mem_usage.py | 35 +++++++++++++++++++ .../tools => tools}/scripts/print_flags.py | 0 .../scripts/profiling/clpeak/.gitignore | 0 .../scripts/profiling/clpeak/build.sh | 0 .../scripts/profiling/clpeak/no_print.patch | 0 .../profiling/clpeak/run_continuously.patch | 0 .../scripts/profiling/ftrace.sh | 0 .../scripts/profiling/palanteer/.gitignore | 0 .../scripts/profiling/palanteer/setup.sh | 0 .../scripts/profiling/perfetto/.gitignore | 0 .../scripts/profiling/perfetto/build.sh | 0 .../scripts/profiling/perfetto/copy.sh | 0 .../scripts/profiling/perfetto/record.sh | 0 .../scripts/profiling/perfetto/server.sh | 0 .../scripts/profiling/perfetto/traces.sh | 0 .../scripts/profiling/py-spy/profile.sh | 0 .../scripts/profiling/snapdragon/.gitignore | 0 .../scripts/profiling/snapdragon/README.md | 0 .../profiling/snapdragon/setup-agnos.sh | 0 .../profiling/snapdragon/setup-profiler.sh | 0 .../scripts/profiling/watch-irqs.sh | 0 .../tools => tools}/scripts/qlog_size.py | 0 .../scripts/run_process_on_route.py | 0 {openpilot/tools => tools}/scripts/serial.sh | 0 .../tools => tools}/scripts/set_car_params.py | 0 .../tools => tools}/scripts/setup_ssh_keys.py | 0 {openpilot/tools => tools}/scripts/ssh.py | 0 .../scripts/test_fw_query_on_routes.py | 0 {openpilot/tools => tools}/scripts/uiview.py | 0 .../tools => tools}/scripts/watch_timings.py | 0 {openpilot/tools => tools}/setup.sh | 6 ++-- .../tools => tools}/setup_dependencies.sh | 0 89 files changed, 82 insertions(+), 74 deletions(-) rename openpilot/{tools/scripts => selfdrive/test}/mem_usage.py (90%) mode change 100755 => 100644 rename {openpilot/tools => tools}/CTF.md (100%) rename {openpilot/tools => tools}/README.md (97%) rename {openpilot/tools => tools}/car_porting/README.md (87%) rename {openpilot/tools => tools}/car_porting/auto_fingerprint.py (100%) rename {openpilot/tools => tools}/car_porting/examples/find_segments_with_message.ipynb (100%) rename {openpilot/tools => tools}/car_porting/examples/ford_vin_fingerprint.ipynb (100%) rename {openpilot/tools => tools}/car_porting/examples/hkg_canfd_gear_message.ipynb (100%) rename {openpilot/tools => tools}/car_porting/examples/subaru_fuzzy_fingerprint.ipynb (100%) rename {openpilot/tools => tools}/car_porting/examples/subaru_long_accel.ipynb (100%) rename {openpilot/tools => tools}/car_porting/examples/subaru_steer_temp_fault.ipynb (100%) rename {openpilot/tools => tools}/car_porting/measure_steering_accuracy.py (100%) rename {openpilot/tools => tools}/car_porting/test_car_model.py (100%) rename {openpilot/tools => tools}/op.sh (98%) rename {release => tools/release}/README.md (88%) rename {release => tools/release}/build_release.sh (94%) rename {release => tools/release}/build_stripped.sh (97%) rename {release => tools/release}/check-dirty.sh (100%) rename {release => tools/release}/check-submodules.sh (100%) rename {release => tools/release}/identity.sh (100%) rename {release => tools/release}/pack.py (100%) rename {release => tools/release}/release_files.py (93%) rename {openpilot/tools => tools}/scripts/__init__.py (100%) rename {openpilot/tools => tools}/scripts/adb_ssh.sh (100%) rename {openpilot/tools => tools}/scripts/car/can_print_changes.py (98%) rename {openpilot/tools => tools}/scripts/car/can_printer.py (100%) rename {openpilot/tools => tools}/scripts/car/can_table.py (100%) rename {openpilot/tools => tools}/scripts/car/clear_dtc.py (100%) rename {openpilot/tools => tools}/scripts/car/disable_ecu.py (100%) rename {openpilot/tools => tools}/scripts/car/ecu_addrs.py (100%) rename {openpilot/tools => tools}/scripts/car/fw_versions.py (100%) rename {openpilot/tools => tools}/scripts/car/hyundai_enable_radar_points.py (100%) rename {openpilot/tools => tools}/scripts/car/max_lat_accel.py (100%) rename {openpilot/tools => tools}/scripts/car/measure_torque_time_to_max.py (100%) rename {openpilot/tools => tools}/scripts/car/read_dtc_status.py (100%) rename {openpilot/tools => tools}/scripts/car/toyota_eps_factor.py (100%) rename {openpilot/tools => tools}/scripts/car/vin.py (100%) rename {openpilot/tools => tools}/scripts/car/vw_mqb_config.py (100%) rename {openpilot/tools => tools}/scripts/count_events.py (100%) rename {openpilot/tools => tools}/scripts/cpu_usage_stat.py (100%) rename {openpilot/tools => tools}/scripts/cycle_alerts.py (100%) rename {openpilot/tools => tools}/scripts/debug_fw_fingerprinting_offline.py (100%) rename {openpilot/tools => tools}/scripts/devsync.py (100%) rename {openpilot/tools => tools}/scripts/dump.py (100%) rename {openpilot/tools => tools}/scripts/extract_audio.py (100%) rename {openpilot/tools => tools}/scripts/filter_log_message.py (100%) rename {openpilot/tools => tools}/scripts/fingerprint_from_route.py (100%) rename {openpilot/tools => tools}/scripts/fuzz_fw_fingerprint.py (100%) rename {openpilot/tools => tools}/scripts/get_fingerprint.py (100%) rename {openpilot/tools => tools}/scripts/live_cpu_and_temp.py (100%) create mode 100755 tools/scripts/mem_usage.py rename {openpilot/tools => tools}/scripts/print_flags.py (100%) rename {openpilot/tools => tools}/scripts/profiling/clpeak/.gitignore (100%) rename {openpilot/tools => tools}/scripts/profiling/clpeak/build.sh (100%) rename {openpilot/tools => tools}/scripts/profiling/clpeak/no_print.patch (100%) rename {openpilot/tools => tools}/scripts/profiling/clpeak/run_continuously.patch (100%) rename {openpilot/tools => tools}/scripts/profiling/ftrace.sh (100%) rename {openpilot/tools => tools}/scripts/profiling/palanteer/.gitignore (100%) rename {openpilot/tools => tools}/scripts/profiling/palanteer/setup.sh (100%) rename {openpilot/tools => tools}/scripts/profiling/perfetto/.gitignore (100%) rename {openpilot/tools => tools}/scripts/profiling/perfetto/build.sh (100%) rename {openpilot/tools => tools}/scripts/profiling/perfetto/copy.sh (100%) rename {openpilot/tools => tools}/scripts/profiling/perfetto/record.sh (100%) rename {openpilot/tools => tools}/scripts/profiling/perfetto/server.sh (100%) rename {openpilot/tools => tools}/scripts/profiling/perfetto/traces.sh (100%) rename {openpilot/tools => tools}/scripts/profiling/py-spy/profile.sh (100%) rename {openpilot/tools => tools}/scripts/profiling/snapdragon/.gitignore (100%) rename {openpilot/tools => tools}/scripts/profiling/snapdragon/README.md (100%) rename {openpilot/tools => tools}/scripts/profiling/snapdragon/setup-agnos.sh (100%) rename {openpilot/tools => tools}/scripts/profiling/snapdragon/setup-profiler.sh (100%) rename {openpilot/tools => tools}/scripts/profiling/watch-irqs.sh (100%) rename {openpilot/tools => tools}/scripts/qlog_size.py (100%) rename {openpilot/tools => tools}/scripts/run_process_on_route.py (100%) rename {openpilot/tools => tools}/scripts/serial.sh (100%) rename {openpilot/tools => tools}/scripts/set_car_params.py (100%) rename {openpilot/tools => tools}/scripts/setup_ssh_keys.py (100%) rename {openpilot/tools => tools}/scripts/ssh.py (100%) rename {openpilot/tools => tools}/scripts/test_fw_query_on_routes.py (100%) rename {openpilot/tools => tools}/scripts/uiview.py (100%) rename {openpilot/tools => tools}/scripts/watch_timings.py (100%) rename {openpilot/tools => tools}/setup.sh (96%) rename {openpilot/tools => tools}/setup_dependencies.sh (100%) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index f618c1bdf8..d072cd71d1 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -45,7 +45,7 @@ jobs: run: | set -x - source release/identity.sh + source tools/release/identity.sh cd openpilot-docs git checkout --orphan tmp diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ae6a2655a4..27faccae6e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -26,6 +26,6 @@ jobs: with: submodules: true fetch-depth: 0 - - run: ./openpilot/tools/op.sh setup + - run: ./tools/op.sh setup - name: Push master-ci - run: BRANCH=__nightly release/build_stripped.sh + run: BRANCH=__nightly tools/release/build_stripped.sh diff --git a/.github/workflows/repo-maintenance.yaml b/.github/workflows/repo-maintenance.yaml index 14c613fbe4..1a99852be1 100644 --- a/.github/workflows/repo-maintenance.yaml +++ b/.github/workflows/repo-maintenance.yaml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v6 with: submodules: true - - run: ./openpilot/tools/op.sh setup + - run: ./tools/op.sh setup - name: uv lock run: uv lock --upgrade - name: uv pip tree diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 3ed0829a26..4fa3af3d5e 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -46,8 +46,8 @@ jobs: command: git lfs pull - name: Build devel timeout-minutes: 1 - run: TARGET_DIR=$STRIPPED_DIR release/build_stripped.sh - - run: ./openpilot/tools/op.sh setup + run: TARGET_DIR=$STRIPPED_DIR tools/release/build_stripped.sh + - run: ./tools/op.sh setup - name: Build openpilot and run checks timeout-minutes: 30 working-directory: ${{ env.STRIPPED_DIR }} @@ -55,11 +55,11 @@ jobs: - name: Run tests timeout-minutes: 1 working-directory: ${{ env.STRIPPED_DIR }} - run: release/check-dirty.sh + run: tools/release/check-dirty.sh - name: Check submodules if: github.repository == 'commaai/openpilot' timeout-minutes: 3 - run: release/check-submodules.sh + run: tools/release/check-submodules.sh build_mac: name: build macOS @@ -72,7 +72,7 @@ jobs: run: | FILTERED=$(echo "$PATH" | tr ':' '\n' | grep -v '/opt/homebrew' | tr '\n' ':') echo "PATH=${FILTERED}/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" >> $GITHUB_ENV - - run: ./openpilot/tools/op.sh setup + - run: ./tools/op.sh setup - name: Building openpilot run: scons @@ -88,7 +88,7 @@ jobs: - uses: actions/checkout@v6 with: submodules: true - - run: ./openpilot/tools/op.sh setup + - run: ./tools/op.sh setup - name: Static analysis timeout-minutes: 1 run: scripts/lint/lint.sh @@ -105,7 +105,7 @@ jobs: - uses: actions/checkout@v6 with: submodules: true - - run: ./openpilot/tools/op.sh setup + - run: ./tools/op.sh setup - name: Build openpilot run: scons - name: Run unit tests @@ -128,7 +128,7 @@ jobs: - uses: actions/checkout@v6 with: submodules: true - - run: ./openpilot/tools/op.sh setup + - run: ./tools/op.sh setup - name: Build openpilot run: scons - name: Run replay @@ -201,7 +201,7 @@ jobs: - uses: actions/checkout@v6 with: submodules: true - - run: ./openpilot/tools/op.sh setup + - run: ./tools/op.sh setup - name: Build openpilot run: scons - name: Driving test @@ -222,7 +222,7 @@ jobs: - uses: actions/checkout@v6 with: submodules: true - - run: ./openpilot/tools/op.sh setup + - run: ./tools/op.sh setup - name: Build openpilot run: scons - name: Create UI Report diff --git a/Jenkinsfile b/Jenkinsfile index c06674a5c5..d57e9502aa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -63,6 +63,8 @@ if [ -f /data/openpilot/launch_env.sh ]; then source /data/openpilot/launch_env.sh fi +export LD_LIBRARY_PATH="\$(python -c 'import ffmpeg; print(ffmpeg.LIB_DIR)'):/usr/local/lib:\${LD_LIBRARY_PATH:-}" + ln -snf ${env.TEST_DIR} /data/pythonpath cd ${env.TEST_DIR} || true @@ -179,7 +181,7 @@ node { try { if (env.BRANCH_NAME == 'devel-staging') { deviceStage("build release-tizi-staging", "tizi-needs-can", [], [ - step("build release-tizi-staging", "RELEASE_BRANCH=release-tizi-staging,release-mici-staging $SOURCE_DIR/release/build_release.sh"), + step("build release-tizi-staging", "RELEASE_BRANCH=release-tizi-staging,release-mici-staging $SOURCE_DIR/tools/release/build_release.sh"), ]) } @@ -187,12 +189,12 @@ node { parallel ( 'nightly': { deviceStage("build nightly", "tizi-needs-can", [], [ - step("build nightly", "RELEASE_BRANCH=nightly $SOURCE_DIR/release/build_release.sh"), + step("build nightly", "RELEASE_BRANCH=nightly $SOURCE_DIR/tools/release/build_release.sh"), ]) }, 'nightly-dev': { deviceStage("build nightly-dev", "tizi-needs-can", [], [ - step("build nightly-dev", "PANDA_DEBUG_BUILD=1 RELEASE_BRANCH=nightly-dev $SOURCE_DIR/release/build_release.sh"), + step("build nightly-dev", "PANDA_DEBUG_BUILD=1 RELEASE_BRANCH=nightly-dev $SOURCE_DIR/tools/release/build_release.sh"), ]) }, ) @@ -203,7 +205,7 @@ node { 'onroad tests': { deviceStage("onroad", "tizi-needs-can", ["UNSAFE=1"], [ step("build openpilot", "cd openpilot/system/manager && ./build.py"), - step("check dirty", "release/check-dirty.sh"), + step("check dirty", "tools/release/check-dirty.sh"), step("onroad tests", "pytest openpilot/selfdrive/test/test_onroad.py -s", [timeout: 60]), ]) }, @@ -211,7 +213,7 @@ node { deviceStage("tizi-hardware", "tizi-common", ["UNSAFE=1"], [ step("build", "cd openpilot/system/manager && ./build.py"), step("test power draw", "pytest -s openpilot/selfdrive/test//test_power_draw.py"), - step("test encoder", "LD_LIBRARY_PATH=/usr/local/lib pytest openpilot/system/loggerd/tests/test_encoder.py", [diffPaths: ["openpilot/system/loggerd/"]]), + step("test encoder", "pytest openpilot/system/loggerd/tests/test_encoder.py", [diffPaths: ["openpilot/system/loggerd/"]]), step("test manager", "pytest openpilot/system/manager/test/test_manager.py"), ]) }, diff --git a/openpilot/tools/scripts/mem_usage.py b/openpilot/selfdrive/test/mem_usage.py old mode 100755 new mode 100644 similarity index 90% rename from openpilot/tools/scripts/mem_usage.py rename to openpilot/selfdrive/test/mem_usage.py index bc0e97e7ca..1446d0b4dc --- a/openpilot/tools/scripts/mem_usage.py +++ b/openpilot/selfdrive/test/mem_usage.py @@ -1,12 +1,9 @@ -#!/usr/bin/env python3 -import argparse import os from collections import defaultdict import numpy as np from openpilot.common.utils import tabulate -from openpilot.tools.lib.logreader import LogReader DEMO_ROUTE = "5beb9b58bd12b691/0000010a--a51155e496" MB = 1024 * 1024 @@ -210,29 +207,3 @@ def print_report(proc_logs, device_states=None): print_process_tables(op_procs, other_procs, total_mb, use_pss) print_memory_accounting(proc_logs, op_procs, other_procs, total_mb, use_pss) - - -if __name__ == "__main__": - parser = argparse.ArgumentParser(description="Analyze memory usage from route logs") - parser.add_argument("route", nargs="?", default=None, help="route ID or local rlog path") - parser.add_argument("--demo", action="store_true", help=f"use demo route ({DEMO_ROUTE})") - args = parser.parse_args() - - if args.demo: - route = DEMO_ROUTE - elif args.route: - route = args.route - else: - parser.error("provide a route or use --demo") - - print(f"Reading logs from: {route}") - - proc_logs = [] - device_states = [] - for msg in LogReader(route): - if msg.which() == 'procLog': - proc_logs.append(msg) - elif msg.which() == 'deviceState': - device_states.append(msg) - - print_report(proc_logs, device_states) diff --git a/openpilot/selfdrive/test/test_onroad.py b/openpilot/selfdrive/test/test_onroad.py index 56ea9dbd06..b2192b0d5a 100644 --- a/openpilot/selfdrive/test/test_onroad.py +++ b/openpilot/selfdrive/test/test_onroad.py @@ -283,7 +283,7 @@ class TestOnroad: print("--------------- Memory Usage -------------------") print("------------------------------------------------") - from openpilot.tools.scripts.mem_usage import print_report + from openpilot.selfdrive.test.mem_usage import print_report print_report(self.msgs['procLog'], self.msgs['deviceState']) offset = int(SERVICE_LIST['deviceState'].frequency * LOG_OFFSET) diff --git a/scripts/post-commit b/scripts/post-commit index 399b73c523..f9964639de 100755 --- a/scripts/post-commit +++ b/scripts/post-commit @@ -3,5 +3,5 @@ set -e if [[ -f .git/hooks/post-commit.d/post-commit ]]; then .git/hooks/post-commit.d/post-commit fi -openpilot/tools/op.sh lint --fast +tools/op.sh lint --fast echo "" diff --git a/openpilot/tools/CTF.md b/tools/CTF.md similarity index 100% rename from openpilot/tools/CTF.md rename to tools/CTF.md diff --git a/openpilot/tools/README.md b/tools/README.md similarity index 97% rename from openpilot/tools/README.md rename to tools/README.md index 522bb38868..1ea42bbe1d 100644 --- a/openpilot/tools/README.md +++ b/tools/README.md @@ -18,7 +18,7 @@ git clone https://github.com/commaai/openpilot.git **2. Run the setup script** ``` bash cd openpilot -openpilot/tools/op.sh setup +tools/op.sh setup ``` **3. Activate a Python shell** @@ -41,7 +41,7 @@ Follow [these instructions](https://docs.microsoft.com/en-us/windows/wsl/install **NOTE**: If you are running WSL 2 and experiencing performance issues with the UI or simulator, you may need to explicitly enable hardware acceleration by setting `GALLIUM_DRIVER=d3d12` before commands. Add `export GALLIUM_DRIVER=d3d12` to your `~/.bashrc` file to make it automatic for future sessions. ## CTF -Learn about the openpilot ecosystem and tools by playing our [CTF](/openpilot/tools/CTF.md). +Learn about the openpilot ecosystem and tools by playing our [CTF](/tools/CTF.md). ## Directory Structure diff --git a/openpilot/tools/car_porting/README.md b/tools/car_porting/README.md similarity index 87% rename from openpilot/tools/car_porting/README.md rename to tools/car_porting/README.md index 3766978e97..07ca2d0eba 100644 --- a/openpilot/tools/car_porting/README.md +++ b/tools/car_porting/README.md @@ -1,4 +1,4 @@ -# openpilot/tools/car_porting +# tools/car_porting Check out [this blog post](https://blog.comma.ai/how-to-write-a-car-port-for-openpilot/) for a high-level overview of porting a car. @@ -15,13 +15,13 @@ Example: > openpilot/tools/cabana/cabana '1bbe6bf2d62f58a8|2022-07-14--17-11-43' ``` -### [openpilot/tools/car_porting/auto_fingerprint.py](/openpilot/tools/car_porting/auto_fingerprint.py) +### [tools/car_porting/auto_fingerprint.py](/tools/car_porting/auto_fingerprint.py) Given a route and platform, automatically inserts FW fingerprints from the platform into the correct place in fingerprints.py Example: ```bash -> python3 openpilot/tools/car_porting/auto_fingerprint.py '1bbe6bf2d62f58a8|2022-07-14--17-11-43' 'OUTBACK' +> python3 tools/car_porting/auto_fingerprint.py '1bbe6bf2d62f58a8|2022-07-14--17-11-43' 'OUTBACK' Attempting to add fw version for: OUTBACK ``` @@ -39,13 +39,13 @@ FAILED openpilot/selfdrive/car/tests/test_car_interfaces.py::TestCarInterfaces:: ``` -### [openpilot/tools/car_porting/test_car_model.py](/openpilot/tools/car_porting/test_car_model.py) +### [tools/car_porting/test_car_model.py](/tools/car_porting/test_car_model.py) Given a route, runs most of the car interface to check for common errors like missing signals, blocked panda messages, and safety mismatches. #### Example: panda safety mismatch for gasPressed ```bash -> python3 openpilot/tools/car_porting/test_car_model.py '4822a427b188122a|2023-08-14--16-22-21' +> python3 tools/car_porting/test_car_model.py '4822a427b188122a|2023-08-14--16-22-21' ===================================================================== FAIL: test_panda_safety_carstate (__main__.CarModelTestCase.test_panda_safety_carstate) @@ -59,7 +59,7 @@ AssertionError: 1 is not false : panda safety doesn't agree with openpilot: {'ga ## Jupyter notebooks -To use these notebooks, install Jupyter within your [openpilot virtual environment](/openpilot/tools/README.md). +To use these notebooks, install Jupyter within your [openpilot virtual environment](/tools/README.md). ```bash uv pip install jupyter ipykernel @@ -71,7 +71,7 @@ Launching: jupyter notebook ``` -### [examples/subaru_steer_temp_fault.ipynb](/openpilot/tools/car_porting/examples/subaru_steer_temp_fault.ipynb) +### [examples/subaru_steer_temp_fault.ipynb](/tools/car_porting/examples/subaru_steer_temp_fault.ipynb) An example of searching through a database of segments for a specific condition, and plotting the results. @@ -79,7 +79,7 @@ An example of searching through a database of segments for a specific condition, *a plot of the steer_warning vs steering angle, where we can see it is clearly caused by a large steering angle change* -### [examples/subaru_long_accel.ipynb](/openpilot/tools/car_porting/examples/subaru_long_accel.ipynb) +### [examples/subaru_long_accel.ipynb](/tools/car_porting/examples/subaru_long_accel.ipynb) An example of plotting the response of an actuator when it is active. @@ -87,7 +87,7 @@ An example of plotting the response of an actuator when it is active. *a plot of the brake_pressure vs acceleration, where we can see it is a fairly linear response.* -### [examples/ford_vin_fingerprint.ipynb](/openpilot/tools/car_porting/examples/ford_vin_fingerprint.ipynb) +### [examples/ford_vin_fingerprint.ipynb](/tools/car_porting/examples/ford_vin_fingerprint.ipynb) In this example, we use the public comma car segments database to check if vin fingerprinting is feasible for ford. @@ -109,7 +109,7 @@ vin: 3FTTW8E31PRXXXXXX real platform: FORD MAVERICK 1ST GEN determi vin: 3FTTW8E99NRXXXXXX real platform: FORD MAVERICK 1ST GEN determined platform: mock correct: False ``` -### [examples/find_segments_with_message.ipynb](/openpilot/tools/car_porting/examples/find_segments_with_message.ipynb) +### [examples/find_segments_with_message.ipynb](/tools/car_porting/examples/find_segments_with_message.ipynb) Searches for segments where a set of given CAN message IDs are present. In the example, we search for all messages used for CAN-based ignition detection. diff --git a/openpilot/tools/car_porting/auto_fingerprint.py b/tools/car_porting/auto_fingerprint.py similarity index 100% rename from openpilot/tools/car_porting/auto_fingerprint.py rename to tools/car_porting/auto_fingerprint.py diff --git a/openpilot/tools/car_porting/examples/find_segments_with_message.ipynb b/tools/car_porting/examples/find_segments_with_message.ipynb similarity index 100% rename from openpilot/tools/car_porting/examples/find_segments_with_message.ipynb rename to tools/car_porting/examples/find_segments_with_message.ipynb diff --git a/openpilot/tools/car_porting/examples/ford_vin_fingerprint.ipynb b/tools/car_porting/examples/ford_vin_fingerprint.ipynb similarity index 100% rename from openpilot/tools/car_porting/examples/ford_vin_fingerprint.ipynb rename to tools/car_porting/examples/ford_vin_fingerprint.ipynb diff --git a/openpilot/tools/car_porting/examples/hkg_canfd_gear_message.ipynb b/tools/car_porting/examples/hkg_canfd_gear_message.ipynb similarity index 100% rename from openpilot/tools/car_porting/examples/hkg_canfd_gear_message.ipynb rename to tools/car_porting/examples/hkg_canfd_gear_message.ipynb diff --git a/openpilot/tools/car_porting/examples/subaru_fuzzy_fingerprint.ipynb b/tools/car_porting/examples/subaru_fuzzy_fingerprint.ipynb similarity index 100% rename from openpilot/tools/car_porting/examples/subaru_fuzzy_fingerprint.ipynb rename to tools/car_porting/examples/subaru_fuzzy_fingerprint.ipynb diff --git a/openpilot/tools/car_porting/examples/subaru_long_accel.ipynb b/tools/car_porting/examples/subaru_long_accel.ipynb similarity index 100% rename from openpilot/tools/car_porting/examples/subaru_long_accel.ipynb rename to tools/car_porting/examples/subaru_long_accel.ipynb diff --git a/openpilot/tools/car_porting/examples/subaru_steer_temp_fault.ipynb b/tools/car_porting/examples/subaru_steer_temp_fault.ipynb similarity index 100% rename from openpilot/tools/car_porting/examples/subaru_steer_temp_fault.ipynb rename to tools/car_porting/examples/subaru_steer_temp_fault.ipynb diff --git a/openpilot/tools/car_porting/measure_steering_accuracy.py b/tools/car_porting/measure_steering_accuracy.py similarity index 100% rename from openpilot/tools/car_porting/measure_steering_accuracy.py rename to tools/car_porting/measure_steering_accuracy.py diff --git a/openpilot/tools/car_porting/test_car_model.py b/tools/car_porting/test_car_model.py similarity index 100% rename from openpilot/tools/car_porting/test_car_model.py rename to tools/car_porting/test_car_model.py diff --git a/openpilot/tools/op.sh b/tools/op.sh similarity index 98% rename from openpilot/tools/op.sh rename to tools/op.sh index 3d0af526ba..d8de248c24 100755 --- a/openpilot/tools/op.sh +++ b/tools/op.sh @@ -201,7 +201,7 @@ function op_setup() { echo "Installing dependencies..." st="$(date +%s)" - SETUP_SCRIPT="openpilot/tools/setup_dependencies.sh" + SETUP_SCRIPT="tools/setup_dependencies.sh" if ! $OPENPILOT_ROOT/$SETUP_SCRIPT; then echo -e " ↳ [${RED}✗${NC}] Dependencies installation failed!" return 1 @@ -269,12 +269,12 @@ function op_venv() { function op_adb() { op_before_cmd - op_run_command openpilot/tools/scripts/adb_ssh.sh "$@" + op_run_command tools/scripts/adb_ssh.sh "$@" } function op_ssh() { op_before_cmd - op_run_command openpilot/tools/scripts/ssh.py "$@" + op_run_command tools/scripts/ssh.py "$@" } function op_script() { diff --git a/release/README.md b/tools/release/README.md similarity index 88% rename from release/README.md rename to tools/release/README.md index f3dcefd587..862836bf90 100644 --- a/release/README.md +++ b/tools/release/README.md @@ -11,7 +11,7 @@ - [ ] push the new branch - [ ] push to staging: - [ ] make sure you are on the newly created release master branch (`zerotentwo`) - - [ ] run `BRANCH=devel-staging release/build_stripped.sh`. Jenkins will then automatically build staging on device, run `test_onroad` and update the staging branch + - [ ] run `BRANCH=devel-staging tools/release/build_stripped.sh`. Jenkins will then automatically build staging on device, run `test_onroad` and update the staging branch - [ ] bump version on master: `openpilot/common/version.h` and `RELEASES.md` - [ ] post on Discord, tag `@release crew` diff --git a/release/build_release.sh b/tools/release/build_release.sh similarity index 94% rename from release/build_release.sh rename to tools/release/build_release.sh index 4f609aea3f..cf03c8b393 100755 --- a/release/build_release.sh +++ b/tools/release/build_release.sh @@ -33,7 +33,7 @@ git checkout --orphan $BUILD_BRANCH # do the files copy echo "[-] copying files T=$SECONDS" cd $SOURCE_DIR -cp -pR --parents $(./release/release_files.py) $BUILD_DIR/ +cp -pR --parents $(./tools/release/release_files.py) $BUILD_DIR/ # in the directory cd $BUILD_DIR @@ -73,7 +73,7 @@ find . -name '*.os' -delete find . -name '*.pyc' -delete find . -name 'moc_*' -delete find . -name '__pycache__' -delete -rm -rf .sconsign.dblite Jenkinsfile release/ +rm -rf .sconsign.dblite Jenkinsfile tools/release/ rm -f openpilot/selfdrive/modeld/models/*.onnx* # Mark as prebuilt release diff --git a/release/build_stripped.sh b/tools/release/build_stripped.sh similarity index 97% rename from release/build_stripped.sh rename to tools/release/build_stripped.sh index ea74aac859..1892360f6d 100755 --- a/release/build_stripped.sh +++ b/tools/release/build_stripped.sh @@ -38,7 +38,7 @@ git submodule foreach --recursive git clean -xdff # do the files copy echo "[-] copying files T=$SECONDS" cd $SOURCE_DIR -cp -pR --parents $(./release/release_files.py) $TARGET_DIR/ +cp -pR --parents $(./tools/release/release_files.py) $TARGET_DIR/ # in the directory cd $TARGET_DIR diff --git a/release/check-dirty.sh b/tools/release/check-dirty.sh similarity index 100% rename from release/check-dirty.sh rename to tools/release/check-dirty.sh diff --git a/release/check-submodules.sh b/tools/release/check-submodules.sh similarity index 100% rename from release/check-submodules.sh rename to tools/release/check-submodules.sh diff --git a/release/identity.sh b/tools/release/identity.sh similarity index 100% rename from release/identity.sh rename to tools/release/identity.sh diff --git a/release/pack.py b/tools/release/pack.py similarity index 100% rename from release/pack.py rename to tools/release/pack.py diff --git a/release/release_files.py b/tools/release/release_files.py similarity index 93% rename from release/release_files.py rename to tools/release/release_files.py index 36910293a4..dd6b16253c 100755 --- a/release/release_files.py +++ b/tools/release/release_files.py @@ -4,7 +4,7 @@ import re from pathlib import Path HERE = os.path.abspath(os.path.dirname(__file__)) -ROOT = HERE + "/.." +ROOT = os.path.abspath(os.path.join(HERE, "../..")) blacklist = [ ".git/", diff --git a/openpilot/tools/scripts/__init__.py b/tools/scripts/__init__.py similarity index 100% rename from openpilot/tools/scripts/__init__.py rename to tools/scripts/__init__.py diff --git a/openpilot/tools/scripts/adb_ssh.sh b/tools/scripts/adb_ssh.sh similarity index 100% rename from openpilot/tools/scripts/adb_ssh.sh rename to tools/scripts/adb_ssh.sh diff --git a/openpilot/tools/scripts/car/can_print_changes.py b/tools/scripts/car/can_print_changes.py similarity index 98% rename from openpilot/tools/scripts/car/can_print_changes.py rename to tools/scripts/car/can_print_changes.py index 1db29c3d37..e466cd2968 100755 --- a/openpilot/tools/scripts/car/can_print_changes.py +++ b/tools/scripts/car/can_print_changes.py @@ -5,7 +5,7 @@ import time from collections import defaultdict import openpilot.cereal.messaging as messaging -from openpilot.tools.scripts.can_table import can_table +from tools.scripts.car.can_table import can_table from openpilot.tools.lib.logreader import LogIterable, LogReader RED = '\033[91m' diff --git a/openpilot/tools/scripts/car/can_printer.py b/tools/scripts/car/can_printer.py similarity index 100% rename from openpilot/tools/scripts/car/can_printer.py rename to tools/scripts/car/can_printer.py diff --git a/openpilot/tools/scripts/car/can_table.py b/tools/scripts/car/can_table.py similarity index 100% rename from openpilot/tools/scripts/car/can_table.py rename to tools/scripts/car/can_table.py diff --git a/openpilot/tools/scripts/car/clear_dtc.py b/tools/scripts/car/clear_dtc.py similarity index 100% rename from openpilot/tools/scripts/car/clear_dtc.py rename to tools/scripts/car/clear_dtc.py diff --git a/openpilot/tools/scripts/car/disable_ecu.py b/tools/scripts/car/disable_ecu.py similarity index 100% rename from openpilot/tools/scripts/car/disable_ecu.py rename to tools/scripts/car/disable_ecu.py diff --git a/openpilot/tools/scripts/car/ecu_addrs.py b/tools/scripts/car/ecu_addrs.py similarity index 100% rename from openpilot/tools/scripts/car/ecu_addrs.py rename to tools/scripts/car/ecu_addrs.py diff --git a/openpilot/tools/scripts/car/fw_versions.py b/tools/scripts/car/fw_versions.py similarity index 100% rename from openpilot/tools/scripts/car/fw_versions.py rename to tools/scripts/car/fw_versions.py diff --git a/openpilot/tools/scripts/car/hyundai_enable_radar_points.py b/tools/scripts/car/hyundai_enable_radar_points.py similarity index 100% rename from openpilot/tools/scripts/car/hyundai_enable_radar_points.py rename to tools/scripts/car/hyundai_enable_radar_points.py diff --git a/openpilot/tools/scripts/car/max_lat_accel.py b/tools/scripts/car/max_lat_accel.py similarity index 100% rename from openpilot/tools/scripts/car/max_lat_accel.py rename to tools/scripts/car/max_lat_accel.py diff --git a/openpilot/tools/scripts/car/measure_torque_time_to_max.py b/tools/scripts/car/measure_torque_time_to_max.py similarity index 100% rename from openpilot/tools/scripts/car/measure_torque_time_to_max.py rename to tools/scripts/car/measure_torque_time_to_max.py diff --git a/openpilot/tools/scripts/car/read_dtc_status.py b/tools/scripts/car/read_dtc_status.py similarity index 100% rename from openpilot/tools/scripts/car/read_dtc_status.py rename to tools/scripts/car/read_dtc_status.py diff --git a/openpilot/tools/scripts/car/toyota_eps_factor.py b/tools/scripts/car/toyota_eps_factor.py similarity index 100% rename from openpilot/tools/scripts/car/toyota_eps_factor.py rename to tools/scripts/car/toyota_eps_factor.py diff --git a/openpilot/tools/scripts/car/vin.py b/tools/scripts/car/vin.py similarity index 100% rename from openpilot/tools/scripts/car/vin.py rename to tools/scripts/car/vin.py diff --git a/openpilot/tools/scripts/car/vw_mqb_config.py b/tools/scripts/car/vw_mqb_config.py similarity index 100% rename from openpilot/tools/scripts/car/vw_mqb_config.py rename to tools/scripts/car/vw_mqb_config.py diff --git a/openpilot/tools/scripts/count_events.py b/tools/scripts/count_events.py similarity index 100% rename from openpilot/tools/scripts/count_events.py rename to tools/scripts/count_events.py diff --git a/openpilot/tools/scripts/cpu_usage_stat.py b/tools/scripts/cpu_usage_stat.py similarity index 100% rename from openpilot/tools/scripts/cpu_usage_stat.py rename to tools/scripts/cpu_usage_stat.py diff --git a/openpilot/tools/scripts/cycle_alerts.py b/tools/scripts/cycle_alerts.py similarity index 100% rename from openpilot/tools/scripts/cycle_alerts.py rename to tools/scripts/cycle_alerts.py diff --git a/openpilot/tools/scripts/debug_fw_fingerprinting_offline.py b/tools/scripts/debug_fw_fingerprinting_offline.py similarity index 100% rename from openpilot/tools/scripts/debug_fw_fingerprinting_offline.py rename to tools/scripts/debug_fw_fingerprinting_offline.py diff --git a/openpilot/tools/scripts/devsync.py b/tools/scripts/devsync.py similarity index 100% rename from openpilot/tools/scripts/devsync.py rename to tools/scripts/devsync.py diff --git a/openpilot/tools/scripts/dump.py b/tools/scripts/dump.py similarity index 100% rename from openpilot/tools/scripts/dump.py rename to tools/scripts/dump.py diff --git a/openpilot/tools/scripts/extract_audio.py b/tools/scripts/extract_audio.py similarity index 100% rename from openpilot/tools/scripts/extract_audio.py rename to tools/scripts/extract_audio.py diff --git a/openpilot/tools/scripts/filter_log_message.py b/tools/scripts/filter_log_message.py similarity index 100% rename from openpilot/tools/scripts/filter_log_message.py rename to tools/scripts/filter_log_message.py diff --git a/openpilot/tools/scripts/fingerprint_from_route.py b/tools/scripts/fingerprint_from_route.py similarity index 100% rename from openpilot/tools/scripts/fingerprint_from_route.py rename to tools/scripts/fingerprint_from_route.py diff --git a/openpilot/tools/scripts/fuzz_fw_fingerprint.py b/tools/scripts/fuzz_fw_fingerprint.py similarity index 100% rename from openpilot/tools/scripts/fuzz_fw_fingerprint.py rename to tools/scripts/fuzz_fw_fingerprint.py diff --git a/openpilot/tools/scripts/get_fingerprint.py b/tools/scripts/get_fingerprint.py similarity index 100% rename from openpilot/tools/scripts/get_fingerprint.py rename to tools/scripts/get_fingerprint.py diff --git a/openpilot/tools/scripts/live_cpu_and_temp.py b/tools/scripts/live_cpu_and_temp.py similarity index 100% rename from openpilot/tools/scripts/live_cpu_and_temp.py rename to tools/scripts/live_cpu_and_temp.py diff --git a/tools/scripts/mem_usage.py b/tools/scripts/mem_usage.py new file mode 100755 index 0000000000..9b13a56ce2 --- /dev/null +++ b/tools/scripts/mem_usage.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 +import argparse +import os +import sys + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) + +from openpilot.selfdrive.test.mem_usage import DEMO_ROUTE, print_report +from openpilot.tools.lib.logreader import LogReader + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="Analyze memory usage from route logs") + parser.add_argument("route", nargs="?", default=None, help="route ID or local rlog path") + parser.add_argument("--demo", action="store_true", help=f"use demo route ({DEMO_ROUTE})") + args = parser.parse_args() + + if args.demo: + route = DEMO_ROUTE + elif args.route: + route = args.route + else: + parser.error("provide a route or use --demo") + + print(f"Reading logs from: {route}") + + proc_logs = [] + device_states = [] + for msg in LogReader(route): + if msg.which() == 'procLog': + proc_logs.append(msg) + elif msg.which() == 'deviceState': + device_states.append(msg) + + print_report(proc_logs, device_states) diff --git a/openpilot/tools/scripts/print_flags.py b/tools/scripts/print_flags.py similarity index 100% rename from openpilot/tools/scripts/print_flags.py rename to tools/scripts/print_flags.py diff --git a/openpilot/tools/scripts/profiling/clpeak/.gitignore b/tools/scripts/profiling/clpeak/.gitignore similarity index 100% rename from openpilot/tools/scripts/profiling/clpeak/.gitignore rename to tools/scripts/profiling/clpeak/.gitignore diff --git a/openpilot/tools/scripts/profiling/clpeak/build.sh b/tools/scripts/profiling/clpeak/build.sh similarity index 100% rename from openpilot/tools/scripts/profiling/clpeak/build.sh rename to tools/scripts/profiling/clpeak/build.sh diff --git a/openpilot/tools/scripts/profiling/clpeak/no_print.patch b/tools/scripts/profiling/clpeak/no_print.patch similarity index 100% rename from openpilot/tools/scripts/profiling/clpeak/no_print.patch rename to tools/scripts/profiling/clpeak/no_print.patch diff --git a/openpilot/tools/scripts/profiling/clpeak/run_continuously.patch b/tools/scripts/profiling/clpeak/run_continuously.patch similarity index 100% rename from openpilot/tools/scripts/profiling/clpeak/run_continuously.patch rename to tools/scripts/profiling/clpeak/run_continuously.patch diff --git a/openpilot/tools/scripts/profiling/ftrace.sh b/tools/scripts/profiling/ftrace.sh similarity index 100% rename from openpilot/tools/scripts/profiling/ftrace.sh rename to tools/scripts/profiling/ftrace.sh diff --git a/openpilot/tools/scripts/profiling/palanteer/.gitignore b/tools/scripts/profiling/palanteer/.gitignore similarity index 100% rename from openpilot/tools/scripts/profiling/palanteer/.gitignore rename to tools/scripts/profiling/palanteer/.gitignore diff --git a/openpilot/tools/scripts/profiling/palanteer/setup.sh b/tools/scripts/profiling/palanteer/setup.sh similarity index 100% rename from openpilot/tools/scripts/profiling/palanteer/setup.sh rename to tools/scripts/profiling/palanteer/setup.sh diff --git a/openpilot/tools/scripts/profiling/perfetto/.gitignore b/tools/scripts/profiling/perfetto/.gitignore similarity index 100% rename from openpilot/tools/scripts/profiling/perfetto/.gitignore rename to tools/scripts/profiling/perfetto/.gitignore diff --git a/openpilot/tools/scripts/profiling/perfetto/build.sh b/tools/scripts/profiling/perfetto/build.sh similarity index 100% rename from openpilot/tools/scripts/profiling/perfetto/build.sh rename to tools/scripts/profiling/perfetto/build.sh diff --git a/openpilot/tools/scripts/profiling/perfetto/copy.sh b/tools/scripts/profiling/perfetto/copy.sh similarity index 100% rename from openpilot/tools/scripts/profiling/perfetto/copy.sh rename to tools/scripts/profiling/perfetto/copy.sh diff --git a/openpilot/tools/scripts/profiling/perfetto/record.sh b/tools/scripts/profiling/perfetto/record.sh similarity index 100% rename from openpilot/tools/scripts/profiling/perfetto/record.sh rename to tools/scripts/profiling/perfetto/record.sh diff --git a/openpilot/tools/scripts/profiling/perfetto/server.sh b/tools/scripts/profiling/perfetto/server.sh similarity index 100% rename from openpilot/tools/scripts/profiling/perfetto/server.sh rename to tools/scripts/profiling/perfetto/server.sh diff --git a/openpilot/tools/scripts/profiling/perfetto/traces.sh b/tools/scripts/profiling/perfetto/traces.sh similarity index 100% rename from openpilot/tools/scripts/profiling/perfetto/traces.sh rename to tools/scripts/profiling/perfetto/traces.sh diff --git a/openpilot/tools/scripts/profiling/py-spy/profile.sh b/tools/scripts/profiling/py-spy/profile.sh similarity index 100% rename from openpilot/tools/scripts/profiling/py-spy/profile.sh rename to tools/scripts/profiling/py-spy/profile.sh diff --git a/openpilot/tools/scripts/profiling/snapdragon/.gitignore b/tools/scripts/profiling/snapdragon/.gitignore similarity index 100% rename from openpilot/tools/scripts/profiling/snapdragon/.gitignore rename to tools/scripts/profiling/snapdragon/.gitignore diff --git a/openpilot/tools/scripts/profiling/snapdragon/README.md b/tools/scripts/profiling/snapdragon/README.md similarity index 100% rename from openpilot/tools/scripts/profiling/snapdragon/README.md rename to tools/scripts/profiling/snapdragon/README.md diff --git a/openpilot/tools/scripts/profiling/snapdragon/setup-agnos.sh b/tools/scripts/profiling/snapdragon/setup-agnos.sh similarity index 100% rename from openpilot/tools/scripts/profiling/snapdragon/setup-agnos.sh rename to tools/scripts/profiling/snapdragon/setup-agnos.sh diff --git a/openpilot/tools/scripts/profiling/snapdragon/setup-profiler.sh b/tools/scripts/profiling/snapdragon/setup-profiler.sh similarity index 100% rename from openpilot/tools/scripts/profiling/snapdragon/setup-profiler.sh rename to tools/scripts/profiling/snapdragon/setup-profiler.sh diff --git a/openpilot/tools/scripts/profiling/watch-irqs.sh b/tools/scripts/profiling/watch-irqs.sh similarity index 100% rename from openpilot/tools/scripts/profiling/watch-irqs.sh rename to tools/scripts/profiling/watch-irqs.sh diff --git a/openpilot/tools/scripts/qlog_size.py b/tools/scripts/qlog_size.py similarity index 100% rename from openpilot/tools/scripts/qlog_size.py rename to tools/scripts/qlog_size.py diff --git a/openpilot/tools/scripts/run_process_on_route.py b/tools/scripts/run_process_on_route.py similarity index 100% rename from openpilot/tools/scripts/run_process_on_route.py rename to tools/scripts/run_process_on_route.py diff --git a/openpilot/tools/scripts/serial.sh b/tools/scripts/serial.sh similarity index 100% rename from openpilot/tools/scripts/serial.sh rename to tools/scripts/serial.sh diff --git a/openpilot/tools/scripts/set_car_params.py b/tools/scripts/set_car_params.py similarity index 100% rename from openpilot/tools/scripts/set_car_params.py rename to tools/scripts/set_car_params.py diff --git a/openpilot/tools/scripts/setup_ssh_keys.py b/tools/scripts/setup_ssh_keys.py similarity index 100% rename from openpilot/tools/scripts/setup_ssh_keys.py rename to tools/scripts/setup_ssh_keys.py diff --git a/openpilot/tools/scripts/ssh.py b/tools/scripts/ssh.py similarity index 100% rename from openpilot/tools/scripts/ssh.py rename to tools/scripts/ssh.py diff --git a/openpilot/tools/scripts/test_fw_query_on_routes.py b/tools/scripts/test_fw_query_on_routes.py similarity index 100% rename from openpilot/tools/scripts/test_fw_query_on_routes.py rename to tools/scripts/test_fw_query_on_routes.py diff --git a/openpilot/tools/scripts/uiview.py b/tools/scripts/uiview.py similarity index 100% rename from openpilot/tools/scripts/uiview.py rename to tools/scripts/uiview.py diff --git a/openpilot/tools/scripts/watch_timings.py b/tools/scripts/watch_timings.py similarity index 100% rename from openpilot/tools/scripts/watch_timings.py rename to tools/scripts/watch_timings.py diff --git a/openpilot/tools/setup.sh b/tools/setup.sh similarity index 96% rename from openpilot/tools/setup.sh rename to tools/setup.sh index 1437a1d686..dafd466ef9 100755 --- a/openpilot/tools/setup.sh +++ b/tools/setup.sh @@ -121,10 +121,10 @@ function git_clone() { function install_with_op() { cd $OPENPILOT_ROOT - $OPENPILOT_ROOT/openpilot/tools/op.sh install - $OPENPILOT_ROOT/openpilot/tools/op.sh post-commit + $OPENPILOT_ROOT/tools/op.sh install + $OPENPILOT_ROOT/tools/op.sh post-commit - if ! $OPENPILOT_ROOT/openpilot/tools/op.sh setup; then + if ! $OPENPILOT_ROOT/tools/op.sh setup; then echo -e "\n[${RED}✗${NC}] failed to install openpilot!" return 1 fi diff --git a/openpilot/tools/setup_dependencies.sh b/tools/setup_dependencies.sh similarity index 100% rename from openpilot/tools/setup_dependencies.sh rename to tools/setup_dependencies.sh