From 9816e01e6ff0284521fa18b07ec15b3900577687 Mon Sep 17 00:00:00 2001 From: deanlee Date: Wed, 6 Jan 2021 04:02:08 +0000 Subject: [PATCH] fix lead_d --- selfdrive/ui/ui.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index ec690eeea0..15dc33617a 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -144,7 +144,7 @@ static void update_model(UIState *s, const cereal::ModelDataV2::Reader &model) { } // update path - const float lead_d = s->sm->updated("radarState") ? scene.lead_data[0].getDRel() * 2. : MAX_DRAW_DISTANCE; + const float lead_d = scene.lead_data[0].getStatus() ? scene.lead_data[0].getDRel() * 2. : MAX_DRAW_DISTANCE; float path_length = (lead_d > 0.) ? lead_d - fmin(lead_d * 0.35, 10.) : MAX_DRAW_DISTANCE; path_length = fmin(path_length, max_distance); update_line_data(s, model.getPosition(), 0.5, 0, &scene.track_vertices, path_length);