DM: Use carControl.latActive for MADS DM monitoring (#845)

This commit is contained in:
Jason Wen
2025-04-22 00:03:06 -04:00
committed by GitHub
parent b64ceb41ed
commit 0102a1c704
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ def dmonitoringd_thread():
params = Params()
pm = messaging.PubMaster(['driverMonitoringState'])
sm = messaging.SubMaster(['driverStateV2', 'liveCalibration', 'carState', 'selfdriveState', 'modelV2',
'selfdriveStateSP'], poll='driverStateV2')
'carControl'], poll='driverStateV2')
DM = DriverMonitoring(rhd_saved=params.get_bool("IsRhdDetected"), always_on=params.get_bool("AlwaysOnDM"))
+2 -2
View File
@@ -403,13 +403,13 @@ class DriverMonitoring:
driver_state=sm['driverStateV2'],
cal_rpy=sm['liveCalibration'].rpyCalib,
car_speed=sm['carState'].vEgo,
op_engaged=sm['selfdriveState'].enabled or sm['selfdriveStateSP'].mads.active
op_engaged=sm['selfdriveState'].enabled or sm['carControl'].latActive
)
# Update distraction events
self._update_events(
driver_engaged=sm['carState'].steeringPressed or sm['carState'].gasPressed,
op_engaged=sm['selfdriveState'].enabled or sm['selfdriveStateSP'].mads.active,
op_engaged=sm['selfdriveState'].enabled or sm['carControl'].latActive,
standstill=sm['carState'].standstill,
wrong_gear=sm['carState'].gearShifter in [car.CarState.GearShifter.reverse, car.CarState.GearShifter.park],
car_speed=sm['carState'].vEgo