diff --git a/common/params.cc b/common/params.cc index 181bd05b1..f64e305e8 100644 --- a/common/params.cc +++ b/common/params.cc @@ -407,6 +407,7 @@ std::unordered_map keys = { {"WarningSoftVolume", PERSISTENT}, {"WarningImmediateVolume", PERSISTENT}, {"WheelIcon", PERSISTENT}, + {"WheelSpeed", PERSISTENT}, }; } // namespace diff --git a/selfdrive/frogpilot/ui/visual_settings.cc b/selfdrive/frogpilot/ui/visual_settings.cc index e9e72eea1..2aae85dc4 100644 --- a/selfdrive/frogpilot/ui/visual_settings.cc +++ b/selfdrive/frogpilot/ui/visual_settings.cc @@ -52,6 +52,7 @@ FrogPilotVisualsPanel::FrogPilotVisualsPanel(SettingsWindow *parent) : FrogPilot {"FullMap", "Full Sized Map", "Maximize the size of the map in the onroad UI.", ""}, {"HideSpeed", "Hide Speed", "Hide the speed indicator in the onroad UI. Additional toggle allows it to be hidden/shown via tapping the speed itself.", ""}, {"MapStyle", "Map Style", "Use a custom map style to be used for 'Navigate on openpilot'.", ""}, + {"WheelSpeed", "Use Wheel Speed", "Use the wheel speed metric as opposed to the artificial speed.", ""}, {"RandomEvents", "Random Events", "Enjoy a bit of unpredictability with random events that can occur during certain driving conditions.", "../frogpilot/assets/toggle_icons/icon_random.png"}, {"ScreenBrightness", "Screen Brightness", "Customize your screen brightness.", "../frogpilot/assets/toggle_icons/icon_light.png"}, diff --git a/selfdrive/frogpilot/ui/visual_settings.h b/selfdrive/frogpilot/ui/visual_settings.h index 1d6716b0a..1b9799bd3 100644 --- a/selfdrive/frogpilot/ui/visual_settings.h +++ b/selfdrive/frogpilot/ui/visual_settings.h @@ -35,7 +35,7 @@ private: std::set customOnroadUIKeys = {"AccelerationPath", "AdjacentPath", "BlindSpotPath", "FPSCounter", "LeadInfo", "PedalsOnUI", "RoadNameUI"}; std::set customThemeKeys = {"CustomColors", "CustomIcons", "CustomSignals", "CustomSounds"}; std::set modelUIKeys = {"DynamicPathWidth", "LaneLinesWidth", "PathEdgeWidth", "PathWidth", "RoadEdgesWidth", "UnlimitedLength"}; - std::set qolKeys = {"DriveStats", "FullMap", "HideSpeed", "MapStyle"}; + std::set qolKeys = {"DriveStats", "FullMap", "HideSpeed", "MapStyle", "WheelSpeed"}; std::map toggles; diff --git a/selfdrive/ui/qt/onroad.cc b/selfdrive/ui/qt/onroad.cc index c5e116b4a..2530ab6f3 100644 --- a/selfdrive/ui/qt/onroad.cc +++ b/selfdrive/ui/qt/onroad.cc @@ -527,7 +527,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 && !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 97bcd6ef4..60e29388e 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -361,6 +361,7 @@ void ui_update_frogpilot_params(UIState *s) { scene.hide_speed = quality_of_life_visuals && params.getBool("HideSpeed"); scene.hide_speed_ui = scene.hide_speed && params.getBool("HideSpeedUI"); scene.map_style = quality_of_life_visuals ? params.getInt("MapStyle") : 0; + scene.wheel_speed = quality_of_life_visuals && params.getBool("WheelSpeed"); scene.personalities_via_screen = params.getBool("PersonalitiesViaScreen") && params.getBool("AdjustablePersonalities"); scene.random_events = params.getBool("RandomEvents"); diff --git a/selfdrive/ui/ui.h b/selfdrive/ui/ui.h index 385686978..36dde6f64 100644 --- a/selfdrive/ui/ui.h +++ b/selfdrive/ui/ui.h @@ -221,6 +221,7 @@ typedef struct UIScene { bool unlimited_road_ui_length; bool use_si; bool use_vienna_slc_sign; + bool wheel_speed; float acceleration; float adjusted_cruise;