Active Topics

 


Reply
Thread Tools
Posts: 959 | Thanked: 3,427 times | Joined on Apr 2012
#41
Rinigus, how do you have it running on OnePlus X? I can't install as there are no OS updates past 2.0.2.51.
 

The Following User Says Thank You to taixzo For This Useful Post:
Posts: 1,414 | Thanked: 7,547 times | Joined on Aug 2016 @ Estonia
#42
Originally Posted by taixzo View Post
Rinigus, how do you have it running on OnePlus X? I can't install as there are no OS updates past 2.0.2.51.
I have Oneplus X on 2.1.0.11. See https://wiki.merproject.org/wiki/Ada...ishOS_for_onyx for current release and http://images.devaamo.fi/sfe/onyx/beta-5/README.html for OTA instructions. Runs perfectly (SFOS and mapbox-sfos).
 

The Following 2 Users Say Thank You to rinigus For This Useful Post:
Posts: 339 | Thanked: 1,623 times | Joined on Oct 2013 @ France
#43
Originally Posted by MartinK View Post
I guess if there is no marker/polyline support in the widget itself I should be able to use the existing polyline & POI overlays in modRana by putting them on top of the widget and adjusting them accordingly (scale, rotation, offset, etc.). But it could be quite tricky if the widget supports non-90 degree view angles & fractional scrolling. Also synchronization with animations would have to be handled so that the overlay does not lag behind during animations. Coordinate transformations could also potentially by fun in some cases.
I followed in QtLocation 5.9 source code how they were handling the MapPolyline elements that can be added to the Map QML element.

So far, I found out that :
qgeomap.cpp adds all those items in a "m_mapItems" list as "QDeclarativeGeoMapItemBase"

As subclass called "QDeclarativePolylineMapItem" is in charge of the Polyline element, which is then drawn directly with OpenGL calls on top of the map.

This uses an internal "MapPolylineNode" class, which is doing the OpenGL call (things like "geometry_.setDrawingMode(QSGGeometry:rawTriangl eStrip);" )., through the "geometry_" variable.

The QDeclarative*MapItems (polylines, polygons, ...) exist from Qt 5.0 from the documentation, so it may be possible to restore this functionality by making the MapboxMap a derivative of the GeoMap class, and adding some glue (if the one from 5.6 has enough) ?

The second way would be to code that behavior in a custom class, like MapboxMap, but keeping the raw GL way (to let the GPU handle the coordinates changes, and not computing them by hand which would be difficult).

And then, there is the solution rinigus presented, to add a layer through GeoJSon to do this in the MapBoxGL Engine.
I am not sure yet what the advantages and drawbacks of each solutions are, especially the overhead of adding a layer compared to a few direct GL calls.

Originally Posted by rinigus View Post
Edit: Looks like the same lib is used in J1. In my case (Oneplus X), I have libGLESv2_adreno.so (and others similar, without 200). Whether its an issue, don't know - I am not a specialist on OpenGL.
If stucked, we may ask somone of Jolla staff for that one (maybe during a community meeting, or through TJC) ? Having a high performances mapping/routing application is probably something they would like to have in their catalog, seeing how limited the default maps application they provide is. Not sure who is the OpenGL specialist there. Stskeeps obvioulsy comes in mind, and back in time, there was also w00teh. But I am sure there are others...
 

The Following 3 Users Say Thank You to Zeta For This Useful Post:
Posts: 339 | Thanked: 1,623 times | Joined on Oct 2013 @ France
#44
Originally Posted by rinigus View Post
Looking good. Would you mind to add debug info for qmapboxgl and mapbox-sfos. As far as I can see, its packages qmapboxgl-debugsource and mapbox-sfos-debuginfo .
Done.

Translating in commands, for future me (and other who could need to):
Originally Posted by rinigus View Post
Actually, you could add http://repo.merproject.org/obs/home:...mv7hl/armv7hl/ as a repo and then just use
Code:
pkcon install
. It will also allow you to upgrade in future, while we hunt for the bug.
=> (warning, the last "armv7hl" is not part of the repo name)
Code:
 devel-su ssu addrepo mer_rinigus http://repo.merproject.org/obs/home:/rinigus:/maps/sailfish_latest_armv7hl/ 
ssu updaterepos
pkcon refresh
pkcon install mapbox-sfos-debuginfo qmapboxgl-debugsource
Originally Posted by rinigus View Post
If I can get these crash backtraces, we could open an issue for mapbox-gl-native and explain what has been done to make it run on SFOS. Maybe they can help.
Here are the backtraces for 3 consecutive runs : https://pastebin.com/QiPcKsfi

Is there another gdb command output you need ? (my gdb is a bit rusty...)

Originally Posted by rinigus View Post
As for crashes occurring for J1 and Photon Q: I wonder if its some OpenGL limitation of these devices. I haven't fiddled with OpenGL settings while compiling qmapboxgl, but maybe I should (have to look it up). But then not sure why it would crash on free/malloc calls...
Seeing as the last run crashed on QSslConfiguration, we are probably chasing a memory corruption bug. The kind that can corrupt stack or heap at some place in the code, and leaving its effects to something else later (like free and malloc that are using pointers) that is what gdb captures, and not the real thing that broke the stack.
It is usually one variable stored above in the memory that got out of its bounds, but can be more subtle. This can be "quite easy" to find in a small micro-controller, but I don't know how to show it in that case, as there are a lot of allocation/deallocation happening and so it can be difficult to know what was in memory before when the problem happened. Especially as valgrind doesn't run, from your tests.
Some basics tests could be done, like adding tests around all mallocs and pointers usage, leading to a qFatal() call to stop the application with a core dump and details. However, if the problem is on the GPU side (as only the adreno 200 shows it right now), it would not help that much..
 

The Following 3 Users Say Thank You to Zeta For This Useful Post:
otsaloma's Avatar
Posts: 141 | Thanked: 1,530 times | Joined on May 2011 @ Finland
#45
For me as well, with Jolla 1, it crashes, as soon as I interact with the map. I'll leave debugging to more capable hands. On the tablet, everything looks fine.

Device: Jolla Tablet
SFOS version: 2.1.1.26
Did it crash? No
Is the map displayed properly? Yes
Are the names rendered? Yes
Does movement work? Yes
Does zoom work? Yes
Does rotation work? Yes
Does tilting work? Yes
 

The Following 3 Users Say Thank You to otsaloma For This Useful Post:
Posts: 1,548 | Thanked: 7,510 times | Joined on Apr 2010 @ Czech Republic
#46
Originally Posted by rinigus View Post
As far as I remember, qmapboxgl does use some QtLocation structures, but I could be mistaken. If this will disqualify it from current Harbour - so be it. I am sure that Jolla will change the rules regarding QtLocation when they manage to get into working on QtLocation 5.6. There is surely a pressure from their customers to get it sorted, maybe just would take some time. In meanwhile, we can distribute via OpenRepos, if needed.
Yep, that sounds like a good plan. All the hacks one needs to do to get stuff to Jolla Store (modRana has a fair share of them as well) is really sad and one needs to draw a line somewhere.

Originally Posted by rinigus View Post
Mapbox GL Native allows you to add all these elements via GeoJSON and styling of the data. This should allow to add POIs, routes, any polygon... See https://github.com/mapbox/mapbox-gl-...window.cpp#L96 for the start of the example.
Interesting! That looks pretty powerful and useful.

Originally Posted by rinigus View Post
I am planning to expose similar API as well as write a small wrapper allowing you to add routes/POIs/location icon easier. So, you would not have to draw anything above it, just regular widgets as you do for interaction. Let's see where I can get in a week.
That definitely sounds like a good idea - to provide a general purpose "add/remove" POI marker/route API while still allowing to use the lower-level GeoJSON as well for more advanced stuff.

BTW, any idea if the markers could be made clickable ? Some generic "marker <id> clicked, with id set/provided at marker creation would be enough. Otherwise it would be tricky to resolve which marker the user has clicked on due to rotation/animation/camera angle, etc. Not are a blocker though as there are ways to address the markers even when they are not clickable, by eq. showing a list, etc. Still would be nice to have & is IIRC already possible with current solutions in Poor Maps and in modRana.

Originally Posted by rinigus View Post
We would probably need tile-based widgets, as you all have already, as well to support sources that are not compatible with the mapbox-gl. So, you would probably end up having two alternative ways to show the maps that you would have to switch in between in the application.
Yeah, supporting to map views/widgets is certainly the way to go for the time being.

On the other hand I wonder - how hard it would be to also support map tiles in the Open GL widget ? That way you could use specialized tiled map layers (traffic, weather, OSM bugs, etc.) on top of the rendered map layer or even just use tiled maps directly with all the benefits of an Open GL based map widget. It would also mean mapping apps could eventually drop their solutions for tiled maps as the Open GL map widget would cover that as well.

As an example of an Open GL based tiled map widget, Cloud GPS had that oh so many years ago back on the good old N900:

https://talk.maemo.org/showthread.php?t=58402


But in any case no pressure - this is just a nice to have feature while the widget already provides a lot of pretty cool stuff & there is certainly much more things that need to be solved.

Originally Posted by rinigus View Post
Widget seems to be locked. Its actually possible to use other data sources, as done for https://openmaptiles.org/ . Right now I am developing against Mapbox data sources, since it easiest. Already now it should be possible to use other sources, but I have not tried.
Nice - good to know it's already possible to use alternative data source.

Originally Posted by rinigus View Post
As for offline, as soon as widget is ready, I am planning to add offline support for it via OSM Scout Server. We should be able to squeeze in additional datapack for mapbox gl, I presume it will be of similar size to mapnik datapack. Hopefully, data.modrana.org will be fine to host it .
Yep, no problem at all - there should definitely be enough space for that.

Originally Posted by rinigus View Post
So, the plan is to go all the way with the full online and offline support. And I don't think there are any major roadblocks on the way.
Nice!
__________________
modRana: a flexible GPS navigation system
Mieru: a flexible manga and comic book reader
Universal Components - a solution for native looking yet component set independent QML appliactions (QtQuick Controls 2 & Silica supported as backends)
 

The Following 3 Users Say Thank You to MartinK For This Useful Post:
Posts: 1,414 | Thanked: 7,547 times | Joined on Aug 2016 @ Estonia
#47
Originally Posted by Zeta View Post
I followed in QtLocation 5.9 source code how they were handling the MapPolyline elements that can be added to the Map QML element.

So far, I found out that :
qgeomap.cpp adds all those items in a "m_mapItems" list as "QDeclarativeGeoMapItemBase"

As subclass called "QDeclarativePolylineMapItem" is in charge of the Polyline element, which is then drawn directly with OpenGL calls on top of the map.

This uses an internal "MapPolylineNode" class, which is doing the OpenGL call (things like "geometry_.setDrawingMode(QSGGeometry:rawTriangl eStrip);" )., through the "geometry_" variable.

The QDeclarative*MapItems (polylines, polygons, ...) exist from Qt 5.0 from the documentation, so it may be possible to restore this functionality by making the MapboxMap a derivative of the GeoMap class, and adding some glue (if the one from 5.6 has enough) ?

The second way would be to code that behavior in a custom class, like MapboxMap, but keeping the raw GL way (to let the GPU handle the coordinates changes, and not computing them by hand which would be difficult).

And then, there is the solution rinigus presented, to add a layer through GeoJSon to do this in the MapBoxGL Engine.
I am not sure yet what the advantages and drawbacks of each solutions are, especially the overhead of adding a layer compared to a few direct GL calls.
When compared to QtLocation, we don't have to be compatible with the other modules. This makes it significantly easier. My reasoning for going with GeoJSON is that
  • originally supported by Mapbox GL Native (same as for Mapbox GL JS)
  • simple to implement since it directly interfaces with QMapboxGL

As for comparison in terms of features: using GeoJSON we can position the added features in between the map layers. As far as I could understand, you style the added features using the same styling as you do for the map. For example, its possible to add calculated road as a layer after the road on the map but before road names layer. As a result, your calculated road is visible, but does not cover road names. As a limitation, it was mentioned that MapboxGL added layers don't support transparency. However, with the ability of positioning the layer accordingly, I don't think its a problem.

There is one complication that has to be taken into account while writing a widget - QMapboxGL object lives in the rendering thread, not main thread. We can have an access via update method of the widget when you are allowed to sync, but otherwise its "no touch" condition. The second complication is that, in SFOS, when you minimize the application, the corresponding OpenGL scene is destroyed. So, when the application is restored, the widget is constructed again and we have to add all the layers/sources/paint properties.

I am writing now the part that will keep track on sources/layers/ and other properties and would patch or play back all the needed (non-removed) features on construction. It would probably take few evenings to implement it, but nothing really major. When ready, I'll make a new demo.

Originally Posted by Zeta View Post
If stucked, we may ask somone of Jolla staff for that one (maybe during a community meeting, or through TJC) ? Having a high performances mapping/routing application is probably something they would like to have in their catalog, seeing how limited the default maps application they provide is. Not sure who is the OpenGL specialist there. Stskeeps obvioulsy comes in mind, and back in time, there was also w00teh. But I am sure there are others...
If we have a good program to show, the interest will be there, I am sure .
 

The Following User Says Thank You to rinigus For This Useful Post:
Posts: 1,414 | Thanked: 7,547 times | Joined on Aug 2016 @ Estonia
#48
Originally Posted by Zeta View Post
Done.

Translating in commands, for future me (and other who could need to):

=> (warning, the last "armv7hl" is not part of the repo name)
Code:
 devel-su ssu addrepo mer_rinigus http://repo.merproject.org/obs/home:/rinigus:/maps/sailfish_latest_armv7hl/ 
ssu updaterepos
pkcon refresh
pkcon install mapbox-sfos-debuginfo qmapboxgl-debugsource

Here are the backtraces for 3 consecutive runs : https://pastebin.com/QiPcKsfi

Is there another gdb command output you need ? (my gdb is a bit rusty...)


Seeing as the last run crashed on QSslConfiguration, we are probably chasing a memory corruption bug. The kind that can corrupt stack or heap at some place in the code, and leaving its effects to something else later (like free and malloc that are using pointers) that is what gdb captures, and not the real thing that broke the stack.
It is usually one variable stored above in the memory that got out of its bounds, but can be more subtle. This can be "quite easy" to find in a small micro-controller, but I don't know how to show it in that case, as there are a lot of allocation/deallocation happening and so it can be difficult to know what was in memory before when the problem happened. Especially as valgrind doesn't run, from your tests.
Some basics tests could be done, like adding tests around all mallocs and pointers usage, leading to a qFatal() call to stop the application with a core dump and details. However, if the problem is on the GPU side (as only the adreno 200 shows it right now), it would not help that much..
For some reason, we still don't have debug symbols for the qmapboxgl classes. Future me will look into it and I should probably make a separate debug build for it. Would have to look into it. I can try to submit the issue as we are now and see if there is something obvious that I missed. I'll CC you in github with your other-github-name when I get to submit the crash issue.
 

The Following User Says Thank You to rinigus For This Useful Post:
Posts: 1,414 | Thanked: 7,547 times | Joined on Aug 2016 @ Estonia
#49
Originally Posted by MartinK View Post
That definitely sounds like a good idea - to provide a general purpose "add/remove" POI marker/route API while still allowing to use the lower-level GeoJSON as well for more advanced stuff.

BTW, any idea if the markers could be made clickable ? Some generic "marker <id> clicked, with id set/provided at marker creation would be enough. Otherwise it would be tricky to resolve which marker the user has clicked on due to rotation/animation/camera angle, etc. Not are a blocker though as there are ways to address the markers even when they are not clickable, by eq. showing a list, etc. Still would be nice to have & is IIRC already possible with current solutions in Poor Maps and in modRana.
Its possible to provide location for a click since we can calculate lat/lon for any pixel. However, due to the map object living in another thread, the communication would be via request and signal back:

onClickEvent: you ask for coordinate via async mechanism. Something like "map.getCoordinates(my_tag_as_string, qpoint)

you get reply via signal:

onCoordinatesRequest: point

Then you could implement adding of other widgets on the top which will allow you to interact. Tricky with panning/rotating/tilting though. Maybe the map programs would just remove widget on rotation,tilting and follow panning signals to move it around.

I would prefer to keep out from GeoJSON parsing and figuring out what did you add there. Maybe widget-added POIs could get extra support, but let's see when we get there (later this week?).

Originally Posted by MartinK View Post
Yeah, supporting to map views/widgets is certainly the way to go for the time being.

On the other hand I wonder - how hard it would be to also support map tiles in the Open GL widget ? That way you could use specialized tiled map layers (traffic, weather, OSM bugs, etc.) on top of the rendered map layer or even just use tiled maps directly with all the benefits of an Open GL based map widget. It would also mean mapping apps could eventually drop their solutions for tiled maps as the Open GL map widget would cover that as well.

...

But in any case no pressure - this is just a nice to have feature while the widget already provides a lot of pretty cool stuff & there is certainly much more things that need to be solved.
I suspect that by the time we will get to adding tiles into the widget, noone will want to use them. Except checking traffic in google maps layer . Probably easier to keep the tiled versions around for old hardware (if we cannot make it work on J1 and similar) or other occasional use and focus on getting vector maps supported the best.
 

The Following User Says Thank You to rinigus For This Useful Post:
Posts: 1,414 | Thanked: 7,547 times | Joined on Aug 2016 @ Estonia
#50
I will be updating test results in this post as they come along. Only SFOS with Qt 5.6 is supported (2.1.x.y and higher), hence I am not reporting issues with the earlier SFOS versions.

All works:
  • Oneplus X, SFOS 2.1.0.11
  • Oneplus One, SFOS 2.1.1.24
  • Jolla C, SFOS 2.1.1.26
  • Sony X, SFOS 2.1.1.26
  • Jolla Tablet, SFOS 2.1.1.26

Failed

Last edited by rinigus; 2017-09-19 at 19:05. Reason: J1+=1; sony X version
 

The Following 4 Users Say Thank You to rinigus For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 15:49.