Use wheel speed in the onroad UI
This commit is contained in:
@@ -428,6 +428,7 @@ std::unordered_map<std::string, uint32_t> keys = {
|
||||
{"WarningSoftVolume", PERSISTENT},
|
||||
{"WarningImmediateVolume", PERSISTENT},
|
||||
{"WheelIcon", PERSISTENT},
|
||||
{"WheelSpeed", PERSISTENT},
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -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"},
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ private:
|
||||
std::set<QString> customOnroadUIKeys = {"AccelerationPath", "AdjacentPath", "BlindSpotPath", "FPSCounter", "LeadInfo", "PedalsOnUI", "RoadNameUI"};
|
||||
std::set<QString> customThemeKeys = {"HolidayThemes", "CustomColors", "CustomIcons", "CustomSignals", "CustomSounds"};
|
||||
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::map<std::string, ParamControl*> toggles;
|
||||
|
||||
@@ -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<float>(0.0, v_ego) : 0.0;
|
||||
speed *= s.scene.is_metric ? MS_TO_KPH : MS_TO_MPH;
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user