cleanup old sm pm args (#30241)

* cleanup sm pm

* fix controlsd

* fix
This commit is contained in:
Adeeb Shihadeh
2023-10-13 23:27:04 -07:00
committed by GitHub
parent 9e24a11f17
commit b68cfbb332
8 changed files with 41 additions and 64 deletions
+5 -8
View File
@@ -10,15 +10,12 @@ from openpilot.selfdrive.controls.lib.events import Events
from openpilot.selfdrive.monitoring.driver_monitor import DriverStatus
def dmonitoringd_thread(sm=None, pm=None):
def dmonitoringd_thread():
gc.disable()
set_realtime_priority(2)
if pm is None:
pm = messaging.PubMaster(['driverMonitoringState'])
if sm is None:
sm = messaging.SubMaster(['driverStateV2', 'liveCalibration', 'carState', 'controlsState', 'modelV2'], poll=['driverStateV2'])
pm = messaging.PubMaster(['driverMonitoringState'])
sm = messaging.SubMaster(['driverStateV2', 'liveCalibration', 'carState', 'controlsState', 'modelV2'], poll=['driverStateV2'])
driver_status = DriverStatus(rhd_saved=Params().get_bool("IsRhdDetected"))
@@ -89,8 +86,8 @@ def dmonitoringd_thread(sm=None, pm=None):
driver_status.wheel_on_right == (driver_status.wheelpos_learner.filtered_stat.M > driver_status.settings._WHEELPOS_THRESHOLD)):
put_bool_nonblocking("IsRhdDetected", driver_status.wheel_on_right)
def main(sm=None, pm=None):
dmonitoringd_thread(sm, pm)
def main():
dmonitoringd_thread()
if __name__ == '__main__':