Visuals - Model UI - Dynamic Path Width
Have the path width dynamically adjust based on the current engagement state of openpilot.
This commit is contained in:
parent
41afd0f89a
commit
a6b7824b4e
@ -111,6 +111,14 @@ void update_model(UIState *s,
|
||||
}
|
||||
|
||||
// update path
|
||||
float path;
|
||||
if (scene.dynamic_path_width) {
|
||||
float multiplier = scene.enabled ? 1.0f : scene.always_on_lateral_active ? 0.75f : 0.50f;
|
||||
path = 0.9 * multiplier;
|
||||
} else {
|
||||
path = scene.path_width;
|
||||
}
|
||||
|
||||
auto lead_count = model.getLeadsV3().size();
|
||||
if (lead_count > 0) {
|
||||
auto lead_one = model.getLeadsV3()[0];
|
||||
@ -372,6 +380,9 @@ void ui_update_frogpilot_params(UIState *s) {
|
||||
bool radarless_model = params.get("Model") == "radical-turtle";
|
||||
scene.lead_detection_threshold = longitudinal_tune && !radarless_model ? params.getInt("LeadDetectionThreshold") / 100.0f : 0.5;
|
||||
|
||||
scene.model_ui = params.getBool("ModelUI");
|
||||
scene.dynamic_path_width = scene.model_ui && params.getBool("DynamicPathWidth");
|
||||
|
||||
bool quality_of_life_controls = params.getBool("QOLControls");
|
||||
scene.reverse_cruise = quality_of_life_controls && params.getBool("ReverseCruise");
|
||||
scene.reverse_cruise_ui = params.getBool("ReverseCruiseUI");
|
||||
|
@ -198,6 +198,7 @@ typedef struct UIScene {
|
||||
bool conditional_experimental;
|
||||
bool disable_smoothing_mtsc;
|
||||
bool disable_smoothing_vtsc;
|
||||
bool dynamic_path_width;
|
||||
bool dynamic_pedals_on_ui;
|
||||
bool enabled;
|
||||
bool experimental_mode;
|
||||
@ -215,6 +216,7 @@ typedef struct UIScene {
|
||||
bool lead_info;
|
||||
bool live_valid;
|
||||
bool map_open;
|
||||
bool model_ui;
|
||||
bool numerical_temp;
|
||||
bool online;
|
||||
bool onroad_distance_button;
|
||||
|
Loading…
x
Reference in New Issue
Block a user