mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-28 01:52:06 +08:00
continued: Update DM awareness times (#2527)
* Gets us 6 seconds before making sound (up from 2s; 9s originally) * Average last two awareness times * This alert shows up every ~20 seconds, distracting * Revert "Average last two awareness times" This reverts commit 2fd7e7a44c708039e1692dcc14ee913ef88bb37e. * update ref * update test * update ref Co-authored-by: Shane Smiskol <shane@smiskol.com> old-commit-hash: faf8b1fd826575c179e6442d5f4f1055eeecb11c
This commit is contained in:
@@ -15,8 +15,8 @@ EventName = car.CarEvent.EventName
|
||||
# ******************************************************************************************
|
||||
|
||||
_AWARENESS_TIME = 35. # passive wheel touch total timeout
|
||||
_AWARENESS_PRE_TIME_TILL_TERMINAL = 7.
|
||||
_AWARENESS_PROMPT_TIME_TILL_TERMINAL = 5.
|
||||
_AWARENESS_PRE_TIME_TILL_TERMINAL = 12.
|
||||
_AWARENESS_PROMPT_TIME_TILL_TERMINAL = 6.
|
||||
_DISTRACTED_TIME = 11.
|
||||
_DISTRACTED_PRE_TIME_TILL_TERMINAL = 8.
|
||||
_DISTRACTED_PROMPT_TIME_TILL_TERMINAL = 6.
|
||||
@@ -251,13 +251,13 @@ class DriverStatus():
|
||||
if self.awareness <= 0.:
|
||||
# terminal red alert: disengagement required
|
||||
alert = EventName.driverDistracted if self.active_monitoring_mode else EventName.driverUnresponsive
|
||||
self.hi_std_alert_enabled = True
|
||||
self.terminal_time += 1
|
||||
if awareness_prev > 0.:
|
||||
self.terminal_alert_cnt += 1
|
||||
elif self.awareness <= self.threshold_prompt:
|
||||
# prompt orange alert
|
||||
alert = EventName.promptDriverDistracted if self.active_monitoring_mode else EventName.promptDriverUnresponsive
|
||||
self.hi_std_alert_enabled = True
|
||||
elif self.awareness <= self.threshold_pre:
|
||||
# pre green alert
|
||||
alert = EventName.preDriverDistracted if self.active_monitoring_mode else EventName.preDriverUnresponsive
|
||||
|
||||
@@ -218,8 +218,8 @@ class TestMonitoring(unittest.TestCase):
|
||||
self.assertEqual(events_output[int((_HI_STD_TIMEOUT)/DT_DMON)].names[0], EventName.driverMonitorLowAcc)
|
||||
self.assertTrue(EventName.preDriverDistracted in events_output[int((2*(_DISTRACTED_TIME-_DISTRACTED_PRE_TIME_TILL_TERMINAL))/DT_DMON)].names)
|
||||
self.assertTrue(EventName.promptDriverDistracted in events_output[int((2*(_DISTRACTED_TIME-_DISTRACTED_PROMPT_TIME_TILL_TERMINAL))/DT_DMON)].names)
|
||||
self.assertEqual(events_output[int((_DISTRACTED_TIME+1)/DT_DMON)].names[1], EventName.promptDriverDistracted)
|
||||
self.assertEqual(events_output[int((_DISTRACTED_TIME*2.5)/DT_DMON)].names[1], EventName.promptDriverDistracted) # set_timer blocked
|
||||
self.assertEqual(events_output[int((_DISTRACTED_TIME+1)/DT_DMON)].names[0], EventName.promptDriverDistracted)
|
||||
self.assertEqual(events_output[int((_DISTRACTED_TIME*2.5)/DT_DMON)].names[0], EventName.promptDriverDistracted) # set_timer blocked
|
||||
|
||||
if __name__ == "__main__":
|
||||
print('MAX_TERMINAL_ALERTS', MAX_TERMINAL_ALERTS)
|
||||
|
||||
@@ -1 +1 @@
|
||||
b4a8c7c439c2430082ffb49ed675ada8f3bab8e6
|
||||
7dde5eab03feb7e0801fe24e9fea0f3629987571
|
||||
Reference in New Issue
Block a user