Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dmonitoringd: make real-time process #23554

Merged
merged 2 commits into from
Jan 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions selfdrive/monitoring/dmonitoringd.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
#!/usr/bin/env python3
import gc

import cereal.messaging as messaging
from cereal import car
from common.params import Params
import cereal.messaging as messaging
from common.realtime import set_realtime_priority
from selfdrive.controls.lib.events import Events
from selfdrive.monitoring.driver_monitor import DriverStatus
from selfdrive.locationd.calibrationd import Calibration
from selfdrive.monitoring.driver_monitor import DriverStatus


def dmonitoringd_thread(sm=None, pm=None):
gc.disable()
set_realtime_priority(2)

if pm is None:
pm = messaging.PubMaster(['driverMonitoringState'])

Expand Down Expand Up @@ -77,8 +83,10 @@ def dmonitoringd_thread(sm=None, pm=None):
}
pm.send('driverMonitoringState', dat)


def main(sm=None, pm=None):
dmonitoringd_thread(sm, pm)


if __name__ == '__main__':
main()