acebrianjuan / gnss-sdr-monitor

A graphical user interface to monitor the GNSS-SDR status in real time
GNU General Public License v3.0
85 stars 38 forks source link

Why the position can't show on map? #8

Open Tanggeshi opened 4 years ago

Tanggeshi commented 4 years ago

GNSS-SDR-Monitor is really a very wonderful tool ! Thank you for sharing it!

GNSS-SDR-Monitor I can get the Lat, Lon, Alt etc. from the status of the Telecommand interface, but in the map, there is no any information of the position. I wonder if are there some settings I have not set right?

acebrianjuan commented 4 years ago

Hi @Tanggeshi,

GNSS-SDR-Monitor is really a very wonderful tool ! Thank you for sharing it!

I am very glad that you find the gnss-sdr-monitor GUI useful :)

I can get the Lat, Lon, Alt etc. from the status of the Telecommand interface, but in the map, there is no any information of the position. I wonder if are there some settings I have not set right?

You probably need to check your _MonitorPvt settings. Make sure that the PVT Monitor port is activated in your GNSS-SDR configuration file and use the same port number for the Monitor_Pvt port in the gnss-sdr-monitor preferences.

This short guide will help you.

Let me know if it worked well for you.

Regards, Álvaro

lenhart commented 3 years ago

Hey @acebrianjuan, I just realized that this issue might be connected to the issue I am facing with the map. I wanted to investigate that further before opening an issue or preferably fixing it, but as I now have to do other things first, I at least add this to this issue.

When starting gnss-sdr-monitor I get the error: qrc:/qml/main.qml:43:9: Unable to assign [undefined] to QGeoCoordinate which might be the reason why the map is not working. Maybe you can make sense of this (maybe a dependency missing or sth?). I am happy to perform additional tests but at least I can say that the ports are setup correctly for me.

Cheers Malte

acebrianjuan commented 3 years ago

Hi Malte (@lenhart),

I have just tested the GUI with the latest version of GNSS-SDR available in the next branch (gnss-sdr version 0.0.14.git-next-37c90a7ab) and all the views are working fine for me, as you can see in the following screenshot:

gnss-sdr-monitor_screenshot

When starting gnss-sdr-monitor I get the error: qrc:/qml/main.qml:43:9: Unable to assign [undefined] to QGeoCoordinate

I also get this warning but this is nothing new, as I have always come across this warning upon starting the GUI. This is most likely caused by a failing QML property binding upon construction of the Map view.

When the Map view is constructed for the first time, this causes all its child elements to be constructed too. Among these elements we have a MapQuickItem for showing the current user's position on the map, which asks to the MonitorPvtWrapper object (in charge of feeding data to the PVT-related views) for a QGeoCoordinate object via Qt's QML and C++ integration.

This line (QML): https://github.com/acebrianjuan/gnss-sdr-monitor/blob/4af0d8d3e385cde52a7c5146fb17c5b9daf1f963/src/qml/main.qml#L43

calls this property (C++) (which is linked to the MonitorPvtWrapper::position() function): https://github.com/acebrianjuan/gnss-sdr-monitor/blob/4af0d8d3e385cde52a7c5146fb17c5b9daf1f963/src/monitor_pvt_wrapper.h#L44

When there is no is no position data (such as when you start the GUI before connecting to GNSS-SDR) the function returns a default-constructed (invalid) QVariant object:

https://github.com/acebrianjuan/gnss-sdr-monitor/blob/4af0d8d3e385cde52a7c5146fb17c5b9daf1f963/src/monitor_pvt_wrapper.cpp#L96-L110

And this is when the warning message is thrown. Nevertheless, once GNSS-SDR starts feeding position data, the Map view works fine regardless of the warning.

I figured that returning a QVariant with an empty QGeoCoordinate gets rid of the warning, so this is probably the right way to do it:

return QVariant::fromValue(QGeoCoordinate());

I have just pushed this fix in https://github.com/acebrianjuan/gnss-sdr-monitor/commit/c70b05383d67e467504a291a44bb1de1a21f0ec6.

Please let me know if it fixes the warning for you as well.

Best, Álvaro

lenhart commented 3 years ago

Hey Álvaro, I can confirm that the warning is gone, thanks for your work! I'll test the positioning issue soon (hopefully). My setup is currently set to do something else. I only remember that gnss-sdr did output positioning data but that the map was not reflecting that.. will write again when I know more! Cheers!