|
|
@ -14,7 +14,7 @@ from common.params import Params, ParamKeyType |
|
|
|
from common.text_window import TextWindow |
|
|
|
from common.text_window import TextWindow |
|
|
|
from selfdrive.boardd.set_time import set_time |
|
|
|
from selfdrive.boardd.set_time import set_time |
|
|
|
from system.hardware import HARDWARE, PC |
|
|
|
from system.hardware import HARDWARE, PC |
|
|
|
from selfdrive.manager.helpers import unblock_stdout |
|
|
|
from selfdrive.manager.helpers import unblock_stdout, write_onroad_params |
|
|
|
from selfdrive.manager.process import ensure_running |
|
|
|
from selfdrive.manager.process import ensure_running |
|
|
|
from selfdrive.manager.process_config import managed_processes |
|
|
|
from selfdrive.manager.process_config import managed_processes |
|
|
|
from selfdrive.athena.registration import register, UNREGISTERED_DONGLE_ID |
|
|
|
from selfdrive.athena.registration import register, UNREGISTERED_DONGLE_ID |
|
|
@ -136,6 +136,7 @@ def manager_thread() -> None: |
|
|
|
sm = messaging.SubMaster(['deviceState', 'carParams'], poll=['deviceState']) |
|
|
|
sm = messaging.SubMaster(['deviceState', 'carParams'], poll=['deviceState']) |
|
|
|
pm = messaging.PubMaster(['managerState']) |
|
|
|
pm = messaging.PubMaster(['managerState']) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
write_onroad_params(False, params) |
|
|
|
ensure_running(managed_processes.values(), False, params=params, CP=sm['carParams'], not_run=ignore) |
|
|
|
ensure_running(managed_processes.values(), False, params=params, CP=sm['carParams'], not_run=ignore) |
|
|
|
|
|
|
|
|
|
|
|
started_prev = False |
|
|
|
started_prev = False |
|
|
@ -150,10 +151,9 @@ def manager_thread() -> None: |
|
|
|
elif not started and started_prev: |
|
|
|
elif not started and started_prev: |
|
|
|
params.clear_all(ParamKeyType.CLEAR_ON_OFFROAD_TRANSITION) |
|
|
|
params.clear_all(ParamKeyType.CLEAR_ON_OFFROAD_TRANSITION) |
|
|
|
|
|
|
|
|
|
|
|
# initialize and update onroad params, which drives boardd's safety setter thread |
|
|
|
# update onroad params, which drives boardd's safety setter thread |
|
|
|
if started != started_prev or sm.frame == 0: |
|
|
|
if started != started_prev: |
|
|
|
params.put_bool("IsOnroad", started) |
|
|
|
write_onroad_params(started, params) |
|
|
|
params.put_bool("IsOffroad", not started) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
started_prev = started |
|
|
|
started_prev = started |
|
|
|
|
|
|
|
|
|
|
|