diff --git a/apk/ai.comma.plus.offroad.apk b/apk/ai.comma.plus.offroad.apk index f95760937..abcadfb57 100644 Binary files a/apk/ai.comma.plus.offroad.apk and b/apk/ai.comma.plus.offroad.apk differ diff --git a/common/params.py b/common/params.py index 44bba6763..8a4bbf202 100755 --- a/common/params.py +++ b/common/params.py @@ -109,6 +109,7 @@ keys = { "DragonUIDevMini": [TxType.PERSISTENT], "DragonBootTomTom": [TxType.PERSISTENT], "DragonBootAutonavi": [TxType.PERSISTENT], + "DragonSteeringMonitorTimer": [TxType.PERSISTENT], } diff --git a/selfdrive/controls/lib/driver_monitor.py b/selfdrive/controls/lib/driver_monitor.py index c175adea6..88c431949 100644 --- a/selfdrive/controls/lib/driver_monitor.py +++ b/selfdrive/controls/lib/driver_monitor.py @@ -98,6 +98,7 @@ class DriverStatus(): # dragonpilot self.dp_last_check = 0. self.dragon_enable_driver_safety_check = True + self.dragon_steering_monitor_timer = 180 def _reset_filters(self): self.driver_distraction_filter.x = 0. @@ -107,15 +108,15 @@ class DriverStatus(): def _set_timers(self, active_monitoring): if active_monitoring: # when falling back from passive mode to active mode, reset awareness to avoid false alert - if self.step_change == DT_CTRL / _AWARENESS_TIME: + if self.step_change == DT_CTRL / self.dragon_steering_monitor_timer: self.awareness = 1. self.threshold_pre = _DISTRACTED_PRE_TIME_TILL_TERMINAL / _DISTRACTED_TIME self.threshold_prompt = _DISTRACTED_PROMPT_TIME_TILL_TERMINAL / _DISTRACTED_TIME self.step_change = DT_CTRL / _DISTRACTED_TIME else: - self.threshold_pre = _AWARENESS_PRE_TIME_TILL_TERMINAL / _AWARENESS_TIME - self.threshold_prompt = _AWARENESS_PROMPT_TIME_TILL_TERMINAL / _AWARENESS_TIME - self.step_change = DT_CTRL / _AWARENESS_TIME + self.threshold_pre = _AWARENESS_PRE_TIME_TILL_TERMINAL / self.dragon_steering_monitor_timer + self.threshold_prompt = _AWARENESS_PROMPT_TIME_TILL_TERMINAL / self.dragon_steering_monitor_timer + self.step_change = DT_CTRL / self.dragon_steering_monitor_timer def _is_driver_distracted(self, pose, blink): # TODO: natural pose calib of each driver @@ -171,6 +172,8 @@ class DriverStatus(): ts = sec_since_boot() if ts - self.dp_last_check > 3.: self.dragon_enable_driver_safety_check = False if params.get("DragonEnableDriverSafetyCheck") == "0" else True + timer = params.get("DragonSteeringMonitorTimer") + self.dragon_steering_monitor_timer = 60 * 60 * 24 if timer == "0" else int(timer) * 60 self.dp_last_check = ts if not self.dragon_enable_driver_safety_check: diff --git a/selfdrive/dragonpilot/dragonconf/__init__.py b/selfdrive/dragonpilot/dragonconf/__init__.py index 7756743db..a0d6edd31 100644 --- a/selfdrive/dragonpilot/dragonconf/__init__.py +++ b/selfdrive/dragonpilot/dragonconf/__init__.py @@ -28,6 +28,7 @@ default_conf = { 'DragonUIDevMini': '1', 'DragonBootTomTom': '0', 'DragonBootAutonavi': '0', + 'DragonSteeringMonitorTimer': '3', } deprecated_conf = {