GPS having different readings in C++ and Python

Hello !
I’m working on using the Navio2 hat card for a python project. I do need to read the GPS inputs of the card. Longitude and lattitude seems correct and are the same between C++ and python, but in python the altitude (HMSL (height main sea level) is off, stating 300meters. Is there something off on the python example ?

Also if there is a way to get the xyz speed by using the GPS readings but i’ll be looking into that later.

Here are the answers of the Navio2 mounted on the raspberry, betweeen Python and C++

Thanks for any help

EDIT: It feels like it’s in feet ? dividing the python results by 3.2 gives an answer close to the C++, any idea on that ?

Hi Ello,

Could you please specify where Navio2’s antenna is located when you run the examples? I’d like to note that if you run them when the antenna is indoors, it’s quite hard to get the proper results.

Hi, the antenna is indoors, “stuck” to the window. I’ll try with the antenna outside and tell you if there’s any changes, in any cases the C++ readings are correct without moving the antenna. any clue as for why theres a difference ?

Update: It seems after moving the GPS antenna out, both readings seems bettter. Therefore i’m trying toget the COG and SOG. i’ve heard it’s from the “NAV-VELNED” message, but i don’t seem to receive it. Is there a way to just receive the UBX00 message using Python ? Here is how i’m coding it

Hi Ello,

The GNSS antenna always requires a clear sky view so that nothing interferes with the satellite’s signal. That’s why the readings improved in your case.

Regarding the COG and SOG data retrieving, I’m afraid I can’t be much of a help here. However, to decode NAV-VELNED message, you might try to input "NAV_VELNED" string into the source code of Navio2’s example.

1 Like

Okay ! it’s super windy here so i’ll make some tests outside when it’s settled down a bit. The keyword NAV-VELNED is to use, and i managed to extract it. Even with bad readings i have SOG and COG out and readings in python and C++ differs due to the cpu usage (python being heavier worsen the readings). Thanks for the help !
I’ve got the code if anyone wants it for further projects

1 Like

Hi Ello,

Great to know you figured it out :slightly_smiling_face: