From f17cf4819eeb2265ceb8d00e9509b142f1cbcef9 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 776f3ef4f..1f2e491b1 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 ffd2831b3..5f4ff9b61 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -422,6 +422,7 @@ void ui_update_frogpilot_params(UIState *s) { 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 586f8325b..97b4004e1 100644 --- a/selfdrive/ui/ui.h +++ b/selfdrive/ui/ui.h @@ -198,6 +198,7 @@ typedef struct UIScene { bool use_si; bool use_vienna_slc_sign; bool vtsc_controlling_curve; + bool wheel_speed; double fps;