@@ -47,9 +47,10 @@ def __init__(self, device_type):
4747 self ._POSE_YAW_THRESHOLD = 0.4020
4848 self ._POSE_YAW_THRESHOLD_SLACK = 0.5042
4949 self ._POSE_YAW_THRESHOLD_STRICT = self ._POSE_YAW_THRESHOLD
50- self ._PITCH_NATURAL_OFFSET = 0.029 # initial value before offset is learned
51- self ._PITCH_NATURAL_THRESHOLD = 0.449
52- self ._YAW_NATURAL_OFFSET = 0.097 # initial value before offset is learned
50+ self ._PITCH_NATURAL_OFFSET = 0.011 # initial value before offset is learned
51+ self ._PITCH_NATURAL_THRESHOLD = 0.432
52+ self ._YAW_NATURAL_THRESHOLD = 0.698
53+ self ._YAW_NATURAL_OFFSET = 0.075 # initial value before offset is learned
5354 self ._PITCH_MAX_OFFSET = 0.124
5455 self ._PITCH_MIN_OFFSET = - 0.0881
5556 self ._YAW_MAX_OFFSET = 0.289
@@ -234,8 +235,11 @@ def _get_distracted_types(self):
234235 self .settings ._YAW_MIN_OFFSET ), self .settings ._YAW_MAX_OFFSET )
235236 pitch_error = 0 if pitch_error > 0 else abs (pitch_error ) # no positive pitch limit
236237 yaw_error = abs (yaw_error )
237- if pitch_error > (self .settings ._POSE_PITCH_THRESHOLD * self .pose .cfactor_pitch if self .pose .calibrated else self .settings ._PITCH_NATURAL_THRESHOLD ) or \
238- yaw_error > self .settings ._POSE_YAW_THRESHOLD * self .pose .cfactor_yaw :
238+
239+ pitch_threshold = self .settings ._POSE_PITCH_THRESHOLD * self .pose .cfactor_pitch if self .pose .calibrated else self .settings ._PITCH_NATURAL_THRESHOLD
240+ yaw_threshold = self .settings ._POSE_YAW_THRESHOLD * self .pose .cfactor_yaw if self .pose .calibrated else self .settings ._YAW_NATURAL_THRESHOLD
241+
242+ if pitch_error > pitch_threshold or yaw_error > yaw_threshold :
239243 distracted_types .append (DistractedType .DISTRACTED_POSE )
240244
241245 if (self .blink .left + self .blink .right )* 0.5 > self .settings ._BLINK_THRESHOLD :
0 commit comments