diff --git a/common/params.cc b/common/params.cc index 21c0b6a..aed16cc 100644 --- a/common/params.cc +++ b/common/params.cc @@ -428,6 +428,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 ed53909..95e2aef 100644 --- a/selfdrive/frogpilot/ui/visual_settings.cc +++ b/selfdrive/frogpilot/ui/visual_settings.cc @@ -54,6 +54,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"}, diff --git a/selfdrive/frogpilot/ui/visual_settings.h b/selfdrive/frogpilot/ui/visual_settings.h index 0418b56..61e58d6 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 = {"HolidayThemes", "CustomColors", "CustomIcons", "CustomSignals", "CustomSounds"}; std::set modelUIKeys = {"DynamicPathWidth", "HideLeadMarker", "LaneLinesWidth", "PathEdgeWidth", "PathWidth", "RoadEdgesWidth", "UnlimitedLength"}; - std::set qolKeys = {"DriveStats", "FullMap", "HideSpeed", "MapStyle"}; + std::set qolKeys = {"DriveStats", "FullMap", "HideSpeed", "MapStyle", "WheelSpeed"}; std::set screenKeys = {"HideUIElements", "ScreenBrightness", "ScreenBrightnessOnroad", "ScreenRecorder", "ScreenTimeout", "ScreenTimeoutOnroad", "StandbyMode"}; std::map toggles; diff --git a/selfdrive/ui/qt/onroad.cc b/selfdrive/ui/qt/onroad.cc index 7be228b..0dcbf7c 100644 --- a/selfdrive/ui/qt/onroad.cc +++ b/selfdrive/ui/qt/onroad.cc @@ -581,7 +581,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 269ab83..1b8b794 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -372,6 +372,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 23e8454..07630e1 100644 --- a/selfdrive/ui/ui.h +++ b/selfdrive/ui/ui.h @@ -237,6 +237,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;