From efb2be19000446c81374e627f0c3d10547ec895b Mon Sep 17 00:00:00 2001 From: FrogAi <91348155+FrogAi@users.noreply.github.com> Date: Sat, 8 Jun 2024 14:26:30 -0700 Subject: [PATCH] Visuals - Quality of Life - Use Wheel Speed Use the wheel speed instead of the cluster speed in the onroad UI. --- selfdrive/ui/qt/onroad/annotated_camera.cc | 2 +- selfdrive/ui/ui.cc | 1 + selfdrive/ui/ui.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/qt/onroad/annotated_camera.cc b/selfdrive/ui/qt/onroad/annotated_camera.cc index eec2bd5a6..0a8b640de 100644 --- a/selfdrive/ui/qt/onroad/annotated_camera.cc +++ b/selfdrive/ui/qt/onroad/annotated_camera.cc @@ -62,7 +62,7 @@ void AnnotatedCameraWidget::updateState(const UIState &s) { // Handle older routes where vEgoCluster is not set v_ego_cluster_seen = v_ego_cluster_seen || car_state.getVEgoCluster() != 0.0; - float v_ego = v_ego_cluster_seen ? car_state.getVEgoCluster() : car_state.getVEgo(); + float v_ego = v_ego_cluster_seen && !s.scene.wheel_speed ? car_state.getVEgoCluster() : car_state.getVEgo(); speed = cs_alive ? std::max(0.0, v_ego) : 0.0; speed *= s.scene.is_metric ? MS_TO_KPH : MS_TO_MPH; diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index 582ad6d4a..2cc51508d 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -426,6 +426,7 @@ void ui_update_frogpilot_params(UIState *s, Params ¶ms) { scene.hide_speed_ui = scene.hide_speed && params.getBool("HideSpeedUI"); scene.map_style = quality_of_life_visuals ? params.getInt("MapStyle") : 0; scene.stopped_timer = quality_of_life_visuals && params.getBool("StoppedTimer"); + scene.wheel_speed = quality_of_life_visuals && params.getBool("WheelSpeed"); scene.speed_limit_controller = scene.longitudinal_control && params.getBool("SpeedLimitController"); scene.show_slc_offset = scene.speed_limit_controller && params.getBool("ShowSLCOffset"); diff --git a/selfdrive/ui/ui.h b/selfdrive/ui/ui.h index 3c4f94d27..0b166c24c 100644 --- a/selfdrive/ui/ui.h +++ b/selfdrive/ui/ui.h @@ -202,6 +202,7 @@ typedef struct UIScene { bool use_si; bool use_vienna_slc_sign; bool vtsc_controlling_curve; + bool wheel_speed; double fps;