Skip to content

Commit

Permalink
onroad UI: show negative speed (commaai#23987)
Browse files Browse the repository at this point in the history
* show negative speed

* remove ()
  • Loading branch information
briskspirit authored and budney committed Mar 27, 2022
1 parent 4833895 commit 1acc65b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion selfdrive/ui/qt/onroad.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down

0 comments on commit 1acc65b

Please sign in to comment.