Visuals - Quality of Life - Map Style
Select a map style to use with navigation. Co-Authored-By: mike8643 <98910897+mike8643@users.noreply.github.com> Co-Authored-By: multikyd <72329880+multikyd@users.noreply.github.com> Co-Authored-By: Tim Jumpertz <44060819+pencilpusher@users.noreply.github.com>
This commit is contained in:
parent
859e5dfe52
commit
6ff42e6b80
@ -293,6 +293,30 @@ void MapWindow::updateState(const UIState &s) {
|
|||||||
route_rcv_frame = sm.rcv_frame("navRoute");
|
route_rcv_frame = sm.rcv_frame("navRoute");
|
||||||
updateDestinationMarker();
|
updateDestinationMarker();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Map Styling - Credit goes to OPKR!
|
||||||
|
int map_style = uiState()->scene.map_style;
|
||||||
|
|
||||||
|
if (map_style != previous_map_style) {
|
||||||
|
std::unordered_map<int, std::string> styleUrls = {
|
||||||
|
{0, "mapbox://styles/commaai/clkqztk0f00ou01qyhsa5bzpj"}, // Stock openpilot
|
||||||
|
{1, "mapbox://styles/mapbox/streets-v11"}, // Mapbox Streets
|
||||||
|
{2, "mapbox://styles/mapbox/outdoors-v11"}, // Mapbox Outdoors
|
||||||
|
{3, "mapbox://styles/mapbox/light-v10"}, // Mapbox Light
|
||||||
|
{4, "mapbox://styles/mapbox/dark-v10"}, // Mapbox Dark
|
||||||
|
{5, "mapbox://styles/mapbox/satellite-v9"}, // Mapbox Satellite
|
||||||
|
{6, "mapbox://styles/mapbox/satellite-streets-v11"}, // Mapbox Satellite Streets
|
||||||
|
{7, "mapbox://styles/mapbox/navigation-day-v1"}, // Mapbox Navigation Day
|
||||||
|
{8, "mapbox://styles/mapbox/navigation-night-v1"}, // Mapbox Navigation Night
|
||||||
|
{9, "mapbox://styles/mapbox/traffic-night-v2"}, // Mapbox Traffic Night
|
||||||
|
{10, "mapbox://styles/mike854/clt0hm8mw01ok01p4blkr27jp"}, // mike854's (Satellite hybrid)
|
||||||
|
};
|
||||||
|
|
||||||
|
std::unordered_map<int, std::string>::iterator it = styleUrls.find(map_style);
|
||||||
|
m_map->setStyleUrl(QString::fromStdString(it->second));
|
||||||
|
}
|
||||||
|
|
||||||
|
previous_map_style = map_style;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWindow::setError(const QString &err_str) {
|
void MapWindow::setError(const QString &err_str) {
|
||||||
|
@ -81,6 +81,10 @@ private:
|
|||||||
// FrogPilot variables
|
// FrogPilot variables
|
||||||
Params params;
|
Params params;
|
||||||
|
|
||||||
|
int previous_map_style;
|
||||||
|
|
||||||
|
uint64_t model_rcv_frame = 0;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void updateState(const UIState &s);
|
void updateState(const UIState &s);
|
||||||
|
|
||||||
|
@ -405,6 +405,7 @@ void ui_update_frogpilot_params(UIState *s) {
|
|||||||
scene.driver_camera = quality_of_life_visuals && params.getBool("DriverCamera");
|
scene.driver_camera = quality_of_life_visuals && params.getBool("DriverCamera");
|
||||||
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.speed_limit_controller = scene.longitudinal_control && params.getBool("SpeedLimitController");
|
scene.speed_limit_controller = scene.longitudinal_control && params.getBool("SpeedLimitController");
|
||||||
scene.show_slc_offset = scene.speed_limit_controller && params.getBool("ShowSLCOffset");
|
scene.show_slc_offset = scene.speed_limit_controller && params.getBool("ShowSLCOffset");
|
||||||
|
@ -296,6 +296,7 @@ typedef struct UIScene {
|
|||||||
int custom_signals;
|
int custom_signals;
|
||||||
int desired_follow;
|
int desired_follow;
|
||||||
int driver_camera_timer;
|
int driver_camera_timer;
|
||||||
|
int map_style;
|
||||||
int obstacle_distance;
|
int obstacle_distance;
|
||||||
int obstacle_distance_stock;
|
int obstacle_distance_stock;
|
||||||
int steering_angle_deg;
|
int steering_angle_deg;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user