From a9d6c98aa42d35d5b7f331077f674dacfcd47495 Mon Sep 17 00:00:00 2001 From: ZwX1616 Date: Mon, 5 Oct 2020 14:39:24 -0700 Subject: [PATCH] Reduced wheel touch time (#2259) * decrease wheel touch time * update refs * fix unittest Co-authored-by: Adeeb Shihadeh old-commit-hash: 21d4ac1eebba06769f03edf7220ce84bd6ae154d --- selfdrive/monitoring/driver_monitor.py | 6 +++--- selfdrive/monitoring/test_monitoring.py | 4 ++-- selfdrive/test/process_replay/ref_commit | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/selfdrive/monitoring/driver_monitor.py b/selfdrive/monitoring/driver_monitor.py index 1122e1b7aa..5158380752 100644 --- a/selfdrive/monitoring/driver_monitor.py +++ b/selfdrive/monitoring/driver_monitor.py @@ -14,9 +14,9 @@ EventName = car.CarEvent.EventName # We recommend that you do not change these numbers from the defaults. # ****************************************************************************************** -_AWARENESS_TIME = 70. # one minute limit without user touching steering wheels make the car enter a terminal status -_AWARENESS_PRE_TIME_TILL_TERMINAL = 15. # a first alert is issued 15s before expiration -_AWARENESS_PROMPT_TIME_TILL_TERMINAL = 6. # a second alert is issued 6s before start decelerating the car +_AWARENESS_TIME = 35. # passive wheel touch total timeout +_AWARENESS_PRE_TIME_TILL_TERMINAL = 7. +_AWARENESS_PROMPT_TIME_TILL_TERMINAL = 5. _DISTRACTED_TIME = 11. _DISTRACTED_PRE_TIME_TILL_TERMINAL = 8. _DISTRACTED_PROMPT_TIME_TILL_TERMINAL = 6. diff --git a/selfdrive/monitoring/test_monitoring.py b/selfdrive/monitoring/test_monitoring.py index b333a7f348..dd644ca41d 100644 --- a/selfdrive/monitoring/test_monitoring.py +++ b/selfdrive/monitoring/test_monitoring.py @@ -141,7 +141,7 @@ class TestMonitoring(unittest.TestCase): # 5. op engaged, invisible driver, down to orange, driver touches wheel; then down to orange again, driver appears # - both actions should clear the alert, but momentary appearence should not def test_sometimes_transparent_commuter(self): - _visible_time = np.random.choice([1, 10]) # seconds + _visible_time = np.random.choice([0.5, 10]) # seconds # print _visible_time ds_vector = always_no_face[:]*2 interaction_vector = always_false[:]*2 @@ -151,7 +151,7 @@ class TestMonitoring(unittest.TestCase): self.assertTrue(len(events_output[int(_INVISIBLE_SECONDS_TO_ORANGE*0.5/DT_DMON)]) == 0) self.assertEqual(events_output[int((_INVISIBLE_SECONDS_TO_ORANGE-0.1)/DT_DMON)].names[0], EventName.promptDriverUnresponsive) self.assertTrue(len(events_output[int((_INVISIBLE_SECONDS_TO_ORANGE+0.1)/DT_DMON)]) == 0) - if _visible_time == 1: + if _visible_time == 0.5: self.assertEqual(events_output[int((_INVISIBLE_SECONDS_TO_ORANGE*2+1-0.1)/DT_DMON)].names[0], EventName.promptDriverUnresponsive) self.assertEqual(events_output[int((_INVISIBLE_SECONDS_TO_ORANGE*2+1+0.1+_visible_time)/DT_DMON)].names[0], EventName.preDriverUnresponsive) elif _visible_time == 10: diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index 5ad9a65ade..8a27a8f5dc 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -eaa9ac421abee09dfc2bac3b85423d3980f6e67b \ No newline at end of file +6acafbadc569c82412a2370e61d8de619255b25a \ No newline at end of file