Skip to content

Commit

Permalink
Merge pull request dragonpilot-community#204 from dragonpilot-communi…
Browse files Browse the repository at this point in the history
…ty/eFiniLan-patch-5

Fixed dpdmonitoringd.py
  • Loading branch information
eFiniLan authored Dec 29, 2023
2 parents 7ee7cb5 + 9b74756 commit 7a6a111
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions selfdrive/dragonpilot/dpdmonitoringd.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
import cereal.messaging as messaging
from openpilot.common.realtime import set_realtime_priority, DT_DMON
from openpilot.common.params import Params
from openpilot.selfdrive.controls.lib.events import Events


def dmonitoringd_thread(sm=None, pm=None):
Params().put_bool("DmModelInitialized", True);
params = Params()
params.put_bool("DmModelInitialized", True)
is_rhd_detected = params.get_bool("IsRhdDetected")
gc.disable()
set_realtime_priority(2)

Expand All @@ -17,18 +20,20 @@ def dmonitoringd_thread(sm=None, pm=None):

# 10Hz <- dmonitoringmodeld
while True:
dat = messaging.new_message('driverStateV2')
dat = messaging.new_message('driverStateV2', valid=True)
dat.driverStateV2.leftDriverData.faceOrientation = [0., 0., 0.]
dat.driverStateV2.leftDriverData.faceProb = 1.0
dat.driverStateV2.rightDriverData.faceOrientation = [0., 0., 0.]
dat.driverStateV2.rightDriverData.faceProb = 1.0
pm.send('driverStateV2', dat)

dat = messaging.new_message('driverMonitoringState')
dat = messaging.new_message('driverMonitoringState', valid=True)
dat.driverMonitoringState = {
"events": Events().to_msg(),
"faceDetected": True,
"isDistracted": False,
"awarenessStatus": 1.,
"isRHD": is_rhd_detected,
}
pm.send('driverMonitoringState', dat)
time.sleep(DT_DMON)
Expand Down

0 comments on commit 7a6a111

Please sign in to comment.