|
|
@ -565,10 +565,8 @@ class Controls: |
|
|
|
CC.hudControl.lanesVisible = self.enabled |
|
|
|
CC.hudControl.lanesVisible = self.enabled |
|
|
|
CC.hudControl.leadVisible = self.sm['longitudinalPlan'].hasLead |
|
|
|
CC.hudControl.leadVisible = self.sm['longitudinalPlan'].hasLead |
|
|
|
|
|
|
|
|
|
|
|
right_lane_visible = self.sm['lateralPlan'].rProb > 0.5 |
|
|
|
CC.hudControl.rightLaneVisible = True |
|
|
|
left_lane_visible = self.sm['lateralPlan'].lProb > 0.5 |
|
|
|
CC.hudControl.leftLaneVisible = True |
|
|
|
CC.hudControl.rightLaneVisible = bool(right_lane_visible) |
|
|
|
|
|
|
|
CC.hudControl.leftLaneVisible = bool(left_lane_visible) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
recent_blinker = (self.sm.frame - self.last_blinker_frame) * DT_CTRL < 5.0 # 5s blinker cooldown |
|
|
|
recent_blinker = (self.sm.frame - self.last_blinker_frame) * DT_CTRL < 5.0 # 5s blinker cooldown |
|
|
|
ldw_allowed = self.is_ldw_enabled and CS.vEgo > LDW_MIN_SPEED and not recent_blinker \ |
|
|
|
ldw_allowed = self.is_ldw_enabled and CS.vEgo > LDW_MIN_SPEED and not recent_blinker \ |
|
|
@ -576,6 +574,8 @@ class Controls: |
|
|
|
|
|
|
|
|
|
|
|
meta = self.sm['modelV2'].meta |
|
|
|
meta = self.sm['modelV2'].meta |
|
|
|
if len(meta.desirePrediction) and ldw_allowed: |
|
|
|
if len(meta.desirePrediction) and ldw_allowed: |
|
|
|
|
|
|
|
right_lane_visible = self.sm['lateralPlan'].rProb > 0.5 |
|
|
|
|
|
|
|
left_lane_visible = self.sm['lateralPlan'].lProb > 0.5 |
|
|
|
l_lane_change_prob = meta.desirePrediction[Desire.laneChangeLeft - 1] |
|
|
|
l_lane_change_prob = meta.desirePrediction[Desire.laneChangeLeft - 1] |
|
|
|
r_lane_change_prob = meta.desirePrediction[Desire.laneChangeRight - 1] |
|
|
|
r_lane_change_prob = meta.desirePrediction[Desire.laneChangeRight - 1] |
|
|
|
l_lane_close = left_lane_visible and (self.sm['modelV2'].laneLines[1].y[0] > -(1.08 + CAMERA_OFFSET)) |
|
|
|
l_lane_close = left_lane_visible and (self.sm['modelV2'].laneLines[1].y[0] > -(1.08 + CAMERA_OFFSET)) |
|
|
|