gazebosim / gz-gui

Builds on top of Qt to provide widgets which are useful when developing robotics applications, such as a 3D view, plots, dashboard, etc, and can be used together in a convenient unified interface.
https://gazebosim.org
Apache License 2.0
66 stars 39 forks source link

Can't open Nav Sat Map plugin (crashes) #482

Open ijnek opened 1 year ago

ijnek commented 1 year ago

Environment

Description

[GUI] [Dbg] [Application.cc:426] Loading plugin [NavSatMap]
[GUI] [Wrn] [Application.cc:797] [QT] file::/NavSatMap/NavSatMap.qml:160:3: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[GUI] [Wrn] [Application.cc:797] [QT] QObject::connect(QQuickWindow, QDeclarativeGeoMap): invalid nullptr parameter
[GUI] [Msg] Added plugin [Navigation satellite map] to main window
[GUI] [Msg] Loaded plugin [NavSatMap] from path [/usr/lib/x86_64-linux-gnu/ign-gui-6/plugins/libNavSatMap.so]
[GUI] [Wrn] [Application.cc:797] [QT] QGeoTileProviderOsm: Tileserver disabled at  QUrl("http://maps-redirect.qt.io/osm/5.8/satellite")
[GUI] [Wrn] [Application.cc:797] [QT] QGeoTileFetcherOsm: all providers resolved

Steps to reproduce

  1. ign gazebo -v 4
  2. Go to add a Nav Sat Map plugin from the right-top menu
  3. Crashes, when Nav Sat Map plugin is clicked

Output

image

jennuine commented 1 year ago

Hi @ijnek I have tried both fortress from source and binaries and am not able to reproduce the crash (I've tried launching ign gazebo -v 4 then adding the plugin manually and also ign gazebo -v 4 spherical_coordinates.sdf). I suggest double checking your installation and make sure it's set up correctly. An option is to uninstall then reinstall fortress: https://gazebosim.org/docs/fortress/install_ubuntu

jennuine commented 1 year ago

I just realized you're on jammy not focal, re-opening issue since this wasn't tested appropriately

vincentrou commented 1 year ago

I can confirm, I have the same issue with navsatmap gui plugin with same config (gazebo Fortress and Ubuntu 22.04)

JaouadROS commented 1 year ago

Any news about this bug?

azeey commented 1 year ago

There's some discussion here about a change in map providers which might be causing the issue. I tried playing with the configuration options mentioned there and in https://forum.sailfishos.org/t/using-qml-map-osm-not-working/7261 with no luck

jennuine commented 1 year ago

I was able to get a little further with the below patch but the GUI will eventually freeze. Unfortunately, I don't have time to continue looking at this but here are the steps in case anyone does (On Jammy, using Gazebo Garden):

  1. Apply below patch, rebuild
  2. gz sim -v 4 -r spherical_coordinates.sdf
  3. Add the Nav Sat Map from the plugin menu
  4. Translate the box somewhere, this is when the GUI freezes
diff --git a/src/plugins/navsat_map/NavSatMap.qml b/src/plugins/navsat_map/NavSatMap.qml
index 3e7659b2..3145e1ed 100644
--- a/src/plugins/navsat_map/NavSatMap.qml
+++ b/src/plugins/navsat_map/NavSatMap.qml
@@ -18,8 +18,8 @@ import QtQuick 2.9
 import QtQuick.Controls 2.2
 import QtQuick.Layouts 1.3
 import QtQuick.Controls.Material 2.1
-import QtLocation 5.6
-import QtPositioning 5.6
+import QtLocation 5.15
+import QtPositioning 5.15

 Item {
   id: navSatMap
@@ -92,6 +92,16 @@ Item {
   Plugin {
     id: mapPlugin
     name: "osm"
+
+    PluginParameter {
+      name: "osm.mapping.providersrepository.disabled"
+      value: "true"
+    }
+
+    PluginParameter {
+      name: "osm.mapping.providersrepository.address"
+      value: "http://maps-redirect.qt.io/osm/5.6/"
+    }
   }

   Map {
@@ -159,7 +169,7 @@ Item {

   Connections {
     target: NavSatMap
-    onNewMessage: {
+    function onNewMessage(_latitudeDeg, _longitudeDeg) {
       latitude = _latitudeDeg
       longitude = _longitudeDeg
     }

The following warning may be related:

[GUI] [Wrn] [Application.cc:845] [QT] QObject::connect(QQuickWindow, QDeclarativeGeoMap): invalid nullptr parameter
iche033 commented 1 year ago

possibly related Qt issues:

JaouadROS commented 1 year ago

@jennuine I've tried your patch and I've got the same output, the GUI freezes. @iche033 5.15.11 looks like a commercial release. If it does solve the issue, what do you suggest to try it out?

iche033 commented 1 year ago

You could try other map plugins that are listed in this page: https://doc.qt.io/qt-5/qtlocation-index.html#plugin-references-and-parameters

I don't know how well they work though.

iche033 commented 1 year ago

the mapboxgl plugin works for me. I created a PR: https://github.com/gazebosim/gz-gui/pull/520

Update: closed PR as it's not clear if we can use the mapboxgl plugin and it still freezes. Gazebo users are free to sign up to map box's free tier account and get an access token to use.

23pointsNorth commented 9 months ago

I'm on humble + garden (7.6) and just adding the navsat plugin in an empty scene creates a crash.