mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-19 03:42:05 +08:00
Add ability to toggle driver monitoring
This commit is contained in:
@@ -130,6 +130,7 @@ keys = {
|
||||
"DragonUILead": [TxType.PERSISTENT],
|
||||
"DragonUIPath": [TxType.PERSISTENT],
|
||||
"DragonUIBlinker": [TxType.PERSISTENT],
|
||||
"DragonEnableDriverMonitoring": [TxType.PERSISTENT],
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@ class DriverStatus():
|
||||
self.awareness_time = float(params.get("DragonSteeringMonitorTimer"))
|
||||
self.awareness_time = 86400 if self.awareness_time <= 0. else self.awareness_time * 60.
|
||||
self.dragon_enable_driver_safety_check = False if params.get("DragonEnableDriverSafetyCheck") == "0" else True
|
||||
self.dragon_enable_driver_monitoring = False if params.get("DragonEnableDriverMonitoring") == "0" else True
|
||||
|
||||
self._set_timers(active_monitoring=True)
|
||||
|
||||
@@ -162,6 +163,9 @@ class DriverStatus():
|
||||
self.pose.roll, self.pose.pitch, self.pose.yaw = head_orientation_from_descriptor(driver_monitoring.faceOrientation, driver_monitoring.facePosition, cal_rpy)
|
||||
self.blink.left_blink = driver_monitoring.leftBlinkProb * (driver_monitoring.leftEyeProb>_EYE_THRESHOLD)
|
||||
self.blink.right_blink = driver_monitoring.rightBlinkProb * (driver_monitoring.rightEyeProb>_EYE_THRESHOLD)
|
||||
# we simply set to rhd to avoid driver monitoring
|
||||
if not self.dragon_enable_driver_monitoring:
|
||||
self.is_rhd_region = True
|
||||
self.face_detected = driver_monitoring.faceProb > _FACE_THRESHOLD and not self.is_rhd_region
|
||||
|
||||
self.driver_distracted = self._is_driver_distracted(self.pose, self.blink)>0
|
||||
|
||||
@@ -50,6 +50,7 @@ default_conf = {
|
||||
'DragonUILead': '1',
|
||||
'DragonUIPath': '1',
|
||||
'DragonUIBlinker': '0',
|
||||
'DragonEnableDriverMonitoring': '1',
|
||||
}
|
||||
|
||||
deprecated_conf = {
|
||||
|
||||
Reference in New Issue
Block a user