I used a dual antenna gps module that is not in the px4 manual, which can directly provide an accurate navigation. The module leads out a data line to connect to the uart4 port of px4. But I checked the code and found _report_gps_pos.heading = NAN; I wonder if the navigation of PX4 is solved by connecting two gps ports (eg. gps1 uart4)?
The line you highlight is just the “reset” of the heading. The actual heading is set somewhere else. In order not to have stale heading data, it’s reset to NAN again immediately after. It’s a bit confusing and doesn’t help with logging the data.
What sort of GPS is this? Knowing more usually means that we can actually help you, rather than just talk in the abstract.
I am using this GPS, it can send multiple NMEA type data such as GPGGA GPGSA GPRCM etc.
I successfully obtained the latitude and longitude information and their variance, but the values of rate reading, rate position, rate velocity, rate publication and rate RTMC injection are all 0. I don’t know what the problem is.Do you have any idea? Thanks a lot!
I’m not so sure. What I can see is that there is not really a GPS detected. It says UBX but “not ok”, so presumably, it’s still searching. What module is it under the hood, and what protocol does it talk? You mention NMEA? If you set the protocol to NMEA using the param GPS_1_PROTOCOL, does that help?
My hunch is that PX4 doesn’t really have support for this module.
HI!
I have successfully transferred the GPS data to PX4. But there is a problem, I don’t know if the navigation is correctly transferred to PX4, because in the GPS_RAW_INIT message, the yaw data is 0
This picture should show that my GPS is correctly configured:
There is a small phenomenon:On the QGC client,Course Over Ground(COG) keeps jumping.
I have another question, how can I view the positioning results after EKF fusion?
You likely have to make sure a few more of the fields are valid, e.g. eph, epv, etc. for it to work properly with EKF2. Best to check the EKF2 code to see what it uses.
Look at the local_position and global_position topics.
Hello! With your guidance, I have successfully obtained all the data information, but when I use rosbag to record mavros topics /mavros/global_position/compass_hdg, /mavros/global_position/global and /mavros/global_position/local, I find that the data flow is sometimes there and sometimes not. What is the problem? I really need your help!
That’s probably just logging drops. Are you using a fast SD card?
The problem seems to be that when the horizontal velocity is unstable, it will cause local position errors and global position errors. At this time, MAVROS will not send GLOBAL_POSITION_INT messages. Therefore, when I use rosbag record, I cannot record these topics.