From 61548f5a483e0fa7fba6f167017c3fbe73e3f684 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 23 Jul 2020 13:28:58 -0700 Subject: [PATCH] Only draw lead car indicators when controlling longitudinal (#1914) --- selfdrive/ui/paint.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/selfdrive/ui/paint.cc b/selfdrive/ui/paint.cc index 8c17b4cf98..73d99755f6 100644 --- a/selfdrive/ui/paint.cc +++ b/selfdrive/ui/paint.cc @@ -368,11 +368,14 @@ static void ui_draw_world(UIState *s) { // Draw lane edges and vision/mpc tracks ui_draw_vision_lanes(s); - 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]); + // 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); }