mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-22 14:32:07 +08:00
fix up driver/steering monitor toggle
This commit is contained in:
Binary file not shown.
@@ -59,31 +59,30 @@ def dmonitoringd_thread(sm=None, pm=None):
|
||||
# load driver monitor val only when safety is on
|
||||
if dp_enable_driver_safety_check:
|
||||
dp_enable_driver_monitoring = False if params.get("DragonEnableDriverMonitoring", encoding='utf8') == "0" else True
|
||||
# load steering monitor timer val only when driver monitor is on
|
||||
if dp_enable_driver_monitoring:
|
||||
try:
|
||||
dp_awareness_time = int(params.get("DragonSteeringMonitorTimer", encoding='utf8'))
|
||||
except TypeError:
|
||||
dp_awareness_time = 0.
|
||||
driver_status.awareness_time = 86400 if dp_awareness_time <= 0. else dp_awareness_time * 60.
|
||||
# load steering monitor timer val only when driver monitor is on
|
||||
if dp_enable_driver_safety_check:
|
||||
try:
|
||||
dp_awareness_time = int(params.get("DragonSteeringMonitorTimer", encoding='utf8'))
|
||||
except TypeError:
|
||||
dp_awareness_time = 0.
|
||||
driver_status.awareness_time = 86400 if dp_awareness_time <= 0. else dp_awareness_time * 60.
|
||||
dp_last_modified = modified
|
||||
last_ts = cur_time
|
||||
|
||||
# reset all awareness val
|
||||
if not dp_enable_driver_safety_check:
|
||||
dp_enable_driver_monitoring = False
|
||||
driver_status.awareness_time = 86400
|
||||
|
||||
# reset all awareness val and set to rhd region, this will enforce steering monitor.
|
||||
if not dp_enable_driver_monitoring:
|
||||
driver_status.is_rhd_region = True
|
||||
driver_status.is_rhd_region_checked = True
|
||||
driver_status.awareness = 1.
|
||||
driver_status.awareness_active = 1.
|
||||
driver_status.awareness_passive = 1.
|
||||
driver_status.terminal_alert_cnt = 0
|
||||
driver_status.terminal_time = 0
|
||||
|
||||
# dm don't check rhd, set to true
|
||||
if not dp_enable_driver_monitoring:
|
||||
driver_status.awareness_time = 86400
|
||||
driver_status.is_rhd_region = True
|
||||
driver_status.is_rhd_region_checked = True
|
||||
|
||||
sm.update()
|
||||
|
||||
# GPS coords RHD parsing, once every restart
|
||||
|
||||
Reference in New Issue
Block a user