only check offroad in dmonitoringd on init

pull/1997/head
Adeeb Shihadeh 5 years ago
parent e37b8e5d56
commit 31f57cb3a3
  1. 6
      selfdrive/monitoring/dmonitoringd.py

@ -1,7 +1,7 @@
#!/usr/bin/env python3
import gc
from cereal import car
from common.realtime import set_realtime_priority, DT_DMON
from common.realtime import set_realtime_priority
from common.params import Params
import cereal.messaging as messaging
from selfdrive.controls.lib.events import Events
@ -60,10 +60,6 @@ def dmonitoringd_thread(sm=None, pm=None):
if sm.updated['model']:
driver_status.set_policy(sm['model'])
# Check once a second if we're offroad
if sm.frame % 1/DT_DMON == 0:
offroad = params.get("IsOffroad") == b"1"
# Get data from dmonitoringmodeld
if sm.updated['driverState']:
events = Events()

Loading…
Cancel
Save