fix crash when ldw is turned on

pull/25681/head
Shane Smiskol 3 years ago
parent 2e013c9d46
commit b4cbacab13
  1. 4
      selfdrive/controls/controlsd.py

@ -709,8 +709,8 @@ class Controls:
model_v2 = self.sm['modelV2'] model_v2 = self.sm['modelV2']
desire_prediction = model_v2.meta.desirePrediction desire_prediction = model_v2.meta.desirePrediction
if len(desire_prediction) and ldw_allowed: if len(desire_prediction) and ldw_allowed:
right_lane_visible = self.sm['lateralPlan'].rProb > 0.5 right_lane_visible = model_v2.laneLineProbs[2] > 0.5
left_lane_visible = self.sm['lateralPlan'].lProb > 0.5 left_lane_visible = model_v2.laneLineProbs[1] > 0.5
l_lane_change_prob = desire_prediction[Desire.laneChangeLeft - 1] l_lane_change_prob = desire_prediction[Desire.laneChangeLeft - 1]
r_lane_change_prob = desire_prediction[Desire.laneChangeRight - 1] r_lane_change_prob = desire_prediction[Desire.laneChangeRight - 1]

Loading…
Cancel
Save