Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Tanggeshi opened this issue Jun 9, 2020 · 4 comments
Open

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

Tanggeshi opened this issue Jun 9, 2020 · 4 comments

Comments

@Tanggeshi
Copy link

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
Copy link
Owner

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 Monitor_Pvt 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
Copy link
Contributor

lenhart commented Mar 9, 2021

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
Copy link
Owner

acebrianjuan commented Mar 10, 2021

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):

coordinate: m_monitor_pvt_wrapper.position

calls this property (C++) (which is linked to the MonitorPvtWrapper::position() function):

Q_PROPERTY(QVariant position READ position NOTIFY dataChanged)

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:

/*!
Returns the last known position.
*/
QVariant MonitorPvtWrapper::position() const
{
if (!m_bufferMonitorPvt.empty())
{
gnss_sdr::MonitorPvt mpvt = m_bufferMonitorPvt.back();
return QVariant::fromValue(QGeoCoordinate(mpvt.latitude(), mpvt.longitude()));
}
else
{
return QVariant();
}
}

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 c70b053.

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

Best,
Álvaro

@lenhart
Copy link
Contributor

lenhart commented Mar 13, 2021

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants