Full sized map

Added toggle to expand the map across the entire onroad UI screen.
This commit is contained in:
FrogAi
2024-04-02 14:19:30 -07:00
parent b873bf848a
commit 0e6e81fc53
8 changed files with 35 additions and 11 deletions
+2
View File
@@ -221,6 +221,7 @@ std::unordered_map<std::string, uint32_t> keys = {
{"AlwaysOnLateralMain", PERSISTENT},
{"ApiCache_DriveStats", PERSISTENT},
{"AutomaticUpdates", PERSISTENT},
{"BigMap", PERSISTENT},
{"BlindSpotPath", PERSISTENT},
{"CameraFPS", PERSISTENT},
{"CameraView", PERSISTENT},
@@ -273,6 +274,7 @@ std::unordered_map<std::string, uint32_t> keys = {
{"FrogPilotTogglesUpdated", PERSISTENT},
{"FrogsGoMoo", PERSISTENT},
{"FrogsGoMooTune", PERSISTENT},
{"FullMap", PERSISTENT},
{"GoatScream", PERSISTENT},
{"HideAOLStatusBar", PERSISTENT},
{"HideCEMStatusBar", PERSISTENT},
@@ -38,6 +38,7 @@ FrogPilotVisualsPanel::FrogPilotVisualsPanel(SettingsWindow *parent) : FrogPilot
{"UnlimitedLength", tr("'Unlimited' Road UI Length"), tr("Extend the display of the path, lane lines, and road edges out as far as the model can see."), ""},
{"QOLVisuals", tr("Quality of Life"), tr("Miscellaneous quality of life changes to improve your overall openpilot experience."), "../frogpilot/assets/toggle_icons/quality_of_life.png"},
{"BigMap", tr("Big Map"), tr("Increase the size of the map in the onroad UI."), ""},
{"CameraView", tr("Camera View"), tr("Choose your preferred camera view for the onroad UI. This is purely a visual change and doesn't impact how openpilot drives."), ""},
{"DriverCamera", tr("Driver Camera On Reverse"), tr("Show the driver camera feed when in reverse."), ""},
};
@@ -166,6 +167,10 @@ FrogPilotVisualsPanel::FrogPilotVisualsPanel(SettingsWindow *parent) : FrogPilot
std::vector<QString> cameraOptions{tr("Auto"), tr("Driver"), tr("Standard"), tr("Wide")};
FrogPilotButtonParamControl *preferredCamera = new FrogPilotButtonParamControl(param, title, desc, icon, cameraOptions);
toggle = preferredCamera;
} else if (param == "BigMap") {
std::vector<QString> mapToggles{"FullMap"};
std::vector<QString> mapToggleNames{tr("Full Map")};
toggle = new FrogPilotParamToggleControl(param, title, desc, icon, mapToggles, mapToggleNames);
} else {
toggle = new ParamControl(param, title, desc, icon, this);
@@ -28,7 +28,7 @@ private:
std::set<QString> customOnroadUIKeys = {"CustomPaths", "DeveloperUI", "FPSCounter", "LeadInfo"};
std::set<QString> customThemeKeys = {"CustomColors", "CustomIcons", "CustomSignals", "CustomSounds"};
std::set<QString> modelUIKeys = {"DynamicPathWidth", "HideLeadMarker", "LaneLinesWidth", "PathEdgeWidth", "PathWidth", "RoadEdgesWidth", "UnlimitedLength"};
std::set<QString> qolKeys = {"CameraView", "DriverCamera"};
std::set<QString> qolKeys = {"BigMap", "CameraView", "DriverCamera", "FullMap"};
std::set<QString> screenKeys = {};
std::map<std::string, ParamControl*> toggles;
+2
View File
@@ -160,6 +160,8 @@ void TogglesPanel::updateToggles() {
disengage_on_accelerator_toggle->setVisible(!params.getBool("AlwaysOnLateral"));
auto driver_camera_toggle = toggles["RecordFront"];
driver_camera_toggle->setVisible(!(params.getBool("DeviceManagement") && params.getBool("NoLogging") && params.getBool("NoUploads")));
auto nav_settings_left_toggle = toggles["NavSettingLeftSide"];
nav_settings_left_toggle->setVisible(!params.getBool("FullMap"));
auto experimental_mode_toggle = toggles["ExperimentalMode"];
auto op_long_toggle = toggles["ExperimentalLongitudinalEnabled"];
+20 -10
View File
@@ -84,7 +84,7 @@ void OnroadWindow::updateState(const UIState &s) {
Alert alert = Alert::get(*(s.sm), s.scene.started_frame);
alerts->updateAlert(alert);
if (s.scene.map_on_left) {
if (s.scene.map_on_left || scene.full_map) {
split->setDirection(QBoxLayout::LeftToRight);
} else {
split->setDirection(QBoxLayout::RightToLeft);
@@ -128,6 +128,11 @@ void OnroadWindow::mousePressEvent(QMouseEvent* e) {
bool sidebarVisible = geometry().x() > 0;
bool show_map = uiState()->scene.navigate_on_openpilot ? sidebarVisible : !sidebarVisible;
map->setVisible(show_map && !map->isVisible());
if (scene.big_map) {
map->setFixedWidth(width());
} else {
map->setFixedWidth(topWidget(this)->width() / 2 - UI_BORDER_SIZE);
}
}
#endif
// propagation event to parent(HomeWindow)
@@ -366,7 +371,9 @@ void ExperimentalButton::updateState(const UIState &s, bool leadInfo) {
void ExperimentalButton::paintEvent(QPaintEvent *event) {
QPainter p(this);
QPixmap img = experimental_mode ? experimental_img : engage_img;
drawIcon(p, QPoint(btn_size / 2, btn_size / 2 + y_offset), img, QColor(0, 0, 0, 166), (isDown() || !engageable) ? 0.6 : 1.0);
if (!(scene.map_open && scene.big_map)) {
drawIcon(p, QPoint(btn_size / 2, btn_size / 2 + y_offset), img, QColor(0, 0, 0, 166), (isDown() || !engageable) ? 0.6 : 1.0);
}
}
@@ -438,7 +445,7 @@ void AnnotatedCameraWidget::updateState(const UIState &s) {
has_eu_speed_limit = (nav_alive && speed_limit_sign == cereal::NavInstruction::SpeedLimitSign::VIENNA);
is_metric = s.scene.is_metric;
speedUnit = s.scene.is_metric ? tr("km/h") : tr("mph");
hideBottomIcons = (cs.getAlertSize() != cereal::ControlsState::AlertSize::NONE || customSignals != 0 && (turnSignalLeft || turnSignalRight));
hideBottomIcons = (cs.getAlertSize() != cereal::ControlsState::AlertSize::NONE || customSignals != 0 && (turnSignalLeft || turnSignalRight) || bigMapOpen);
status = s.status;
// update engageability/experimental mode button
@@ -550,10 +557,12 @@ void AnnotatedCameraWidget::drawHud(QPainter &p) {
}
// current speed
p.setFont(InterFont(176, QFont::Bold));
drawText(p, rect().center().x(), 210, speedStr);
p.setFont(InterFont(66));
drawText(p, rect().center().x(), 290, speedUnit, 200);
if (!bigMapOpen) {
p.setFont(InterFont(176, QFont::Bold));
drawText(p, rect().center().x(), 210, speedStr);
p.setFont(InterFont(66));
drawText(p, rect().center().x(), 290, speedUnit, 200);
}
p.restore();
@@ -1031,6 +1040,7 @@ void AnnotatedCameraWidget::updateFrogPilotWidgets() {
obstacleDistanceStock = scene.obstacle_distance_stock;
mapOpen = scene.map_open;
bigMapOpen = mapOpen && scene.big_map;
turnSignalLeft = scene.turn_signal_left;
turnSignalRight = scene.turn_signal_right;
@@ -1067,11 +1077,11 @@ void AnnotatedCameraWidget::updateFrogPilotWidgets() {
}
void AnnotatedCameraWidget::paintFrogPilotWidgets(QPainter &p) {
if (showAlwaysOnLateralStatusBar || showConditionalExperimentalStatusBar) {
if ((showAlwaysOnLateralStatusBar || showConditionalExperimentalStatusBar) && !bigMapOpen) {
drawStatusBar(p);
}
if (customSignals != 0 && (turnSignalLeft || turnSignalRight)) {
if (customSignals != 0 && (turnSignalLeft || turnSignalRight) && !bigMapOpen) {
if (!animationTimer->isActive()) {
animationTimer->start(totalFrames * 11); // 440 milliseconds per loop; syncs up perfectly with my 2019 Lexus ES 350 turn signal clicks
}
@@ -1080,7 +1090,7 @@ void AnnotatedCameraWidget::paintFrogPilotWidgets(QPainter &p) {
animationTimer->stop();
}
if (leadInfo) {
if (leadInfo && !bigMapOpen) {
drawLeadInfo(p);
}
+1
View File
@@ -124,6 +124,7 @@ private:
QHBoxLayout *bottom_layout;
bool alwaysOnLateralActive;
bool bigMapOpen;
bool blindSpotLeft;
bool blindSpotRight;
bool experimentalMode;
+2
View File
@@ -332,6 +332,8 @@ void ui_update_frogpilot_params(UIState *s) {
bool quality_of_life_controls = params.getBool("QOLControls");
bool quality_of_life_visuals = params.getBool("QOLVisuals");
scene.big_map = quality_of_life_visuals && params.getBool("BigMap");
scene.full_map = scene.big_map && params.getBool("FullMap");
scene.camera_view = quality_of_life_visuals ? params.getInt("CameraView") : 0;
scene.driver_camera = quality_of_life_visuals && params.getBool("DriverCamera");
}
+2
View File
@@ -175,6 +175,7 @@ typedef struct UIScene {
bool adjacent_path;
bool adjacent_path_metrics;
bool always_on_lateral_active;
bool big_map;
bool blind_spot_left;
bool blind_spot_path;
bool blind_spot_right;
@@ -185,6 +186,7 @@ typedef struct UIScene {
bool experimental_mode;
bool experimental_mode_via_screen;
bool fps_counter;
bool full_map;
bool has_auto_tune;
bool hide_lead_marker;
bool lead_info;