mirror of https://github.com/commaai/openpilot.git
Cleanup startup event handling (#1748)
* cleanup startup event
* always show permanent
* lowest
* update refs
old-commit-hash: ccf6b80c7e
This commit is contained in:
parent
83f6ec221f
commit
e8ced8bee5
|
@ -1,6 +1,7 @@
|
|||
import os
|
||||
from common.params import Params
|
||||
from common.basedir import BASEDIR
|
||||
from selfdrive.version import comma_remote, tested_branch
|
||||
from selfdrive.car.fingerprints import eliminate_incompatible_cars, all_known_cars
|
||||
from selfdrive.car.vin import get_vin, VIN_UNKNOWN
|
||||
from selfdrive.car.fw_versions import get_fw_versions, match_fw_to_car
|
||||
|
@ -13,11 +14,12 @@ EventName = car.CarEvent.EventName
|
|||
HwType = log.HealthData.HwType
|
||||
|
||||
|
||||
def get_startup_event(car_recognized, controller_available, hw_type):
|
||||
event = EventName.startup
|
||||
if Params().get("GitRemote", encoding="utf8") in ['git@github.com:commaai/openpilot.git', 'https://github.com/commaai/openpilot.git']:
|
||||
if Params().get("GitBranch", encoding="utf8") not in ['devel', 'release2-staging', 'dashcam-staging', 'release2', 'dashcam']:
|
||||
event = EventName.startupMaster
|
||||
def get_startup_event(car_recognized, controller_available):
|
||||
if comma_remote and tested_branch:
|
||||
event = EventName.startup
|
||||
else:
|
||||
event = EventName.startupMaster
|
||||
|
||||
if not car_recognized:
|
||||
event = EventName.startupNoCar
|
||||
elif car_recognized and not controller_available:
|
||||
|
|
|
@ -130,7 +130,7 @@ class Controls:
|
|||
self.saturated_count = 0
|
||||
self.distance_traveled = 0
|
||||
self.events_prev = []
|
||||
self.current_alert_types = []
|
||||
self.current_alert_types = [ET.PERMANENT]
|
||||
|
||||
self.sm['liveCalibration'].calStatus = Calibration.INVALID
|
||||
self.sm['thermal'].freeSpace = 1.
|
||||
|
@ -138,7 +138,7 @@ class Controls:
|
|||
self.sm['dMonitoringState'].awarenessStatus = 1.
|
||||
self.sm['dMonitoringState'].faceDetected = False
|
||||
|
||||
self.startup_event = get_startup_event(car_recognized, controller_available, hw_type)
|
||||
self.startup_event = get_startup_event(car_recognized, controller_available)
|
||||
|
||||
if not sounds_available:
|
||||
self.events.add(EventName.soundsUnavailable, static=True)
|
||||
|
|
|
@ -294,7 +294,7 @@ EVENTS = {
|
|||
"Dashcam Mode",
|
||||
"Car Unrecognized",
|
||||
AlertStatus.normal, AlertSize.mid,
|
||||
Priority.LOWER, VisualAlert.none, AudibleAlert.none, 0., 0., .2),
|
||||
Priority.LOWEST, VisualAlert.none, AudibleAlert.none, 0., 0., .2),
|
||||
},
|
||||
|
||||
EventName.stockAeb: {
|
||||
|
|
|
@ -1 +1 @@
|
|||
fe829cbe7ff161f098f680f3bfe3b8daeba2f220
|
||||
a8b50cfc06473f66896b3f74a562263d3cccec36
|
|
@ -46,6 +46,8 @@ training_version = b"0.2.0"
|
|||
terms_version = b"2"
|
||||
|
||||
dirty = True
|
||||
comma_remote = False
|
||||
tested_branch = False
|
||||
origin = get_git_remote()
|
||||
branch = get_git_full_branchname()
|
||||
|
||||
|
@ -58,6 +60,7 @@ try:
|
|||
|
||||
if (origin is not None) and (branch is not None):
|
||||
comma_remote = origin.startswith('git@github.com:commaai') or origin.startswith('https://github.com/commaai')
|
||||
tested_branch = branch in ['devel', 'release2-staging', 'dashcam-staging', 'release2', 'dashcam']
|
||||
|
||||
dirty = not comma_remote
|
||||
dirty = dirty or ('master' in branch)
|
||||
|
|
Loading…
Reference in New Issue