From 8db72d15f04b29fa7eb1b0320b30d10bd83467e6 Mon Sep 17 00:00:00 2001 From: Igor Biletskyy Date: Thu, 17 Mar 2022 13:17:33 -0700 Subject: [PATCH] onroad UI: show negative speed (#23987) * show negative speed * remove () old-commit-hash: 62087a6368efb5fee555aa0b3b2458e721b87b68 --- selfdrive/ui/qt/onroad.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/ui/qt/onroad.cc b/selfdrive/ui/qt/onroad.cc index e8d871aae1..04df53a574 100644 --- a/selfdrive/ui/qt/onroad.cc +++ b/selfdrive/ui/qt/onroad.cc @@ -186,7 +186,7 @@ void OnroadHud::updateState(const UIState &s) { maxspeed *= KM_TO_MILE; } QString maxspeed_str = cruise_set ? QString::number(std::nearbyint(maxspeed)) : "N/A"; - float cur_speed = std::max(0.0, sm["carState"].getCarState().getVEgo() * (s.scene.is_metric ? MS_TO_KPH : MS_TO_MPH)); + float cur_speed = sm["carState"].getCarState().getVEgo() * (s.scene.is_metric ? MS_TO_KPH : MS_TO_MPH); setProperty("is_cruise_set", cruise_set); setProperty("speed", QString::number(std::nearbyint(cur_speed)));