From 013166a34ebbf86b4b64c1618135cf6833d26cda Mon Sep 17 00:00:00 2001 From: George Hotz Date: Fri, 17 Jan 2020 17:28:09 -0800 Subject: [PATCH 1/3] add alert --- selfdrive/car/car_helpers.py | 2 ++ selfdrive/controls/lib/alerts.py | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index 446778861..9f61dcda4 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -10,6 +10,8 @@ from selfdrive.car import gen_empty_fingerprint def get_startup_alert(car_recognized, controller_available): alert = 'startup' + if Params().get("GitBranch") in ['master', 'master-ci']: + alert = 'startupMaster' if not car_recognized: alert = 'startupNoCar' elif car_recognized and not controller_available: diff --git a/selfdrive/controls/lib/alerts.py b/selfdrive/controls/lib/alerts.py index 972a63ef8..31d908052 100644 --- a/selfdrive/controls/lib/alerts.py +++ b/selfdrive/controls/lib/alerts.py @@ -171,6 +171,13 @@ ALERTS = [ AlertStatus.normal, AlertSize.mid, Priority.LOW_LOWEST, VisualAlert.none, AudibleAlert.none, 0., 0., 15.), + Alert( + "startupMaster", + "WARNING: This branch is not tested", + "Always keep hands on wheel and eyes on road", + AlertStatus.userPrompt, AlertSize.mid, + Priority.LOW_LOWEST, VisualAlert.none, AudibleAlert.none, 0., 0., 15.), + Alert( "startupNoControl", "Dashcam mode", From dcd0807d7e859397a72fcb6bb26aca59cfcce25e Mon Sep 17 00:00:00 2001 From: George Hotz Date: Fri, 17 Jan 2020 17:32:17 -0800 Subject: [PATCH 2/3] whitelist, don't blacklist --- selfdrive/car/car_helpers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index 9f61dcda4..6197b28a3 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -10,8 +10,9 @@ from selfdrive.car import gen_empty_fingerprint def get_startup_alert(car_recognized, controller_available): alert = 'startup' - if Params().get("GitBranch") in ['master', 'master-ci']: - alert = 'startupMaster' + if Params().get("GitRemote") in ['git@github.com:commaai/openpilot.git', 'https://github.com/commaai/openpilot.git']: + if Params().get("GitBranch") not in ['devel', 'release2-staging', 'dashcam-staging', 'release2', 'dashcam']: + alert = 'startupMaster' if not car_recognized: alert = 'startupNoCar' elif car_recognized and not controller_available: From c7bc8ee00fe4b1eaa0f7c629a378fbcc64b39a77 Mon Sep 17 00:00:00 2001 From: George Hotz Date: Fri, 17 Jan 2020 17:50:43 -0800 Subject: [PATCH 3/3] python 3 issue --- selfdrive/car/car_helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index 6197b28a3..104c46441 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -10,8 +10,8 @@ from selfdrive.car import gen_empty_fingerprint def get_startup_alert(car_recognized, controller_available): alert = 'startup' - if Params().get("GitRemote") in ['git@github.com:commaai/openpilot.git', 'https://github.com/commaai/openpilot.git']: - if Params().get("GitBranch") not in ['devel', 'release2-staging', 'dashcam-staging', 'release2', 'dashcam']: + if Params().get("GitRemote").decode('utf-8') in ['git@github.com:commaai/openpilot.git', 'https://github.com/commaai/openpilot.git']: + if Params().get("GitBranch").decode('utf-8') not in ['devel', 'release2-staging', 'dashcam-staging', 'release2', 'dashcam']: alert = 'startupMaster' if not car_recognized: alert = 'startupNoCar'