Only draw lead car indicators when controlling longitudinal (#1914)

pull/1918/head
Adeeb Shihadeh 5 years ago committed by GitHub
parent f753ca14ad
commit 61548f5a48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      selfdrive/ui/paint.cc

@ -368,12 +368,15 @@ static void ui_draw_world(UIState *s) {
// Draw lane edges and vision/mpc tracks
ui_draw_vision_lanes(s);
// Draw lead indicators if openpilot is handling longitudinal
if (s->longitudinal_control) {
if (scene->lead_data[0].getStatus()) {
draw_lead(s, scene->lead_data[0]);
}
if (scene->lead_data[1].getStatus() && (std::abs(scene->lead_data[0].getDRel() - scene->lead_data[1].getDRel()) > 3.0)) {
draw_lead(s, scene->lead_data[1]);
}
}
nvgRestore(s->vg);
}

Loading…
Cancel
Save