Use wheel speed in the onroad UI

This commit is contained in:
FrogAi
2024-02-27 16:34:47 -07:00
parent cfbb472acd
commit d10d422fcf
6 changed files with 6 additions and 2 deletions

View File

@@ -428,6 +428,7 @@ std::unordered_map<std::string, uint32_t> keys = {
{"WarningSoftVolume", PERSISTENT}, {"WarningSoftVolume", PERSISTENT},
{"WarningImmediateVolume", PERSISTENT}, {"WarningImmediateVolume", PERSISTENT},
{"WheelIcon", PERSISTENT}, {"WheelIcon", PERSISTENT},
{"WheelSpeed", PERSISTENT},
}; };
} // namespace } // namespace

View File

@@ -54,6 +54,7 @@ FrogPilotVisualsPanel::FrogPilotVisualsPanel(SettingsWindow *parent) : FrogPilot
{"FullMap", "Full Sized Map", "Maximize the size of the map in the onroad UI.", ""}, {"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.", ""}, {"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'.", ""}, {"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"}, {"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"},

View File

@@ -35,7 +35,7 @@ private:
std::set<QString> customOnroadUIKeys = {"AccelerationPath", "AdjacentPath", "BlindSpotPath", "FPSCounter", "LeadInfo", "PedalsOnUI", "RoadNameUI"}; std::set<QString> customOnroadUIKeys = {"AccelerationPath", "AdjacentPath", "BlindSpotPath", "FPSCounter", "LeadInfo", "PedalsOnUI", "RoadNameUI"};
std::set<QString> customThemeKeys = {"HolidayThemes", "CustomColors", "CustomIcons", "CustomSignals", "CustomSounds"}; std::set<QString> customThemeKeys = {"HolidayThemes", "CustomColors", "CustomIcons", "CustomSignals", "CustomSounds"};
std::set<QString> modelUIKeys = {"DynamicPathWidth", "HideLeadMarker", "LaneLinesWidth", "PathEdgeWidth", "PathWidth", "RoadEdgesWidth", "UnlimitedLength"}; std::set<QString> modelUIKeys = {"DynamicPathWidth", "HideLeadMarker", "LaneLinesWidth", "PathEdgeWidth", "PathWidth", "RoadEdgesWidth", "UnlimitedLength"};
std::set<QString> qolKeys = {"DriveStats", "FullMap", "HideSpeed", "MapStyle"}; std::set<QString> qolKeys = {"DriveStats", "FullMap", "HideSpeed", "MapStyle", "WheelSpeed"};
std::set<QString> screenKeys = {"HideUIElements", "ScreenBrightness", "ScreenBrightnessOnroad", "ScreenRecorder", "ScreenTimeout", "ScreenTimeoutOnroad", "StandbyMode"}; std::set<QString> screenKeys = {"HideUIElements", "ScreenBrightness", "ScreenBrightnessOnroad", "ScreenRecorder", "ScreenTimeout", "ScreenTimeoutOnroad", "StandbyMode"};
std::map<std::string, ParamControl*> toggles; std::map<std::string, ParamControl*> toggles;

View File

@@ -581,7 +581,7 @@ void AnnotatedCameraWidget::updateState(const UIState &s) {
// Handle older routes where vEgoCluster is not set // Handle older routes where vEgoCluster is not set
v_ego_cluster_seen = v_ego_cluster_seen || car_state.getVEgoCluster() != 0.0; 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<float>(0.0, v_ego) : 0.0; speed = cs_alive ? std::max<float>(0.0, v_ego) : 0.0;
speed *= s.scene.is_metric ? MS_TO_KPH : MS_TO_MPH; speed *= s.scene.is_metric ? MS_TO_KPH : MS_TO_MPH;

View File

@@ -372,6 +372,7 @@ void ui_update_frogpilot_params(UIState *s) {
scene.hide_speed = quality_of_life_visuals && params.getBool("HideSpeed"); scene.hide_speed = quality_of_life_visuals && params.getBool("HideSpeed");
scene.hide_speed_ui = scene.hide_speed && params.getBool("HideSpeedUI"); scene.hide_speed_ui = scene.hide_speed && params.getBool("HideSpeedUI");
scene.map_style = quality_of_life_visuals ? params.getInt("MapStyle") : 0; 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.personalities_via_screen = params.getBool("PersonalitiesViaScreen") && params.getBool("AdjustablePersonalities");
scene.random_events = params.getBool("RandomEvents"); scene.random_events = params.getBool("RandomEvents");

View File

@@ -237,6 +237,7 @@ typedef struct UIScene {
bool unlimited_road_ui_length; bool unlimited_road_ui_length;
bool use_si; bool use_si;
bool use_vienna_slc_sign; bool use_vienna_slc_sign;
bool wheel_speed;
float acceleration; float acceleration;
float adjusted_cruise; float adjusted_cruise;