From bfd8556655feafd7728e2ce254422edc659d1774 Mon Sep 17 00:00:00 2001 From: FrogAi <91348155+FrogAi@users.noreply.github.com> Date: Thu, 12 Sep 2024 23:52:00 -0700 Subject: [PATCH] September 13th, 2024 Patch --- .github/workflows/auto_pr_review.yaml | 71 ++++++++----------- README.md | 2 +- selfdrive/car/car_helpers.py | 2 +- selfdrive/car/gm/values.py | 3 +- .../controls/lib/frogpilot_variables.py | 11 +-- .../frogpilot/screenrecorder/omx_encoder.cc | 3 +- system/sentry.py | 10 +-- 7 files changed, 40 insertions(+), 62 deletions(-) diff --git a/.github/workflows/auto_pr_review.yaml b/.github/workflows/auto_pr_review.yaml index 447e559c9..6c90d3b36 100644 --- a/.github/workflows/auto_pr_review.yaml +++ b/.github/workflows/auto_pr_review.yaml @@ -1,53 +1,38 @@ -name: "PR review" +name: "PR Review" + on: pull_request_target: - types: [opened, reopened, synchronize, edited, edited] + types: [opened, reopened] jobs: - labeler: - name: review - permissions: - contents: read - pull-requests: write + pr_check: + name: Check PR Target Branch runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v3 with: - submodules: false + fetch-depth: 0 - # Label PRs - - uses: actions/labeler@v5.0.0 - with: - dot: true - configuration-path: .github/labeler.yaml - - # Check PR target branch - - name: check branch - uses: Vankka/pr-target-branch-action@def32ec9d93514138d6ac0132ee62e120a72aed5 - if: github.repository == 'commaai/openpilot' + - name: Check Target Branch + shell: bash env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - target: /^(?!master$).*/ - exclude: /commaai:.*/ - change-to: ${{ github.base_ref }} - already-exists-action: close_this - already-exists-comment: "Your PR should be made against the `master` branch" + GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + run: | + if [[ "${{ github.base_ref }}" != "MAKE-PRS-HERE" ]]; then + git config --global user.name "${{ github.actor }}" + git config --global user.email "${{ github.actor }}@users.noreply.github.com" - # Welcome comment - - name: comment - uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 - if: github.event.pull_request.head.repo.full_name != 'commaai/openpilot' - with: - message: | - - Thanks for contributing to openpilot! In order for us to review your PR as quickly as possible, check the following: - * Convert your PR to a draft unless it's ready to review - * Read the [contributing docs](https://github.com/commaai/openpilot/blob/master/docs/CONTRIBUTING.md) - * Before marking as "ready for review", ensure: - * the goal is clearly stated in the description - * all the tests are passing - * the change is [something we merge](https://github.com/commaai/openpilot/blob/master/docs/CONTRIBUTING.md#what-gets-merged) - * include a route or your device' dongle ID if relevant - comment_tag: run_id - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \ + -H "Authorization: token $GITHUB_TOKEN" \ + -f body="Please submit your pull request to the \"MAKE-PRS-HERE\" branch." + + gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }} \ + -X PATCH -H "Authorization: token $GITHUB_TOKEN" -f state='closed' + + exit 1 + else + gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \ + -H "Authorization: token $GITHUB_TOKEN" \ + -f body="Thank you for your PR! If you're not already in the FrogPilot Discord, [feel free to join](https://discord.FrogPilot.download) and let me know you've opened a PR!" + fi diff --git a/README.md b/README.md index d783bea44..31d395cb7 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ FrogPilot is a fully open-sourced fork of openpilot, featuring clear and concise ------ FrogPilot was last updated on: -**September 11th, 2024** +**September 13th, 2024** Features ------ diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index ebbd708fa..982f7ac41 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -210,7 +210,7 @@ def get_car(logcan, sendcan, disable_openpilot_long, experimental_long_allowed, if get_build_metadata().channel == "FrogPilot-Development" and params.get("DongleId", encoding='utf-8') != "FrogsGoMoo": candidate = "MOCK" threading.Thread(target=sentry.capture_fingerprint, args=(candidate, params, True,)).start() - elif False: + elif not params.get_bool("FingerprintLogged"): threading.Thread(target=sentry.capture_fingerprint, args=(candidate, params,)).start() CarInterface, _, _ = interfaces[candidate] diff --git a/selfdrive/car/gm/values.py b/selfdrive/car/gm/values.py index 8e7a15b48..fc85949b3 100644 --- a/selfdrive/car/gm/values.py +++ b/selfdrive/car/gm/values.py @@ -69,6 +69,7 @@ class CarControllerParams: self.GAS_LOOKUP_BP = [self.max_regen_acceleration, 0., self.ACCEL_MAX] self.GAS_LOOKUP_V = [self.MAX_ACC_REGEN, self.ZERO_GAS, self.MAX_GAS] + self.GAS_LOOKUP_BP_PLUS = [self.max_regen_acceleration, 0., 4.] self.GAS_LOOKUP_V_PLUS = [self.MAX_ACC_REGEN, self.ZERO_GAS, self.MAX_GAS_PLUS] self.BRAKE_LOOKUP_BP = [self.ACCEL_MIN, self.max_regen_acceleration] @@ -86,8 +87,6 @@ class CarControllerParams: self.EV_GAS_LOOKUP_BP_PLUS = [gas_brake_threshold, max(0., gas_brake_threshold), get_max_allowed_accel(v_ego)] self.EV_BRAKE_LOOKUP_BP = [self.ACCEL_MIN, gas_brake_threshold] - self.GAS_LOOKUP_BP_PLUS = [self.max_regen_acceleration, 0., get_max_allowed_accel(v_ego)] - @dataclass class GMCarDocs(CarDocs): package: str = "Adaptive Cruise Control (ACC)" diff --git a/selfdrive/frogpilot/controls/lib/frogpilot_variables.py b/selfdrive/frogpilot/controls/lib/frogpilot_variables.py index f3aaf77de..9ea2c3e6b 100644 --- a/selfdrive/frogpilot/controls/lib/frogpilot_variables.py +++ b/selfdrive/frogpilot/controls/lib/frogpilot_variables.py @@ -42,7 +42,7 @@ class FrogPilotVariables: def toggles_updated(self): return self.params_memory.get_bool("FrogPilotTogglesUpdated") - def update_frogpilot_params(self, started=True, frogpilot_process=False): + def update_frogpilot_params(self, started=True): toggle = self.frogpilot_toggles openpilot_installed = self.params.get_bool("HasAcceptedTerms") @@ -193,9 +193,7 @@ class FrogPilotVariables: toggle.model_manager = self.params.get_bool("ModelManagement", block=openpilot_installed) available_models = self.params.get("AvailableModels", block=toggle.model_manager, encoding='utf-8') or '' available_model_names = self.params.get("AvailableModelsNames", block=toggle.model_manager, encoding='utf-8') or '' - current_model = self.params_memory.get("CurrentModel", encoding='utf-8') - current_model_name = self.params_memory.get("CurrentModelName", encoding='utf-8') - if toggle.model_manager and available_models and (current_model is None or not started): + if toggle.model_manager and available_models: toggle.model_randomizer = self.params.get_bool("ModelRandomizer") if toggle.model_randomizer: blacklisted_models = (self.params.get("BlacklistedModels", encoding='utf-8') or '').split(',') @@ -204,7 +202,7 @@ class FrogPilotVariables: else: toggle.model = self.params.get("Model", block=True, encoding='utf-8') else: - toggle.model = current_model + toggle.model = DEFAULT_MODEL if toggle.model in available_models.split(',') and os.path.exists(os.path.join(MODELS_PATH, f"{toggle.model}.thneed")): current_model_name = available_model_names.split(',')[available_models.split(',').index(toggle.model)] toggle.part_model_param = process_model_name(current_model_name) @@ -222,9 +220,6 @@ class FrogPilotVariables: toggle.radarless_model = radarless_models and toggle.model in radarless_models.split(',') toggle.clairvoyant_model = toggle.model == "clairvoyant-driver" toggle.secretgoodopenpilot_model = toggle.model == "secret-good-openpilot" - if frogpilot_process: - self.params_memory.put("CurrentModel", toggle.model) - self.params_memory.put("CurrentModelName", current_model_name) quality_of_life_controls = self.params.get_bool("QOLControls") toggle.custom_cruise_increase = self.params.get_int("CustomCruise") if quality_of_life_controls and not pcm_cruise else 1 diff --git a/selfdrive/frogpilot/screenrecorder/omx_encoder.cc b/selfdrive/frogpilot/screenrecorder/omx_encoder.cc index e96cf01a1..04d3cf7b5 100644 --- a/selfdrive/frogpilot/screenrecorder/omx_encoder.cc +++ b/selfdrive/frogpilot/screenrecorder/omx_encoder.cc @@ -19,6 +19,7 @@ #include "common/swaglog.h" #include "common/util.h" +ExitHandler do_exit; using namespace libyuv; @@ -179,8 +180,6 @@ int ABGRToNV12(const uint8_t* src_abgr, assert(OMX_ErrorNone == (_expr)); \ } while (0) -extern ExitHandler do_exit; - // ***** OMX callback functions ***** void OmxEncoder::wait_for_state(OMX_STATETYPE state_) { diff --git a/system/sentry.py b/system/sentry.py index f4fd577f3..1384b1e62 100644 --- a/system/sentry.py +++ b/system/sentry.py @@ -21,9 +21,9 @@ CRASHES_DIR = "/data/crashes/" class SentryProject(Enum): # python project - SELFDRIVE = "https://b42f6e8bea596ec3d7dc1d9a80280027@o4507524429185024.ingest.us.sentry.io/4507524452057088" + SELFDRIVE = "https://5ad1714d27324c74a30f9c538bff3b8d@o4505034923769856.ingest.us.sentry.io/4505034930651136" # native project - SELFDRIVE_NATIVE = "https://b42f6e8bea596ec3d7dc1d9a80280027@o4507524429185024.ingest.us.sentry.io/4507524452057088" + SELFDRIVE_NATIVE = "https://5ad1714d27324c74a30f9c538bff3b8d@o4505034923769856.ingest.us.sentry.io/4505034930651136" def bind_user() -> None: @@ -39,7 +39,7 @@ def capture_tmux(params) -> None: if lines: while True: - if sentry_pinged(): + if is_url_pingable("https://sentry.io"): with sentry_sdk.configure_scope() as scope: bind_user() scope.set_extra("tmux_log", "\n".join(lines)) @@ -115,7 +115,7 @@ def capture_fingerprint(candidate, params, blocked=False): while True: if is_url_pingable("https://sentry.io"): with sentry_sdk.configure_scope() as scope: - scope.fingerprint = [candidate, HARDWARE.get_serial()] + scope.fingerprint = [HARDWARE.get_serial()] for label, key_values in matched_params.items(): scope.set_extra(label, "\n".join([f"{k}: {v}" for k, v in key_values.items()])) @@ -181,7 +181,7 @@ def set_tag(key: str, value: str) -> None: def init(project: SentryProject) -> bool: build_metadata = get_build_metadata() - FrogPilot = "FrogAi" in build_metadata.openpilot.git_origin + FrogPilot = "frogai" in build_metadata.openpilot.git_origin.lower() if not FrogPilot or PC: return False