PX4 FC does not return MAVLINK message for GLOBAL_POSITION_INT


I am having trouble getting the MAVLINK_MSG_ID_GLOBAL_POSITION_INT message from the PX4 FC.

I opened an issue on mavlink github

After working with Hamish, and looking at the mavlink inspector widget (screen shot attached here), we noticed that the message for GLOBAL_POSITION_INT is not returned. I did see a bunch of other messages returned for the 3 min loop I have running to scan mavlink messages in my application.

Can you please help me understand why I dont get the message ?

For now I will be using the MAVLINK_MSG_ID_GPS_RAW_INT message to get the UAV latitude, longitude and altitude.

Mostly likely the system does not have a valid local position yet - ie you have raw output from the GPS, but it is not sufficiently good to use by the system. As such, the raw value might be published but not the final value.
Does your vehicle have position lock? ie can it ARM, can you take it off from QGC?
A real log should be able to tell you what is going on.

Does your vehicle have position lock? ie can it ARM, can you take it off from QGC?

Yes to both.

I am wondering if the GPS needs to be calibrated to get the GLOBAL_POSITION_INT ?

In my experiments yesterday and today - the UAV is not flying and not armed. And so the GPS was not calibrated.

What do you think ?

What you need to do is make sure that your vehicle can fly/has position lock, collect a log and post that to the review site, then repost the link here: see https://docs.px4.io/en/getting_started/flight_reporting.html

And so the GPS was not calibrated.

I would not use this terminology because GPS hardware does not need calibration or setup on PX4. What I think you mean to say is that the GPS does not have a position lock.

If so, then yes, it is quite possible that in your earlier tests, you did not have a position lock.

Thanks Hamish. I will try getting the GPS position lock (which I think is acquired once the GPS is detected and/or calibrated IMO). I’ll let you know

Just a FYI…
I just calibrated the drone but indoors but did not get the GPS lock (screen shot attached). So no GLOBAL_POSITION_INT yet. Will try it outdoors next

If you can fly a mission or takeoff using QGC then you should have position lock.

To be honest, with the limitations I have now, I cant fly the UAV. Is that going to be an issue ?

Hi Hamish - An update. I calibrated the UAV outdoors and acquired the GPS lock (screen shot attached). I was then able to see the GLOBAL_POSITION_INT message in the widget at 50Hz.

Now if I can understand how to close this issue :slight_smile:

Excellent! This is closed then :slight_smile: