Skip to content

Commit

Permalink
keep the new alert consistent for process replay
Browse files Browse the repository at this point in the history
  • Loading branch information
adeebshihadeh committed Feb 17, 2022
1 parent ff965c7 commit f59adbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion selfdrive/controls/lib/events.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from enum import IntEnum
from typing import Dict, Union, Callable, List, Optional

Expand All @@ -14,6 +15,7 @@
AudibleAlert = car.CarControl.HUDControl.AudibleAlert
EventName = car.CarEvent.EventName

REPLAY = "REPLAY" in os.environ

# Alert priorities
class Priority(IntEnum):
Expand Down Expand Up @@ -215,7 +217,10 @@ def func(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, soft_disable_
return func

def startup_master_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert:
return StartupAlert("WARNING: This branch is not tested", get_short_branch(""), alert_status=AlertStatus.userPrompt)
branch = get_short_branch("")
if REPLAY:
branch = "replay"
return StartupAlert("WARNING: This branch is not tested", branch, alert_status=AlertStatus.userPrompt)

def below_engage_speed_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert:
return NoEntryAlert(f"Speed Below {get_display_speed(CP.minEnableSpeed, metric)}")
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/test/process_replay/ref_commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ec35d9040244398405758f4419839ca19fb98d3d
ff965c772bd1bc85dec717d090cee4466033ce73

0 comments on commit f59adbe

Please sign in to comment.